Classes | |
class | field< oT > |
A lightweight 2D container for abitrary objects (the objects must have a copy constructor). More... | |
class | field_aux |
Functions | |
field::~field () | |
field::field () | |
field::field (const field &x) | |
construct a field from a given field | |
const field & | field::operator= (const field &x) |
construct a field from a given field | |
field::field (const subview_field< oT > &x) | |
construct a field from subview_field (e.g. construct a field from a delayed subfield operation) | |
const field & | field::operator= (const subview_field< oT > &x) |
construct a field from subview_field (e.g. construct a field from a delayed subfield operation) | |
field::field (const u32 n_elem_in) | |
construct the field with the specified number of elements, assuming a column-major layout | |
field::field (const u32 n_rows_in, const u32 n_cols_in) | |
construct the field with the specified dimensions | |
void | field::set_size (const u32 n_obj_in) |
change the field to have the specified number of elements, assuming a column-major layout (data is not preserved) | |
void | field::set_size (const u32 n_rows_in, const u32 n_cols_in) |
change the field to have the specified dimensions (data is not preserved) | |
void | field::copy_size (const field &x) |
change the field to have the specified dimensions (data is not preserved) | |
arma_inline oT & | field::operator[] (const u32 i) |
linear element accessor (treats the field as a vector); no bounds check | |
arma_inline const oT & | field::operator[] (const u32 i) const |
linear element accessor (treats the field as a vector); no bounds check | |
arma_inline oT & | field::operator() (const u32 i) |
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline const oT & | field::operator() (const u32 i) const |
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline oT & | field::operator() (const u32 row, const u32 col) |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline const oT & | field::operator() (const u32 row, const u32 col) const |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline oT & | field::at (const u32 row, const u32 col) |
element accessor; no bounds check | |
arma_inline const oT & | field::at (const u32 row, const u32 col) const |
element accessor; no bounds check | |
subview_field< oT > | field::row (const u32 row_num) |
creation of subview_field (row of a field) | |
const subview_field< oT > | field::row (const u32 row_num) const |
creation of subview_field (row of a field) | |
subview_field< oT > | field::col (const u32 col_num) |
creation of subview_field (column of a field) | |
const subview_field< oT > | field::col (const u32 col_num) const |
creation of subview_field (column of a field) | |
subview_field< oT > | field::rows (const u32 in_row1, const u32 in_row2) |
creation of subview_field (subfield comprised of specified rows) | |
const subview_field< oT > | field::rows (const u32 in_row1, const u32 in_row2) const |
creation of subview_field (subfield comprised of specified rows) | |
subview_field< oT > | field::cols (const u32 in_col1, const u32 in_col2) |
creation of subview_field (subfield comprised of specified columns) | |
const subview_field< oT > | field::cols (const u32 in_col1, const u32 in_col2) const |
creation of subview_field (subfield comprised of specified columns) | |
subview_field< oT > | field::subfield (const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2) |
creation of subview_field (subfield with arbitrary dimensions) | |
const subview_field< oT > | field::subfield (const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2) const |
creation of subview_field (generic submatrix) | |
void | field::print (const std::string extra_text="") const |
print contents of the field (to the cout stream), optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined. | |
void | field::print (std::ostream &user_stream, const std::string extra_text="") const |
print contents of the field to a user specified stream, optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined. | |
void | field::fill (const oT &x) |
fill the field with an object | |
void | field::reset () |
void | field::reset_objects () |
void | field::save (const std::string name, const file_type type=arma_binary) const |
void | field::load (const std::string name, const file_type type=auto_detect) |
void | field::init (const field< oT > &x) |
construct a field from a given field | |
void | field::init (const u32 n_rows_in, const u32 n_cols_in) |
internal field construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new' | |
void | field::delete_objects () |
void | field::create_objects () |
template<typename oT > | |
static void | field_aux::reset_objects (field< oT > &x) |
template<typename eT > | |
static void | field_aux::reset_objects (field< Mat< eT > > &x) |
template<typename eT > | |
static void | field_aux::reset_objects (field< Col< eT > > &x) |
template<typename eT > | |
static void | field_aux::reset_objects (field< Row< eT > > &x) |
template<typename eT > | |
static void | field_aux::reset_objects (field< Cube< eT > > &x) |
static void | field_aux::reset_objects (field< std::string > &x) |
template<typename oT > | |
static void | field_aux::save (const field< oT > &x, const std::string &name, const file_type type) |
template<typename oT > | |
static void | field_aux::load (field< oT > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::save (const field< Mat< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::load (field< Mat< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::save (const field< Col< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::load (field< Col< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::save (const field< Row< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::load (field< Row< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::save (const field< Cube< eT > > &x, const std::string &name, const file_type type) |
template<typename eT > | |
static void | field_aux::load (field< Cube< eT > > &x, const std::string &name, const file_type type) |
static void | field_aux::save (const field< std::string > &x, const std::string &name, const file_type type) |
static void | field_aux::load (field< std::string > &x, const std::string &name, const file_type type) |
Definition at line 22 of file field_meat.hpp.
References arma_config::debug, field< oT >::delete_objects(), field< oT >::mem, field< oT >::mem_local, field< oT >::n_cols, field< oT >::n_elem, field< oT >::n_rows, and access::rw().
00023 { 00024 arma_extra_debug_sigprint_this(this); 00025 00026 delete_objects(); 00027 00028 if(n_elem > sizeof(mem_local)/sizeof(oT*) ) 00029 { 00030 delete [] mem; 00031 } 00032 00033 if(arma_config::debug == true) 00034 { 00035 // try to expose buggy user code that accesses deleted objects 00036 access::rw(n_rows) = 0; 00037 access::rw(n_cols) = 0; 00038 access::rw(n_elem) = 0; 00039 mem = 0; 00040 } 00041 }
construct a field from a given field
Definition at line 61 of file field_meat.hpp.
References field< oT >::init().
const field< oT > & field< oT >::operator= | ( | const field< oT > & | x | ) | [inline, inherited] |
construct a field from a given field
Definition at line 78 of file field_meat.hpp.
References field< oT >::init().
Referenced by field< oT >::field().
00079 { 00080 arma_extra_debug_sigprint(); 00081 00082 init(x); 00083 return *this; 00084 }
field< oT >::field | ( | const subview_field< oT > & | x | ) | [inline, inherited] |
construct a field from subview_field (e.g. construct a field from a delayed subfield operation)
Definition at line 91 of file field_meat.hpp.
References field< oT >::operator=().
const field< oT > & field< oT >::operator= | ( | const subview_field< oT > & | x | ) | [inline, inherited] |
construct a field from subview_field (e.g. construct a field from a delayed subfield operation)
Definition at line 108 of file field_meat.hpp.
00109 { 00110 arma_extra_debug_sigprint(); 00111 00112 subview_field<oT>::extract(*this, X); 00113 return *this; 00114 }
construct the field with the specified number of elements, assuming a column-major layout
Definition at line 122 of file field_meat.hpp.
References field< oT >::init().
field< oT >::field | ( | const u32 | n_rows_in, | |
const u32 | n_cols_in | |||
) | [inline, inherited] |
construct the field with the specified dimensions
Definition at line 138 of file field_meat.hpp.
References field< oT >::init().
change the field to have the specified number of elements, assuming a column-major layout (data is not preserved)
Definition at line 156 of file field_meat.hpp.
References field< oT >::init().
Referenced by subview_field< oT >::extract(), diskio::load_arma_binary(), diskio::load_ppm_binary(), and diskio::load_std_string().
00157 { 00158 arma_extra_debug_sigprint(arma_boost::format("n_elem_in = %d") % n_elem_in); 00159 00160 init(n_elem_in, 1); 00161 }
void field< oT >::set_size | ( | const u32 | n_rows_in, | |
const u32 | n_cols_in | |||
) | [inline, inherited] |
change the field to have the specified dimensions (data is not preserved)
Definition at line 169 of file field_meat.hpp.
References field< oT >::init().
00170 { 00171 arma_extra_debug_sigprint(arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in); 00172 00173 init(n_rows_in, n_cols_in); 00174 }
change the field to have the specified dimensions (data is not preserved)
Definition at line 182 of file field_meat.hpp.
References field< oT >::init(), field< oT >::n_cols, and field< oT >::n_rows.
linear element accessor (treats the field as a vector); no bounds check
Definition at line 198 of file field_meat.hpp.
References field< oT >::mem.
00199 { 00200 return (*mem[i]); 00201 }
arma_inline const oT & field< oT >::operator[] | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the field as a vector); no bounds check
Definition at line 209 of file field_meat.hpp.
References field< oT >::mem.
00210 { 00211 return (*mem[i]); 00212 }
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 219 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
arma_inline const oT & field< oT >::operator() | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 231 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
arma_inline oT & field< oT >::operator() | ( | const u32 | row, | |
const u32 | col | |||
) | [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 243 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
arma_inline const oT & field< oT >::operator() | ( | const u32 | row, | |
const u32 | col | |||
) | const [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 255 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
arma_inline oT & field< oT >::at | ( | const u32 | row, | |
const u32 | col | |||
) | [inline, inherited] |
element accessor; no bounds check
Definition at line 267 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_rows.
Referenced by subview_field< oT >::extract(), field< oT >::init(), diskio::load_std_string(), subview_field< oT >::operator=(), arma_ostream::print(), and diskio::save_std_string().
arma_inline const oT & field< oT >::at | ( | const u32 | row, | |
const u32 | col | |||
) | const [inline, inherited] |
element accessor; no bounds check
Definition at line 278 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_rows.
subview_field< oT > field< oT >::row | ( | const u32 | row_num | ) | [inline, inherited] |
creation of subview_field (row of a field)
Definition at line 289 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
Referenced by subview< eT >::div_inplace(), subview< eT >::extract(), subview< eT >::fill(), field< oT >::init(), subview< eT >::minus_inplace(), subview< eT >::operator%=(), subview< eT >::operator*=(), subview< eT >::operator+=(), subview< eT >::operator-=(), subview< eT >::operator/=(), subview< eT >::operator=(), subview< eT >::plus_inplace(), subview< eT >::schur_inplace(), and subview< eT >::zeros().
00290 { 00291 arma_extra_debug_sigprint(); 00292 00293 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00294 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00295 }
const subview_field< oT > field< oT >::row | ( | const u32 | row_num | ) | const [inline, inherited] |
creation of subview_field (row of a field)
Definition at line 303 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00304 { 00305 arma_extra_debug_sigprint(); 00306 00307 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00308 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00309 }
subview_field< oT > field< oT >::col | ( | const u32 | col_num | ) | [inline, inherited] |
creation of subview_field (column of a field)
Definition at line 317 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
Referenced by subview< eT >::div_inplace(), subview< eT >::extract(), subview< eT >::fill(), field< oT >::init(), subview< eT >::minus_inplace(), subview< eT >::operator%=(), subview< eT >::operator*=(), subview< eT >::operator+=(), subview< eT >::operator-=(), subview< eT >::operator/=(), subview< eT >::operator=(), subview< eT >::plus_inplace(), subview< eT >::schur_inplace(), and subview< eT >::zeros().
00318 { 00319 arma_extra_debug_sigprint(); 00320 00321 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00322 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00323 }
const subview_field< oT > field< oT >::col | ( | const u32 | col_num | ) | const [inline, inherited] |
creation of subview_field (column of a field)
Definition at line 331 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00332 { 00333 arma_extra_debug_sigprint(); 00334 00335 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00336 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00337 }
subview_field< oT > field< oT >::rows | ( | const u32 | in_row1, | |
const u32 | in_row2 | |||
) | [inline, inherited] |
creation of subview_field (subfield comprised of specified rows)
Definition at line 345 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00346 { 00347 arma_extra_debug_sigprint(); 00348 00349 arma_debug_check 00350 ( 00351 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00352 "field::rows(): indicies out of bounds or incorrectly used" 00353 ); 00354 00355 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00356 }
const subview_field< oT > field< oT >::rows | ( | const u32 | in_row1, | |
const u32 | in_row2 | |||
) | const [inline, inherited] |
creation of subview_field (subfield comprised of specified rows)
Definition at line 364 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00365 { 00366 arma_extra_debug_sigprint(); 00367 00368 arma_debug_check 00369 ( 00370 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00371 "field::rows(): indicies out of bounds or incorrectly used" 00372 ); 00373 00374 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00375 }
subview_field< oT > field< oT >::cols | ( | const u32 | in_col1, | |
const u32 | in_col2 | |||
) | [inline, inherited] |
creation of subview_field (subfield comprised of specified columns)
Definition at line 383 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00384 { 00385 arma_extra_debug_sigprint(); 00386 00387 arma_debug_check 00388 ( 00389 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00390 "field::cols(): indicies out of bounds or incorrectly used" 00391 ); 00392 00393 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00394 }
const subview_field< oT > field< oT >::cols | ( | const u32 | in_col1, | |
const u32 | in_col2 | |||
) | const [inline, inherited] |
creation of subview_field (subfield comprised of specified columns)
Definition at line 402 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00403 { 00404 arma_extra_debug_sigprint(); 00405 00406 arma_debug_check 00407 ( 00408 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00409 "field::cols(): indicies out of bounds or incorrectly used" 00410 ); 00411 00412 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00413 }
subview_field< oT > field< oT >::subfield | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_row2, | |||
const u32 | in_col2 | |||
) | [inline, inherited] |
creation of subview_field (subfield with arbitrary dimensions)
Definition at line 421 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00422 { 00423 arma_extra_debug_sigprint(); 00424 00425 arma_debug_check 00426 ( 00427 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00428 "field::subfield(): indices out of bounds or incorrectly used" 00429 ); 00430 00431 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00432 }
const subview_field< oT > field< oT >::subfield | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_row2, | |||
const u32 | in_col2 | |||
) | const [inline, inherited] |
creation of subview_field (generic submatrix)
Definition at line 440 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00441 { 00442 arma_extra_debug_sigprint(); 00443 00444 arma_debug_check 00445 ( 00446 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00447 "field::subfield(): indices out of bounds or incorrectly used" 00448 ); 00449 00450 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00451 }
void field< oT >::print | ( | const std::string | extra_text = "" |
) | const [inline, inherited] |
print contents of the field (to the cout stream), optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined.
Definition at line 467 of file field_meat.hpp.
Referenced by field< oT >::print().
00468 { 00469 arma_extra_debug_sigprint(); 00470 00471 if(extra_text.length() != 0) 00472 { 00473 const std::streamsize orig_width = cout.width(); 00474 00475 cout << extra_text << '\n'; 00476 00477 cout.width(orig_width); 00478 } 00479 00480 arma_ostream::print(cout, *this); 00481 }
void field< oT >::print | ( | std::ostream & | user_stream, | |
const std::string | extra_text = "" | |||
) | const [inline, inherited] |
print contents of the field to a user specified stream, optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined.
Definition at line 497 of file field_meat.hpp.
References field< oT >::print().
00498 { 00499 arma_extra_debug_sigprint(); 00500 00501 if(extra_text.length() != 0) 00502 { 00503 const std::streamsize orig_width = user_stream.width(); 00504 00505 user_stream << extra_text << '\n'; 00506 00507 user_stream.width(orig_width); 00508 } 00509 00510 arma_ostream::print(user_stream, *this); 00511 }
void field< oT >::fill | ( | const oT & | x | ) | [inline, inherited] |
fill the field with an object
Definition at line 519 of file field_meat.hpp.
References field< oT >::n_elem.
void field< oT >::reset | ( | ) | [inline, inherited] |
Definition at line 536 of file field_meat.hpp.
References field< oT >::init().
Referenced by field_aux::load(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and diskio::load_std_string().
00537 { 00538 arma_extra_debug_sigprint(); 00539 00540 init(0,0); 00541 }
void field< oT >::reset_objects | ( | ) | [inline, inherited] |
Definition at line 548 of file field_meat.hpp.
00549 { 00550 arma_extra_debug_sigprint(); 00551 00552 field_aux::reset_objects(*this); 00553 }
void field< oT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
Definition at line 560 of file field_meat.hpp.
00561 { 00562 arma_extra_debug_sigprint(); 00563 00564 field_aux::save(*this, name, type); 00565 }
void field< oT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
Definition at line 572 of file field_meat.hpp.
00573 { 00574 arma_extra_debug_sigprint(); 00575 00576 field_aux::load(*this, name, type); 00577 }
void field< oT >::init | ( | const field< oT > & | x | ) | [inline, private, inherited] |
construct a field from a given field
Definition at line 585 of file field_meat.hpp.
References field< oT >::at(), field< oT >::col(), field< oT >::n_cols, field< oT >::n_rows, and field< oT >::row().
Referenced by field< oT >::copy_size(), field< oT >::field(), field< oT >::operator=(), field< oT >::reset(), and field< oT >::set_size().
00586 { 00587 arma_extra_debug_sigprint(); 00588 00589 if(this != &x) 00590 { 00591 init(x.n_rows, x.n_cols); 00592 00593 field& t = *this; 00594 00595 for(u32 col=0; col<x.n_cols; ++col) 00596 for(u32 row=0; row<x.n_rows; ++row) 00597 { 00598 t.at(row,col) = x.at(row,col); 00599 } 00600 } 00601 00602 }
void field< oT >::init | ( | const u32 | n_rows_in, | |
const u32 | n_cols_in | |||
) | [inline, private, inherited] |
internal field construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new'
Definition at line 610 of file field_meat.hpp.
References arma_check(), field< oT >::create_objects(), field< oT >::delete_objects(), field< oT >::mem, field< oT >::mem_local, field< oT >::n_cols, field< oT >::n_elem, field< oT >::n_rows, and access::rw().
00611 { 00612 arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in ); 00613 00614 const u32 n_elem_new = n_rows_in * n_cols_in; 00615 00616 if(n_elem == n_elem_new) 00617 { 00618 // delete_objects(); 00619 // create_objects(); 00620 access::rw(n_rows) = n_rows_in; 00621 access::rw(n_cols) = n_cols_in; 00622 } 00623 else 00624 { 00625 delete_objects(); 00626 00627 if(n_elem > sizeof(mem_local)/sizeof(oT*) ) 00628 { 00629 delete [] mem; 00630 } 00631 00632 if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) ) 00633 { 00634 mem = mem_local; 00635 } 00636 else 00637 { 00638 mem = new(std::nothrow) oT* [n_elem_new]; 00639 arma_check( (mem == 0), "field::init(): out of memory" ); 00640 } 00641 00642 access::rw(n_elem) = n_elem_new; 00643 00644 if(n_elem_new == 0) 00645 { 00646 access::rw(n_rows) = 0; 00647 access::rw(n_cols) = 0; 00648 } 00649 else 00650 { 00651 access::rw(n_rows) = n_rows_in; 00652 access::rw(n_cols) = n_cols_in; 00653 } 00654 00655 create_objects(); 00656 00657 } 00658 00659 }
void field< oT >::delete_objects | ( | ) | [inline, private, inherited] |
Definition at line 666 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
Referenced by field< oT >::init(), field_aux::reset_objects(), and field< oT >::~field().
void field< oT >::create_objects | ( | ) | [inline, private, inherited] |
Definition at line 686 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
Referenced by field< oT >::init(), and field_aux::reset_objects().
00687 { 00688 arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); 00689 00690 for(u32 i=0; i<n_elem; ++i) 00691 { 00692 mem[i] = new oT; 00693 } 00694 00695 }
void field_aux::reset_objects | ( | field< oT > & | x | ) | [inline, static, inherited] |
Definition at line 708 of file field_meat.hpp.
References field< oT >::create_objects(), and field< oT >::delete_objects().
00709 { 00710 arma_extra_debug_sigprint(); 00711 00712 x.delete_objects(); 00713 x.create_objects(); 00714 }
void field_aux::reset_objects | ( | field< Mat< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 721 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Col< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 736 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Row< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 751 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Cube< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 766 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< std::string > & | x | ) | [inline, static, inherited] |
Definition at line 780 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
void field_aux::save | ( | const field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 801 of file field_meat.hpp.
References arma_print().
00802 { 00803 arma_extra_debug_sigprint(); 00804 00805 arma_print("field_aux::save(): sorry, saving this type of field is currently not supported"); 00806 }
void field_aux::load | ( | field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 813 of file field_meat.hpp.
References arma_print(), and field< oT >::reset().
00814 { 00815 arma_extra_debug_sigprint(); 00816 00817 arma_print("field_aux::load(): sorry, loading this type of field is currently not supported"); 00818 x.reset(); 00819 }
void field_aux::save | ( | const field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 826 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
00827 { 00828 arma_extra_debug_sigprint(); 00829 00830 switch(type) 00831 { 00832 case arma_binary: 00833 diskio::save_arma_binary(x, name); 00834 break; 00835 00836 case ppm_binary: 00837 diskio::save_ppm_binary(x, name); 00838 break; 00839 00840 default: 00841 arma_stop("field_aux::save(): unsupported type"); 00842 } 00843 }
void field_aux::load | ( | field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 850 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
00851 { 00852 arma_extra_debug_sigprint(); 00853 00854 switch(type) 00855 { 00856 case auto_detect: 00857 diskio::load_auto_detect(x, name); 00858 break; 00859 00860 case arma_binary: 00861 diskio::load_arma_binary(x, name); 00862 break; 00863 00864 case ppm_binary: 00865 diskio::load_ppm_binary(x, name); 00866 break; 00867 00868 default: 00869 arma_stop("field_aux::load(): unsupported type"); 00870 } 00871 }
void field_aux::save | ( | const field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 878 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
00879 { 00880 arma_extra_debug_sigprint(); 00881 00882 switch(type) 00883 { 00884 case arma_binary: 00885 diskio::save_arma_binary(x, name); 00886 break; 00887 00888 case ppm_binary: 00889 diskio::save_ppm_binary(x, name); 00890 break; 00891 00892 default: 00893 arma_stop("field_aux::save(): unsupported type"); 00894 } 00895 }
void field_aux::load | ( | field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 902 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
00903 { 00904 arma_extra_debug_sigprint(); 00905 00906 switch(type) 00907 { 00908 case auto_detect: 00909 diskio::load_auto_detect(x, name); 00910 break; 00911 00912 case arma_binary: 00913 diskio::load_arma_binary(x, name); 00914 break; 00915 00916 case ppm_binary: 00917 diskio::load_ppm_binary(x, name); 00918 break; 00919 00920 default: 00921 arma_stop("field_aux::load(): unsupported type"); 00922 } 00923 }
void field_aux::save | ( | const field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 930 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
00931 { 00932 arma_extra_debug_sigprint(); 00933 00934 switch(type) 00935 { 00936 case arma_binary: 00937 diskio::save_arma_binary(x, name); 00938 break; 00939 00940 case ppm_binary: 00941 diskio::save_ppm_binary(x, name); 00942 break; 00943 00944 default: 00945 arma_stop("field_aux::save(): unsupported type"); 00946 } 00947 }
void field_aux::load | ( | field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 954 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
00955 { 00956 arma_extra_debug_sigprint(); 00957 00958 switch(type) 00959 { 00960 case auto_detect: 00961 diskio::load_auto_detect(x, name); 00962 break; 00963 00964 case arma_binary: 00965 diskio::load_arma_binary(x, name); 00966 break; 00967 00968 case ppm_binary: 00969 diskio::load_ppm_binary(x, name); 00970 break; 00971 00972 default: 00973 arma_stop("field_aux::load(): unsupported type"); 00974 } 00975 }
void field_aux::save | ( | const field< Cube< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 982 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
00983 { 00984 arma_extra_debug_sigprint(); 00985 00986 switch(type) 00987 { 00988 case arma_binary: 00989 diskio::save_arma_binary(x, name); 00990 break; 00991 00992 case ppm_binary: 00993 diskio::save_ppm_binary(x, name); 00994 break; 00995 00996 default: 00997 arma_stop("field_aux::save(): unsupported type"); 00998 } 00999 }
void field_aux::load | ( | field< Cube< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 1006 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
01007 { 01008 arma_extra_debug_sigprint(); 01009 01010 switch(type) 01011 { 01012 case auto_detect: 01013 diskio::load_auto_detect(x, name); 01014 break; 01015 01016 case arma_binary: 01017 diskio::load_arma_binary(x, name); 01018 break; 01019 01020 case ppm_binary: 01021 diskio::load_ppm_binary(x, name); 01022 break; 01023 01024 default: 01025 arma_stop("field_aux::load(): unsupported type"); 01026 } 01027 }
void field_aux::save | ( | const field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 1033 of file field_meat.hpp.
References diskio::save_std_string().
01034 { 01035 arma_extra_debug_sigprint(); 01036 01037 diskio::save_std_string(x, name); 01038 }
void field_aux::load | ( | field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 1044 of file field_meat.hpp.
References diskio::load_std_string().
01045 { 01046 arma_extra_debug_sigprint(); 01047 01048 diskio::load_std_string(x, name); 01049 }