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) | |
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, optionally preceding with a user specified line of text | |
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) |
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) |
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, and field< oT >::n_elem.
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 mem = 0; // try to expose buggy code that still accesses a deleted 'field' 00036 } 00037 }
construct a field from a given field
Definition at line 57 of file field_meat.hpp.
References field< oT >::init().
00058 : n_rows(0) 00059 , n_cols(0) 00060 , n_elem(0) 00061 , mem(0) 00062 { 00063 arma_extra_debug_sigprint(arma_boost::format("this = %x x = %x") % this % &x); 00064 00065 init(x); 00066 }
const field< oT > & field< oT >::operator= | ( | const field< oT > & | x | ) | [inline, inherited] |
construct a field from a given field
Definition at line 74 of file field_meat.hpp.
References field< oT >::init().
Referenced by field< oT >::field().
00075 { 00076 arma_extra_debug_sigprint(); 00077 00078 init(x); 00079 return *this; 00080 }
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 87 of file field_meat.hpp.
References field< oT >::operator=().
00088 : n_rows(0) 00089 , n_cols(0) 00090 , n_elem(0) 00091 , mem(0) 00092 { 00093 arma_extra_debug_sigprint_this(this); 00094 00095 this->operator=(X); 00096 }
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 104 of file field_meat.hpp.
00105 { 00106 arma_extra_debug_sigprint(); 00107 00108 subview_field<oT>::extract(*this, X); 00109 return *this; 00110 }
construct the field with the specified number of elements, assuming a column-major layout
Definition at line 118 of file field_meat.hpp.
References field< oT >::init().
00119 : n_rows(0) 00120 , n_cols(0) 00121 , n_elem(0) 00122 , mem(0) 00123 { 00124 arma_extra_debug_sigprint_this(this); 00125 00126 init(n_elem_in, 1); 00127 }
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 134 of file field_meat.hpp.
References field< oT >::init().
00135 : n_rows(0) 00136 , n_cols(0) 00137 , n_elem(0) 00138 , mem(0) 00139 { 00140 arma_extra_debug_sigprint_this(this); 00141 00142 init(n_rows_in, n_cols_in); 00143 }
change the field to have the specified number of elements, assuming a column-major layout (data is not preserved)
Definition at line 152 of file field_meat.hpp.
References field< oT >::init().
Referenced by subview_field< oT >::extract(), diskio::load_field_arma_binary(), diskio::load_field_ppm_binary(), and diskio::load_field_std_string().
00153 { 00154 arma_extra_debug_sigprint(arma_boost::format("n_elem_in = %d") % n_elem_in); 00155 00156 init(n_elem_in, 1); 00157 }
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 165 of file field_meat.hpp.
References field< oT >::init().
00166 { 00167 arma_extra_debug_sigprint(arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in); 00168 00169 init(n_rows_in, n_cols_in); 00170 }
linear element accessor (treats the field as a vector); no bounds check
Definition at line 178 of file field_meat.hpp.
References field< oT >::mem.
00179 { 00180 return (*mem[i]); 00181 }
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 189 of file field_meat.hpp.
References field< oT >::mem.
00190 { 00191 return (*mem[i]); 00192 }
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 199 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00200 { 00201 arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds"); 00202 return (*mem[i]); 00203 }
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 211 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00212 { 00213 arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds"); 00214 return (*mem[i]); 00215 }
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 223 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
00224 { 00225 arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds"); 00226 return (*mem[in_row + in_col*n_rows]); 00227 }
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 235 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
00236 { 00237 arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds"); 00238 return (*mem[in_row + in_col*n_rows]); 00239 }
arma_inline oT & field< oT >::at | ( | const u32 | row, | |
const u32 | col | |||
) | [inline, inherited] |
element accessor; no bounds check
Definition at line 247 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_field_std_string(), subview_field< oT >::operator=(), and diskio::save_field_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 258 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 269 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().
00270 { 00271 arma_extra_debug_sigprint(); 00272 00273 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00274 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00275 }
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 283 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00284 { 00285 arma_extra_debug_sigprint(); 00286 00287 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00288 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00289 }
subview_field< oT > field< oT >::col | ( | const u32 | col_num | ) | [inline, inherited] |
creation of subview_field (column of a field)
Definition at line 297 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().
00298 { 00299 arma_extra_debug_sigprint(); 00300 00301 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00302 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00303 }
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 311 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00312 { 00313 arma_extra_debug_sigprint(); 00314 00315 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00316 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00317 }
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 325 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00326 { 00327 arma_extra_debug_sigprint(); 00328 00329 arma_debug_check 00330 ( 00331 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00332 "field::rows(): indicies out of bounds or incorrectly used" 00333 ); 00334 00335 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00336 }
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 344 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00345 { 00346 arma_extra_debug_sigprint(); 00347 00348 arma_debug_check 00349 ( 00350 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00351 "field::rows(): indicies out of bounds or incorrectly used" 00352 ); 00353 00354 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00355 }
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 363 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00364 { 00365 arma_extra_debug_sigprint(); 00366 00367 arma_debug_check 00368 ( 00369 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00370 "field::cols(): indicies out of bounds or incorrectly used" 00371 ); 00372 00373 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00374 }
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 382 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00383 { 00384 arma_extra_debug_sigprint(); 00385 00386 arma_debug_check 00387 ( 00388 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00389 "field::cols(): indicies out of bounds or incorrectly used" 00390 ); 00391 00392 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00393 }
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 401 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00402 { 00403 arma_extra_debug_sigprint(); 00404 00405 arma_debug_check 00406 ( 00407 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00408 "field::subfield(): indices out of bounds or incorrectly used" 00409 ); 00410 00411 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00412 }
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 420 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00421 { 00422 arma_extra_debug_sigprint(); 00423 00424 arma_debug_check 00425 ( 00426 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00427 "field::subfield(): indices out of bounds or incorrectly used" 00428 ); 00429 00430 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00431 }
void field< oT >::print | ( | const std::string | extra_text = "" |
) | const [inline, inherited] |
print contents of the field, optionally preceding with a user specified line of text
Definition at line 439 of file field_meat.hpp.
00440 { 00441 arma_extra_debug_sigprint(); 00442 00443 if(extra_text.length() != 0) 00444 { 00445 cout << extra_text << '\n'; 00446 } 00447 00448 cout << *this << '\n'; 00449 }
void field< oT >::fill | ( | const oT & | x | ) | [inline, inherited] |
fill the field with an object
Definition at line 457 of file field_meat.hpp.
References field< oT >::n_elem.
00458 { 00459 arma_extra_debug_sigprint(); 00460 00461 field<oT>& t = *this; 00462 00463 for(u32 i=0; i<n_elem; ++i) 00464 { 00465 t[i] = x; 00466 } 00467 }
void field< oT >::reset | ( | ) | [inline, inherited] |
Definition at line 474 of file field_meat.hpp.
References field< oT >::init().
Referenced by field_aux::load(), diskio::load_field_arma_binary(), diskio::load_field_auto_detect(), diskio::load_field_ppm_binary(), and diskio::load_field_std_string().
00475 { 00476 arma_extra_debug_sigprint(); 00477 00478 init(0,0); 00479 }
void field< oT >::reset_objects | ( | ) | [inline, inherited] |
Definition at line 486 of file field_meat.hpp.
00487 { 00488 arma_extra_debug_sigprint(); 00489 00490 field_aux::reset_objects(*this); 00491 }
void field< oT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
Definition at line 498 of file field_meat.hpp.
00499 { 00500 arma_extra_debug_sigprint(); 00501 00502 field_aux::save(*this, name, type); 00503 }
void field< oT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
Definition at line 510 of file field_meat.hpp.
00511 { 00512 arma_extra_debug_sigprint(); 00513 00514 field_aux::load(*this, name, type); 00515 }
void field< oT >::init | ( | const field< oT > & | x | ) | [inline, private, inherited] |
construct a field from a given field
Definition at line 523 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 >::field(), field< oT >::operator=(), field< oT >::reset(), and field< oT >::set_size().
00524 { 00525 arma_extra_debug_sigprint(); 00526 00527 if(this != &x) 00528 { 00529 init(x.n_rows, x.n_cols); 00530 00531 field& t = *this; 00532 00533 for(u32 col=0; col<x.n_cols; ++col) 00534 for(u32 row=0; row<x.n_rows; ++row) 00535 { 00536 t.at(row,col) = x.at(row,col); 00537 } 00538 } 00539 00540 }
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 548 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().
00549 { 00550 arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in ); 00551 00552 const u32 n_elem_new = n_rows_in * n_cols_in; 00553 00554 if(n_elem == n_elem_new) 00555 { 00556 // delete_objects(); 00557 // create_objects(); 00558 access::rw(n_rows) = n_rows_in; 00559 access::rw(n_cols) = n_cols_in; 00560 } 00561 else 00562 { 00563 delete_objects(); 00564 00565 if(n_elem > sizeof(mem_local)/sizeof(oT*) ) 00566 { 00567 delete [] mem; 00568 } 00569 00570 if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) ) 00571 { 00572 mem = mem_local; 00573 } 00574 else 00575 { 00576 mem = new(std::nothrow) oT* [n_elem_new]; 00577 arma_check( (mem == 0), "field::init(): out of memory" ); 00578 } 00579 00580 access::rw(n_elem) = n_elem_new; 00581 00582 if(n_elem_new == 0) 00583 { 00584 access::rw(n_rows) = 0; 00585 access::rw(n_cols) = 0; 00586 } 00587 else 00588 { 00589 access::rw(n_rows) = n_rows_in; 00590 access::rw(n_cols) = n_cols_in; 00591 } 00592 00593 create_objects(); 00594 00595 } 00596 00597 }
void field< oT >::delete_objects | ( | ) | [inline, private, inherited] |
Definition at line 604 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().
00605 { 00606 arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); 00607 00608 for(u32 i=0; i<n_elem; ++i) 00609 { 00610 if(mem[i] != 0) 00611 { 00612 delete mem[i]; 00613 mem[i] = 0; 00614 } 00615 } 00616 00617 }
void field< oT >::create_objects | ( | ) | [inline, private, inherited] |
Definition at line 624 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
Referenced by field< oT >::init(), and field_aux::reset_objects().
00625 { 00626 arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); 00627 00628 for(u32 i=0; i<n_elem; ++i) 00629 { 00630 mem[i] = new oT; 00631 } 00632 00633 }
void field_aux::reset_objects | ( | field< oT > & | x | ) | [inline, static, inherited] |
Definition at line 646 of file field_meat.hpp.
References field< oT >::create_objects(), and field< oT >::delete_objects().
00647 { 00648 arma_extra_debug_sigprint(); 00649 00650 x.delete_objects(); 00651 x.create_objects(); 00652 }
void field_aux::reset_objects | ( | field< Mat< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 659 of file field_meat.hpp.
00660 { 00661 arma_extra_debug_sigprint(); 00662 00663 for(u32 i=0; i<x.n_elem; ++i) 00664 { 00665 (*(x.mem[i])).reset(); 00666 } 00667 }
void field_aux::reset_objects | ( | field< Col< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 674 of file field_meat.hpp.
00675 { 00676 arma_extra_debug_sigprint(); 00677 00678 for(u32 i=0; i<x.n_elem; ++i) 00679 { 00680 (*(x.mem[i])).reset(); 00681 } 00682 }
void field_aux::reset_objects | ( | field< Row< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 689 of file field_meat.hpp.
00690 { 00691 arma_extra_debug_sigprint(); 00692 00693 for(u32 i=0; i<x.n_elem; ++i) 00694 { 00695 (*(x.mem[i])).reset(); 00696 } 00697 }
void field_aux::reset_objects | ( | field< std::string > & | x | ) | [inline, static, inherited] |
Definition at line 703 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00704 { 00705 arma_extra_debug_sigprint(); 00706 00707 for(u32 i=0; i<x.n_elem; ++i) 00708 { 00709 (*(x.mem[i])).clear(); 00710 } 00711 }
void field_aux::save | ( | const field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 724 of file field_meat.hpp.
References arma_print().
00725 { 00726 arma_extra_debug_sigprint(); 00727 00728 arma_print("field_aux::save(): sorry, saving this type of field is currently not supported"); 00729 }
void field_aux::load | ( | field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 736 of file field_meat.hpp.
References arma_print(), and field< oT >::reset().
00737 { 00738 arma_extra_debug_sigprint(); 00739 00740 arma_print("field_aux::load(): sorry, loading this type of field is currently not supported"); 00741 x.reset(); 00742 }
void field_aux::save | ( | const field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 749 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00750 { 00751 arma_extra_debug_sigprint(); 00752 00753 switch(type) 00754 { 00755 case arma_binary: 00756 diskio::save_field_arma_binary(x, name); 00757 break; 00758 00759 case ppm_binary: 00760 diskio::save_field_ppm_binary(x, name); 00761 break; 00762 00763 default: 00764 arma_stop("field_aux::save(): unsupported type"); 00765 } 00766 }
void field_aux::load | ( | field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 773 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_field_arma_binary(), diskio::load_field_auto_detect(), diskio::load_field_ppm_binary(), and ppm_binary.
00774 { 00775 arma_extra_debug_sigprint(); 00776 00777 switch(type) 00778 { 00779 case auto_detect: 00780 diskio::load_field_auto_detect(x, name); 00781 break; 00782 00783 case arma_binary: 00784 diskio::load_field_arma_binary(x, name); 00785 break; 00786 00787 case ppm_binary: 00788 diskio::load_field_ppm_binary(x, name); 00789 break; 00790 00791 default: 00792 arma_stop("field_aux::load(): unsupported type"); 00793 } 00794 }
void field_aux::save | ( | const field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 801 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00802 { 00803 arma_extra_debug_sigprint(); 00804 00805 switch(type) 00806 { 00807 case arma_binary: 00808 diskio::save_field_arma_binary(x, name); 00809 break; 00810 00811 case ppm_binary: 00812 diskio::save_field_ppm_binary(x, name); 00813 break; 00814 00815 default: 00816 arma_stop("field_aux::save(): unsupported type"); 00817 } 00818 }
void field_aux::load | ( | field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 825 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_field_arma_binary(), diskio::load_field_auto_detect(), diskio::load_field_ppm_binary(), and ppm_binary.
00826 { 00827 arma_extra_debug_sigprint(); 00828 00829 switch(type) 00830 { 00831 case auto_detect: 00832 diskio::load_field_auto_detect(x, name); 00833 break; 00834 00835 case arma_binary: 00836 diskio::load_field_arma_binary(x, name); 00837 break; 00838 00839 case ppm_binary: 00840 diskio::load_field_ppm_binary(x, name); 00841 break; 00842 00843 default: 00844 arma_stop("field_aux::load(): unsupported type"); 00845 } 00846 }
void field_aux::save | ( | const field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 853 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00854 { 00855 arma_extra_debug_sigprint(); 00856 00857 switch(type) 00858 { 00859 case arma_binary: 00860 diskio::save_field_arma_binary(x, name); 00861 break; 00862 00863 case ppm_binary: 00864 diskio::save_field_ppm_binary(x, name); 00865 break; 00866 00867 default: 00868 arma_stop("field_aux::save(): unsupported type"); 00869 } 00870 }
void field_aux::load | ( | field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 877 of file field_meat.hpp.
References arma_binary, arma_stop(), auto_detect, diskio::load_field_arma_binary(), diskio::load_field_auto_detect(), diskio::load_field_ppm_binary(), and ppm_binary.
00878 { 00879 arma_extra_debug_sigprint(); 00880 00881 switch(type) 00882 { 00883 case auto_detect: 00884 diskio::load_field_auto_detect(x, name); 00885 break; 00886 00887 case arma_binary: 00888 diskio::load_field_arma_binary(x, name); 00889 break; 00890 00891 case ppm_binary: 00892 diskio::load_field_ppm_binary(x, name); 00893 break; 00894 00895 default: 00896 arma_stop("field_aux::load(): unsupported type"); 00897 } 00898 }
void field_aux::save | ( | const field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 904 of file field_meat.hpp.
References diskio::save_field_std_string().
00905 { 00906 arma_extra_debug_sigprint(); 00907 00908 diskio::save_field_std_string(x, name); 00909 }
void field_aux::load | ( | field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 915 of file field_meat.hpp.
References diskio::load_field_std_string().
00916 { 00917 arma_extra_debug_sigprint(); 00918 00919 diskio::load_field_std_string(x, name); 00920 }