//! More...
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) | |
template<typename oT2 > | |
void | field::copy_size (const field< oT2 > &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 () |
bool | field::save (const std::string name, const file_type type=arma_binary, const bool print_status=true) const |
bool | field::save (std::ostream &os, const file_type type=arma_binary, const bool print_status=true) const |
bool | field::load (const std::string name, const file_type type=auto_detect, const bool print_status=true) |
bool | field::load (std::istream &is, const file_type type=auto_detect, const bool print_status=true) |
bool | field::quiet_save (const std::string name, const file_type type=arma_binary) const |
bool | field::quiet_save (std::ostream &os, const file_type type=arma_binary) const |
bool | field::quiet_load (const std::string name, const file_type type=auto_detect) |
bool | field::quiet_load (std::istream &is, 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 () |
field::iterator::iterator (field< oT > &in_M, const bool at_end=false) | |
oT & | field::iterator::operator* () |
iterator & | field::iterator::operator++ () |
void | field::iterator::operator++ (int) |
iterator & | field::iterator::operator-- () |
void | field::iterator::operator-- (int) |
field::const_iterator::const_iterator (const field< oT > &in_M, const bool at_end=false) | |
const oT & | field::const_iterator::operator* () const |
const_iterator & | field::const_iterator::operator++ () |
void | field::const_iterator::operator++ (int) |
const_iterator & | field::const_iterator::operator-- () |
void | field::const_iterator::operator-- (int) |
iterator | field::begin () |
const_iterator | field::begin () const |
iterator | field::end () |
const_iterator | field::end () const |
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 bool | field_aux::save (const field< oT > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename oT > | |
static bool | field_aux::save (const field< oT > &x, std::ostream &os, const file_type type, std::string &err_msg) |
template<typename oT > | |
static bool | field_aux::load (field< oT > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename oT > | |
static bool | field_aux::load (field< oT > &x, std::istream &is, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Mat< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Mat< eT > > &x, std::ostream &os, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Mat< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Mat< eT > > &x, std::istream &is, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Col< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Col< eT > > &x, std::ostream &os, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Col< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Col< eT > > &x, std::istream &is, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Row< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Row< eT > > &x, std::ostream &os, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Row< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Row< eT > > &x, std::istream &is, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Cube< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::save (const field< Cube< eT > > &x, std::ostream &os, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Cube< eT > > &x, const std::string &name, const file_type type, std::string &err_msg) |
template<typename eT > | |
static bool | field_aux::load (field< Cube< eT > > &x, std::istream &is, const file_type type, std::string &err_msg) |
static bool | field_aux::save (const field< std::string > &x, const std::string &name, const file_type type, std::string &err_msg) |
static bool | field_aux::save (const field< std::string > &x, std::ostream &os, const file_type type, std::string &err_msg) |
static bool | field_aux::load (field< std::string > &x, const std::string &name, const file_type type, std::string &err_msg) |
static bool | field_aux::load (field< std::string > &x, std::istream &is, const file_type type, std::string &err_msg) |
//!
Definition at line 24 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().
{ arma_extra_debug_sigprint_this(this); delete_objects(); if(n_elem > sizeof(mem_local)/sizeof(oT*) ) { delete [] mem; } if(arma_config::debug == true) { // try to expose buggy user code that accesses deleted objects access::rw(n_rows) = 0; access::rw(n_cols) = 0; access::rw(n_elem) = 0; mem = 0; } }
construct a field from a given field
Definition at line 63 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 80 of file field_meat.hpp.
References field< oT >::init().
Referenced by field< oT >::field().
{ arma_extra_debug_sigprint(); init(x); return *this; }
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 93 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 110 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); subview_field<oT>::extract(*this, X); return *this; }
construct the field with the specified number of elements, assuming a column-major layout
Definition at line 124 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 140 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 158 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().
{ arma_extra_debug_sigprint(arma_boost::format("n_elem_in = %d") % n_elem_in); init(n_elem_in, 1); }
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 171 of file field_meat.hpp.
References field< oT >::init().
{ arma_extra_debug_sigprint(arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in); init(n_rows_in, n_cols_in); }
void field< oT >::copy_size | ( | const field< oT2 > & | x | ) | [inline, inherited] |
change the field to have the specified dimensions (data is not preserved)
Definition at line 185 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.
{ return (*mem[i]); }
arma_inline const oT & field< oT >::operator[] | ( | const u32 | i | ) | const [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.
{ return (*mem[i]); }
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 [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 | |||
) | [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 [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 | |||
) | [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 [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_equ_proxy(), subview< eT >::plus_inplace(), subview< eT >::schur_inplace(), and subview< eT >::zeros().
{ arma_extra_debug_sigprint(); arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" ); return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1); }
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 >::operator_equ_mat(), subview< eT >::operator_equ_proxy(), subview< eT >::plus_inplace(), subview< eT >::schur_inplace(), and subview< eT >::zeros().
{ arma_extra_debug_sigprint(); arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds"); return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), "field::rows(): indicies out of bounds or incorrectly used" ); return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), "field::rows(): indicies out of bounds or incorrectly used" ); return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), "field::cols(): indicies out of bounds or incorrectly used" ); return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), "field::cols(): indicies out of bounds or incorrectly used" ); return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "field::subfield(): indices out of bounds or incorrectly used" ); return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); }
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.
{ arma_extra_debug_sigprint(); arma_debug_check ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "field::subfield(): indices out of bounds or incorrectly used" ); return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2); }
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().
{ arma_extra_debug_sigprint(); if(extra_text.length() != 0) { const std::streamsize orig_width = cout.width(); cout << extra_text << '\n'; cout.width(orig_width); } arma_ostream::print(cout, *this); }
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().
{ arma_extra_debug_sigprint(); if(extra_text.length() != 0) { const std::streamsize orig_width = user_stream.width(); user_stream << extra_text << '\n'; user_stream.width(orig_width); } arma_ostream::print(user_stream, *this); }
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().
{ arma_extra_debug_sigprint(); init(0,0); }
void field< oT >::reset_objects | ( | ) | [inline, inherited] |
Definition at line 548 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); field_aux::reset_objects(*this); }
bool field< oT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary , |
|||
const bool | print_status = true | |||
) | const [inline, inherited] |
Definition at line 560 of file field_meat.hpp.
References arma_print().
Referenced by field< oT >::save().
{ arma_extra_debug_sigprint(); std::string err_msg; const bool save_okay = field_aux::save(*this, name, type, err_msg); if( (print_status == true) && (save_okay == false) ) { if(err_msg.length() > 0) { arma_print("field::save(): ", err_msg, name); } else { arma_print("field::save(): couldn't write to ", name); } } return save_okay; }
bool field< oT >::save | ( | std::ostream & | os, | |
const file_type | type = arma_binary , |
|||
const bool | print_status = true | |||
) | const [inline, inherited] |
Definition at line 587 of file field_meat.hpp.
References arma_print(), and field< oT >::save().
{ arma_extra_debug_sigprint(); std::string err_msg; const bool save_okay = field_aux::save(*this, os, type, err_msg); if( (print_status == true) && (save_okay == false) ) { if(err_msg.length() > 0) { arma_print("field::save(): ", err_msg, "[ostream]"); } else { arma_print("field::save(): couldn't write to [ostream]"); } } return save_okay; }
bool field< oT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect , |
|||
const bool | print_status = true | |||
) | [inline, inherited] |
Definition at line 614 of file field_meat.hpp.
References arma_print().
Referenced by field< oT >::load().
{ arma_extra_debug_sigprint(); std::string err_msg; const bool load_okay = field_aux::load(*this, name, type, err_msg); if( (print_status == true) && (load_okay == false) ) { if(err_msg.length() > 0) { arma_print("field::load(): ", err_msg, name); } else { arma_print("field::load(): couldn't read from ", name); } } if(load_okay == false) { (*this).reset(); } return load_okay; }
bool field< oT >::load | ( | std::istream & | is, | |
const file_type | type = auto_detect , |
|||
const bool | print_status = true | |||
) | [inline, inherited] |
Definition at line 646 of file field_meat.hpp.
References arma_print(), and field< oT >::load().
{ arma_extra_debug_sigprint(); std::string err_msg; const bool load_okay = field_aux::load(*this, is, type, err_msg); if( (print_status == true) && (load_okay == false) ) { if(err_msg.length() > 0) { arma_print("field::load(): ", err_msg, "[istream]"); } else { arma_print("field::load(): couldn't read from [istream]"); } } if(load_okay == false) { (*this).reset(); } return load_okay; }
bool field< oT >::quiet_save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
Definition at line 678 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return (*this).save(name, type, false); }
bool field< oT >::quiet_save | ( | std::ostream & | os, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
Definition at line 690 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return (*this).save(os, type, false); }
bool field< oT >::quiet_load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
Definition at line 702 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return (*this).load(name, type, false); }
bool field< oT >::quiet_load | ( | std::istream & | is, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
Definition at line 714 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return (*this).load(is, type, false); }
void field< oT >::init | ( | const field< oT > & | x | ) | [inline, private, inherited] |
construct a field from a given field
Definition at line 727 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().
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 752 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().
{ arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in ); const u32 n_elem_new = n_rows_in * n_cols_in; if(n_elem == n_elem_new) { // delete_objects(); // create_objects(); access::rw(n_rows) = n_rows_in; access::rw(n_cols) = n_cols_in; } else { delete_objects(); if(n_elem > sizeof(mem_local)/sizeof(oT*) ) { delete [] mem; } if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) ) { mem = mem_local; } else { mem = new(std::nothrow) oT* [n_elem_new]; arma_check( (mem == 0), "field::init(): out of memory" ); } access::rw(n_elem) = n_elem_new; if(n_elem_new == 0) { access::rw(n_rows) = 0; access::rw(n_cols) = 0; } else { access::rw(n_rows) = n_rows_in; access::rw(n_cols) = n_cols_in; } create_objects(); } }
void field< oT >::delete_objects | ( | ) | [inline, private, inherited] |
Definition at line 808 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 828 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
Referenced by field< oT >::init(), and field_aux::reset_objects().
{ arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem ); for(u32 i=0; i<n_elem; ++i) { mem[i] = new oT; } }
field< oT >::iterator::iterator | ( | field< oT > & | in_M, | |
const bool | at_end = false | |||
) | [inline, inherited] |
Definition at line 843 of file field_meat.hpp.
oT & field< oT >::iterator::operator* | ( | ) | [inline, inherited] |
Definition at line 855 of file field_meat.hpp.
References field< oT >::iterator::i, and field< oT >::iterator::M.
field< oT >::iterator & field< oT >::iterator::operator++ | ( | ) | [inline, inherited] |
Definition at line 865 of file field_meat.hpp.
References field< oT >::iterator::i.
Referenced by field< oT >::iterator::operator++().
{ ++i; return *this; }
void field< oT >::iterator::operator++ | ( | int | ) | [inline, inherited] |
Definition at line 877 of file field_meat.hpp.
References field< oT >::iterator::operator++().
{ operator++(); }
field< oT >::iterator & field< oT >::iterator::operator-- | ( | ) | [inline, inherited] |
Definition at line 887 of file field_meat.hpp.
References field< oT >::iterator::i.
Referenced by field< oT >::iterator::operator--().
void field< oT >::iterator::operator-- | ( | int | ) | [inline, inherited] |
Definition at line 902 of file field_meat.hpp.
References field< oT >::iterator::operator--().
{ operator--(); }
field< oT >::const_iterator::const_iterator | ( | const field< oT > & | in_M, | |
const bool | at_end = false | |||
) | [inline, inherited] |
Definition at line 931 of file field_meat.hpp.
const oT & field< oT >::const_iterator::operator* | ( | ) | const [inline, inherited] |
Definition at line 954 of file field_meat.hpp.
References field< oT >::const_iterator::i, and field< oT >::const_iterator::M.
field< oT >::const_iterator & field< oT >::const_iterator::operator++ | ( | ) | [inline, inherited] |
Definition at line 964 of file field_meat.hpp.
References field< oT >::const_iterator::i.
Referenced by field< oT >::const_iterator::operator++().
{ ++i; return *this; }
void field< oT >::const_iterator::operator++ | ( | int | ) | [inline, inherited] |
Definition at line 976 of file field_meat.hpp.
References field< oT >::const_iterator::operator++().
{ operator++(); }
field< oT >::const_iterator & field< oT >::const_iterator::operator-- | ( | ) | [inline, inherited] |
Definition at line 986 of file field_meat.hpp.
References field< oT >::const_iterator::i.
Referenced by field< oT >::const_iterator::operator--().
void field< oT >::const_iterator::operator-- | ( | int | ) | [inline, inherited] |
Definition at line 1001 of file field_meat.hpp.
References field< oT >::const_iterator::operator--().
{ operator--(); }
Definition at line 1031 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return field<oT>::iterator(*this); }
Definition at line 1043 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return field<oT>::const_iterator(*this); }
Definition at line 1055 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return field<oT>::iterator(*this, true); }
Definition at line 1067 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); return field<oT>::const_iterator(*this, true); }
void field_aux::reset_objects | ( | field< oT > & | x | ) | [inline, static, inherited] |
Definition at line 1085 of file field_meat.hpp.
References field< oT >::create_objects(), and field< oT >::delete_objects().
{ arma_extra_debug_sigprint(); x.delete_objects(); x.create_objects(); }
void field_aux::reset_objects | ( | field< Mat< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 1098 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Col< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 1113 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Row< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 1128 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< Cube< eT > > & | x | ) | [inline, static, inherited] |
Definition at line 1143 of file field_meat.hpp.
void field_aux::reset_objects | ( | field< std::string > & | x | ) | [inline, static, inherited] |
Definition at line 1157 of file field_meat.hpp.
References field< oT >::mem, and field< oT >::n_elem.
bool field_aux::save | ( | const field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1178 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = "; return false; }
bool field_aux::save | ( | const field< oT > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1192 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = "; return false; }
bool field_aux::load | ( | field< oT > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1206 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = "; return false; }
bool field_aux::load | ( | field< oT > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1220 of file field_meat.hpp.
{ arma_extra_debug_sigprint(); err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = "; return false; }
bool field_aux::save | ( | const field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1234 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, name); break; case ppm_binary: return diskio::save_ppm_binary(x, name); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Mat< eT > > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1259 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, os); break; case ppm_binary: return diskio::save_ppm_binary(x, os); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Mat< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1284 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, name, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Mat< eT > > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1313 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, is, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, is, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, is, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1342 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, name); break; case ppm_binary: return diskio::save_ppm_binary(x, name); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Col< eT > > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1367 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, os); break; case ppm_binary: return diskio::save_ppm_binary(x, os); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Col< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1392 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, name, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Col< eT > > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1421 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, is, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, is, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, is, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1450 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::save_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Row< eT > > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1475 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, os, err_msg); break; case ppm_binary: return diskio::save_ppm_binary(x, os, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Row< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1500 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, name, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Row< eT > > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1529 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, is, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, is, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, is, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Cube< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1558 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::save_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< Cube< eT > > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1583 of file field_meat.hpp.
References arma_binary, ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().
{ arma_extra_debug_sigprint(); switch(type) { case arma_binary: return diskio::save_arma_binary(x, os, err_msg); break; case ppm_binary: return diskio::save_ppm_binary(x, os, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Cube< eT > > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1608 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, name, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, name, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, name, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::load | ( | field< Cube< eT > > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1637 of file field_meat.hpp.
References arma_binary, auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.
{ arma_extra_debug_sigprint(); switch(type) { case auto_detect: return diskio::load_auto_detect(x, is, err_msg); break; case arma_binary: return diskio::load_arma_binary(x, is, err_msg); break; case ppm_binary: return diskio::load_ppm_binary(x, is, err_msg); break; default: err_msg = " [unsupported type] filename = "; return false; } }
bool field_aux::save | ( | const field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1665 of file field_meat.hpp.
References diskio::save_std_string().
{ arma_extra_debug_sigprint(); err_msg.clear(); return diskio::save_std_string(x, name); }
bool field_aux::save | ( | const field< std::string > & | x, | |
std::ostream & | os, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1678 of file field_meat.hpp.
References diskio::save_std_string().
{ arma_extra_debug_sigprint(); err_msg.clear(); return diskio::save_std_string(x, os); }
bool field_aux::load | ( | field< std::string > & | x, | |
const std::string & | name, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1691 of file field_meat.hpp.
References diskio::load_std_string().
{ arma_extra_debug_sigprint(); return diskio::load_std_string(x, name, err_msg); }
bool field_aux::load | ( | field< std::string > & | x, | |
std::istream & | is, | |||
const file_type | type, | |||
std::string & | err_msg | |||
) | [inline, static, inherited] |
Definition at line 1702 of file field_meat.hpp.
References diskio::load_std_string().
{ arma_extra_debug_sigprint(); return diskio::load_std_string(x, is, err_msg); }