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, 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().
00062 : n_rows(0) 00063 , n_cols(0) 00064 , n_elem(0) 00065 , mem(0) 00066 { 00067 arma_extra_debug_sigprint(arma_boost::format("this = %x x = %x") % this % &x); 00068 00069 init(x); 00070 }
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=().
00092 : n_rows(0) 00093 , n_cols(0) 00094 , n_elem(0) 00095 , mem(0) 00096 { 00097 arma_extra_debug_sigprint_this(this); 00098 00099 this->operator=(X); 00100 }
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().
00123 : n_rows(0) 00124 , n_cols(0) 00125 , n_elem(0) 00126 , mem(0) 00127 { 00128 arma_extra_debug_sigprint_this(this); 00129 00130 init(n_elem_in, 1); 00131 }
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().
00139 : n_rows(0) 00140 , n_cols(0) 00141 , n_elem(0) 00142 , mem(0) 00143 { 00144 arma_extra_debug_sigprint_this(this); 00145 00146 init(n_rows_in, n_cols_in); 00147 }
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_field_arma_binary(), diskio::load_field_ppm_binary(), and diskio::load_field_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 }
linear element accessor (treats the field as a vector); no bounds check
Definition at line 182 of file field_meat.hpp.
References field< oT >::mem.
00183 { 00184 return (*mem[i]); 00185 }
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 193 of file field_meat.hpp.
References field< oT >::mem.
00194 { 00195 return (*mem[i]); 00196 }
linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 203 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00204 { 00205 arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds"); 00206 return (*mem[i]); 00207 }
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 215 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00216 { 00217 arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds"); 00218 return (*mem[i]); 00219 }
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 227 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
00228 { 00229 arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds"); 00230 return (*mem[in_row + in_col*n_rows]); 00231 }
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 239 of file field_meat.hpp.
References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.
00240 { 00241 arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds"); 00242 return (*mem[in_row + in_col*n_rows]); 00243 }
arma_inline oT & field< oT >::at | ( | const u32 | row, | |
const u32 | col | |||
) | [inline, inherited] |
element accessor; no bounds check
Definition at line 251 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 262 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 273 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().
00274 { 00275 arma_extra_debug_sigprint(); 00276 00277 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00278 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00279 }
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 287 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00288 { 00289 arma_extra_debug_sigprint(); 00290 00291 arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); 00292 return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); 00293 }
subview_field< oT > field< oT >::col | ( | const u32 | col_num | ) | [inline, inherited] |
creation of subview_field (column of a field)
Definition at line 301 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().
00302 { 00303 arma_extra_debug_sigprint(); 00304 00305 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00306 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00307 }
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 315 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00316 { 00317 arma_extra_debug_sigprint(); 00318 00319 arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); 00320 return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); 00321 }
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 329 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00330 { 00331 arma_extra_debug_sigprint(); 00332 00333 arma_debug_check 00334 ( 00335 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00336 "field::rows(): indicies out of bounds or incorrectly used" 00337 ); 00338 00339 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00340 }
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 348 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00349 { 00350 arma_extra_debug_sigprint(); 00351 00352 arma_debug_check 00353 ( 00354 ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), 00355 "field::rows(): indicies out of bounds or incorrectly used" 00356 ); 00357 00358 return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); 00359 }
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 367 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00368 { 00369 arma_extra_debug_sigprint(); 00370 00371 arma_debug_check 00372 ( 00373 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00374 "field::cols(): indicies out of bounds or incorrectly used" 00375 ); 00376 00377 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00378 }
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 386 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00387 { 00388 arma_extra_debug_sigprint(); 00389 00390 arma_debug_check 00391 ( 00392 ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), 00393 "field::cols(): indicies out of bounds or incorrectly used" 00394 ); 00395 00396 return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); 00397 }
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 405 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00406 { 00407 arma_extra_debug_sigprint(); 00408 00409 arma_debug_check 00410 ( 00411 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00412 "field::subfield(): indices out of bounds or incorrectly used" 00413 ); 00414 00415 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00416 }
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 424 of file field_meat.hpp.
References field< oT >::n_cols, and field< oT >::n_rows.
00425 { 00426 arma_extra_debug_sigprint(); 00427 00428 arma_debug_check 00429 ( 00430 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 00431 "field::subfield(): indices out of bounds or incorrectly used" 00432 ); 00433 00434 return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); 00435 }
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 443 of file field_meat.hpp.
00444 { 00445 arma_extra_debug_sigprint(); 00446 00447 if(extra_text.length() != 0) 00448 { 00449 cout << extra_text << '\n'; 00450 } 00451 00452 cout << *this << '\n'; 00453 }
void field< oT >::fill | ( | const oT & | x | ) | [inline, inherited] |
fill the field with an object
Definition at line 461 of file field_meat.hpp.
References field< oT >::n_elem.
00462 { 00463 arma_extra_debug_sigprint(); 00464 00465 field<oT>& t = *this; 00466 00467 for(u32 i=0; i<n_elem; ++i) 00468 { 00469 t[i] = x; 00470 } 00471 }
void field< oT >::reset | ( | ) | [inline, inherited] |
Definition at line 478 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().
00479 { 00480 arma_extra_debug_sigprint(); 00481 00482 init(0,0); 00483 }
void field< oT >::reset_objects | ( | ) | [inline, inherited] |
Definition at line 490 of file field_meat.hpp.
00491 { 00492 arma_extra_debug_sigprint(); 00493 00494 field_aux::reset_objects(*this); 00495 }
void field< oT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
Definition at line 502 of file field_meat.hpp.
00503 { 00504 arma_extra_debug_sigprint(); 00505 00506 field_aux::save(*this, name, type); 00507 }
void field< oT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
Definition at line 514 of file field_meat.hpp.
00515 { 00516 arma_extra_debug_sigprint(); 00517 00518 field_aux::load(*this, name, type); 00519 }
void field< oT >::init | ( | const field< oT > & | x | ) | [inline, private, inherited] |
construct a field from a given field
Definition at line 527 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().
00528 { 00529 arma_extra_debug_sigprint(); 00530 00531 if(this != &x) 00532 { 00533 init(x.n_rows, x.n_cols); 00534 00535 field& t = *this; 00536 00537 for(u32 col=0; col<x.n_cols; ++col) 00538 for(u32 row=0; row<x.n_rows; ++row) 00539 { 00540 t.at(row,col) = x.at(row,col); 00541 } 00542 } 00543 00544 }
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 552 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().
00553 { 00554 arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in ); 00555 00556 const u32 n_elem_new = n_rows_in * n_cols_in; 00557 00558 if(n_elem == n_elem_new) 00559 { 00560 // delete_objects(); 00561 // create_objects(); 00562 access::rw(n_rows) = n_rows_in; 00563 access::rw(n_cols) = n_cols_in; 00564 } 00565 else 00566 { 00567 delete_objects(); 00568 00569 if(n_elem > sizeof(mem_local)/sizeof(oT*) ) 00570 { 00571 delete [] mem; 00572 } 00573 00574 if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) ) 00575 { 00576 mem = mem_local; 00577 } 00578 else 00579 { 00580 mem = new(std::nothrow) oT* [n_elem_new]; 00581 arma_check( (mem == 0), "field::init(): out of memory" ); 00582 } 00583 00584 access::rw(n_elem) = n_elem_new; 00585 00586 if(n_elem_new == 0) 00587 { 00588 access::rw(n_rows) = 0; 00589 access::rw(n_cols) = 0; 00590 } 00591 else 00592 { 00593 access::rw(n_rows) = n_rows_in; 00594 access::rw(n_cols) = n_cols_in; 00595 } 00596 00597 create_objects(); 00598 00599 } 00600 00601 }
void field< oT >::delete_objects | ( | ) | [inline, private, inherited] |
Definition at line 608 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().
00609 { 00610 arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); 00611 00612 for(u32 i=0; i<n_elem; ++i) 00613 { 00614 if(mem[i] != 0) 00615 { 00616 delete mem[i]; 00617 mem[i] = 0; 00618 } 00619 } 00620 00621 }
void field< oT >::create_objects | ( | ) | [inline, private, inherited] |
Definition at line 628 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
Referenced by field< oT >::init(), and field_aux::reset_objects().
00629 { 00630 arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); 00631 00632 for(u32 i=0; i<n_elem; ++i) 00633 { 00634 mem[i] = new oT; 00635 } 00636 00637 }
void field_aux::reset_objects | ( | field< oT > & | x | ) | [inline, static, inherited] |
Definition at line 650 of file field_meat.hpp.
References field< oT >::create_objects(), and field< oT >::delete_objects().
00651 { 00652 arma_extra_debug_sigprint(); 00653 00654 x.delete_objects(); 00655 x.create_objects(); 00656 }
void field_aux::reset_objects | ( | field< Mat< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 663 of file field_meat.hpp.
00664 { 00665 arma_extra_debug_sigprint(); 00666 00667 for(u32 i=0; i<x.n_elem; ++i) 00668 { 00669 (*(x.mem[i])).reset(); 00670 } 00671 }
void field_aux::reset_objects | ( | field< Col< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 678 of file field_meat.hpp.
00679 { 00680 arma_extra_debug_sigprint(); 00681 00682 for(u32 i=0; i<x.n_elem; ++i) 00683 { 00684 (*(x.mem[i])).reset(); 00685 } 00686 }
void field_aux::reset_objects | ( | field< Row< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 693 of file field_meat.hpp.
00694 { 00695 arma_extra_debug_sigprint(); 00696 00697 for(u32 i=0; i<x.n_elem; ++i) 00698 { 00699 (*(x.mem[i])).reset(); 00700 } 00701 }
void field_aux::reset_objects | ( | field< std::string > & | x | ) | [inline, static, inherited] |
Definition at line 707 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
00708 { 00709 arma_extra_debug_sigprint(); 00710 00711 for(u32 i=0; i<x.n_elem; ++i) 00712 { 00713 (*(x.mem[i])).clear(); 00714 } 00715 }
void field_aux::save | ( | const field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 728 of file field_meat.hpp.
References arma_print().
00729 { 00730 arma_extra_debug_sigprint(); 00731 00732 arma_print("field_aux::save(): sorry, saving this type of field is currently not supported"); 00733 }
void field_aux::load | ( | field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 740 of file field_meat.hpp.
References arma_print(), and field< oT >::reset().
00741 { 00742 arma_extra_debug_sigprint(); 00743 00744 arma_print("field_aux::load(): sorry, loading this type of field is currently not supported"); 00745 x.reset(); 00746 }
void field_aux::save | ( | const field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 753 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00754 { 00755 arma_extra_debug_sigprint(); 00756 00757 switch(type) 00758 { 00759 case arma_binary: 00760 diskio::save_field_arma_binary(x, name); 00761 break; 00762 00763 case ppm_binary: 00764 diskio::save_field_ppm_binary(x, name); 00765 break; 00766 00767 default: 00768 arma_stop("field_aux::save(): unsupported type"); 00769 } 00770 }
void field_aux::load | ( | field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 777 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.
00778 { 00779 arma_extra_debug_sigprint(); 00780 00781 switch(type) 00782 { 00783 case auto_detect: 00784 diskio::load_field_auto_detect(x, name); 00785 break; 00786 00787 case arma_binary: 00788 diskio::load_field_arma_binary(x, name); 00789 break; 00790 00791 case ppm_binary: 00792 diskio::load_field_ppm_binary(x, name); 00793 break; 00794 00795 default: 00796 arma_stop("field_aux::load(): unsupported type"); 00797 } 00798 }
void field_aux::save | ( | const field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 805 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00806 { 00807 arma_extra_debug_sigprint(); 00808 00809 switch(type) 00810 { 00811 case arma_binary: 00812 diskio::save_field_arma_binary(x, name); 00813 break; 00814 00815 case ppm_binary: 00816 diskio::save_field_ppm_binary(x, name); 00817 break; 00818 00819 default: 00820 arma_stop("field_aux::save(): unsupported type"); 00821 } 00822 }
void field_aux::load | ( | field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 829 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.
00830 { 00831 arma_extra_debug_sigprint(); 00832 00833 switch(type) 00834 { 00835 case auto_detect: 00836 diskio::load_field_auto_detect(x, name); 00837 break; 00838 00839 case arma_binary: 00840 diskio::load_field_arma_binary(x, name); 00841 break; 00842 00843 case ppm_binary: 00844 diskio::load_field_ppm_binary(x, name); 00845 break; 00846 00847 default: 00848 arma_stop("field_aux::load(): unsupported type"); 00849 } 00850 }
void field_aux::save | ( | const field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 857 of file field_meat.hpp.
References arma_binary, arma_stop(), ppm_binary, diskio::save_field_arma_binary(), and diskio::save_field_ppm_binary().
00858 { 00859 arma_extra_debug_sigprint(); 00860 00861 switch(type) 00862 { 00863 case arma_binary: 00864 diskio::save_field_arma_binary(x, name); 00865 break; 00866 00867 case ppm_binary: 00868 diskio::save_field_ppm_binary(x, name); 00869 break; 00870 00871 default: 00872 arma_stop("field_aux::save(): unsupported type"); 00873 } 00874 }
void field_aux::load | ( | field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 881 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.
00882 { 00883 arma_extra_debug_sigprint(); 00884 00885 switch(type) 00886 { 00887 case auto_detect: 00888 diskio::load_field_auto_detect(x, name); 00889 break; 00890 00891 case arma_binary: 00892 diskio::load_field_arma_binary(x, name); 00893 break; 00894 00895 case ppm_binary: 00896 diskio::load_field_ppm_binary(x, name); 00897 break; 00898 00899 default: 00900 arma_stop("field_aux::load(): unsupported type"); 00901 } 00902 }
void field_aux::save | ( | const field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 908 of file field_meat.hpp.
References diskio::save_field_std_string().
00909 { 00910 arma_extra_debug_sigprint(); 00911 00912 diskio::save_field_std_string(x, name); 00913 }
void field_aux::load | ( | field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type | |||
) | [inline, static, inherited] |
Definition at line 919 of file field_meat.hpp.
References diskio::load_field_std_string().
00920 { 00921 arma_extra_debug_sigprint(); 00922 00923 diskio::load_field_std_string(x, name); 00924 }