Field

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 fieldfield::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 fieldfield::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)

Function Documentation

template<typename oT >
field< oT >::~field (  )  [inline, inherited]

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().

00025   {
00026   arma_extra_debug_sigprint_this(this);
00027   
00028   delete_objects();
00029   
00030   if(n_elem > sizeof(mem_local)/sizeof(oT*) )
00031     {
00032     delete [] mem;
00033     }
00034   
00035   if(arma_config::debug == true)
00036     {
00037     // try to expose buggy user code that accesses deleted objects
00038     access::rw(n_rows) = 0;
00039     access::rw(n_cols) = 0;
00040     access::rw(n_elem) = 0;
00041     mem = 0;
00042     }
00043   }

template<typename oT >
field< oT >::field (  )  [inline, inherited]

Definition at line 49 of file field_meat.hpp.

00050   : n_rows(0)
00051   , n_cols(0)
00052   , n_elem(0)
00053   , mem(0)
00054   {
00055   arma_extra_debug_sigprint_this(this);
00056   }

template<typename oT >
field< oT >::field ( const field< oT > &  x  )  [inline, inherited]

construct a field from a given field

Definition at line 63 of file field_meat.hpp.

References field< oT >::init().

00064   : n_rows(0)
00065   , n_cols(0)
00066   , n_elem(0)
00067   , mem(0)
00068   {
00069   arma_extra_debug_sigprint(arma_boost::format("this = %x   x = %x") % this % &x);
00070   
00071   init(x);
00072   }

template<typename oT >
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().

00081   {
00082   arma_extra_debug_sigprint();
00083   
00084   init(x);
00085   return *this;
00086   }

template<typename oT >
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=().

00094   : n_rows(0)
00095   , n_cols(0)
00096   , n_elem(0)
00097   , mem(0)
00098   {
00099   arma_extra_debug_sigprint_this(this);
00100   
00101   this->operator=(X);
00102   }

template<typename oT >
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.

00111   {
00112   arma_extra_debug_sigprint();
00113   
00114   subview_field<oT>::extract(*this, X);
00115   return *this;
00116   }

template<typename oT >
field< oT >::field ( const u32  n_elem_in  )  [inline, explicit, inherited]

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().

00125   : n_rows(0)
00126   , n_cols(0)
00127   , n_elem(0)
00128   , mem(0)
00129   {
00130   arma_extra_debug_sigprint_this(this);
00131   
00132   init(n_elem_in, 1);
00133   }

template<typename oT >
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().

00141   : n_rows(0)
00142   , n_cols(0)
00143   , n_elem(0)
00144   , mem(0)
00145   {
00146   arma_extra_debug_sigprint_this(this);
00147   
00148   init(n_rows_in, n_cols_in);
00149   }

template<typename oT >
void field< oT >::set_size ( const u32  n_obj_in  )  [inline, inherited]

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().

00159   {
00160   arma_extra_debug_sigprint(arma_boost::format("n_elem_in = %d") % n_elem_in);
00161   
00162   init(n_elem_in, 1);
00163   }

template<typename oT >
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().

00172   {
00173   arma_extra_debug_sigprint(arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in);
00174   
00175   init(n_rows_in, n_cols_in);
00176   }

template<typename oT >
template<typename oT2 >
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.

00186   {
00187   arma_extra_debug_sigprint();
00188   
00189   init(x.n_rows, x.n_cols);
00190   }

template<typename oT >
arma_inline oT & field< oT >::operator[] ( const u32  i  )  [inline, inherited]

linear element accessor (treats the field as a vector); no bounds check

Definition at line 198 of file field_meat.hpp.

References field< oT >::mem.

00199   {
00200   return (*mem[i]);
00201   }

template<typename oT >
arma_inline const oT & field< oT >::operator[] ( const u32  i  )  const [inline, inherited]

linear element accessor (treats the field as a vector); no bounds check

Definition at line 209 of file field_meat.hpp.

References field< oT >::mem.

00210   {
00211   return (*mem[i]);
00212   }

template<typename oT >
arma_inline oT & field< oT >::operator() ( const u32  i  )  [inline, inherited]

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.

00220   {
00221   arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds");
00222   return (*mem[i]);
00223   }

template<typename oT >
arma_inline const oT & field< oT >::operator() ( const u32  i  )  const [inline, inherited]

linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 231 of file field_meat.hpp.

References field< oT >::mem, and field< oT >::n_elem.

00232   {
00233   arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds");
00234   return (*mem[i]);
00235   }

template<typename oT >
arma_inline oT & field< oT >::operator() ( const u32  row,
const u32  col 
) [inline, inherited]

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 243 of file field_meat.hpp.

References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.

00244   {
00245   arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds");
00246   return (*mem[in_row + in_col*n_rows]);
00247   }

template<typename oT >
arma_inline const oT & field< oT >::operator() ( const u32  row,
const u32  col 
) const [inline, inherited]

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 255 of file field_meat.hpp.

References field< oT >::mem, field< oT >::n_cols, and field< oT >::n_rows.

00256   {
00257   arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "field::operator(): index out of bounds");
00258   return (*mem[in_row + in_col*n_rows]);
00259   }

template<typename oT >
arma_inline oT & field< oT >::at ( const u32  row,
const u32  col 
) [inline, inherited]

element accessor; no bounds check

Definition at line 267 of file field_meat.hpp.

References field< oT >::mem, and field< oT >::n_rows.

Referenced by subview_field< oT >::extract(), field< oT >::init(), diskio::load_std_string(), subview_field< oT >::operator=(), arma_ostream::print(), and diskio::save_std_string().

00268   {
00269   return (*mem[in_row + in_col*n_rows]);
00270   }

template<typename oT >
arma_inline const oT & field< oT >::at ( const u32  row,
const u32  col 
) const [inline, inherited]

element accessor; no bounds check

Definition at line 278 of file field_meat.hpp.

References field< oT >::mem, and field< oT >::n_rows.

00279   {
00280   return (*mem[in_row + in_col*n_rows]);
00281   }

template<typename oT >
subview_field< oT > field< oT >::row ( const u32  row_num  )  [inline, inherited]
template<typename oT >
const subview_field< oT > field< oT >::row ( const u32  row_num  )  const [inline, inherited]

creation of subview_field (row of a field)

Definition at line 303 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00304   {
00305   arma_extra_debug_sigprint();
00306   
00307   arma_debug_check( (row_num >= n_rows), "field::row(): row out of bounds" );
00308   return subview_field<oT>(*this, row_num, 0, row_num, n_cols-1);
00309   }

template<typename oT >
subview_field< oT > field< oT >::col ( const u32  col_num  )  [inline, inherited]
template<typename oT >
const subview_field< oT > field< oT >::col ( const u32  col_num  )  const [inline, inherited]

creation of subview_field (column of a field)

Definition at line 331 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00332   {
00333   arma_extra_debug_sigprint();
00334   
00335   arma_debug_check( (col_num >= n_cols), "field::col(): out of bounds");
00336   return subview_field<oT>(*this, 0, col_num, n_rows-1, col_num);
00337   }

template<typename oT >
subview_field< oT > field< oT >::rows ( const u32  in_row1,
const u32  in_row2 
) [inline, inherited]

creation of subview_field (subfield comprised of specified rows)

Definition at line 345 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00346   {
00347   arma_extra_debug_sigprint();
00348   
00349   arma_debug_check
00350     (
00351     ( (in_row1 > in_row2) || (in_row2 >= n_rows) ),
00352     "field::rows(): indicies out of bounds or incorrectly used"
00353     );
00354   
00355   return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1);
00356   }

template<typename oT >
const subview_field< oT > field< oT >::rows ( const u32  in_row1,
const u32  in_row2 
) const [inline, inherited]

creation of subview_field (subfield comprised of specified rows)

Definition at line 364 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00365   {
00366   arma_extra_debug_sigprint();
00367   
00368   arma_debug_check
00369     (
00370     ( (in_row1 > in_row2) || (in_row2 >= n_rows) ),
00371     "field::rows(): indicies out of bounds or incorrectly used"
00372     );
00373   
00374   return subview_field<oT>(*this, in_row1, 0, in_row2, n_cols-1);
00375   }

template<typename oT >
subview_field< oT > field< oT >::cols ( const u32  in_col1,
const u32  in_col2 
) [inline, inherited]

creation of subview_field (subfield comprised of specified columns)

Definition at line 383 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00384   {
00385   arma_extra_debug_sigprint();
00386   
00387   arma_debug_check
00388     (
00389     ( (in_col1 > in_col2) || (in_col2 >= n_cols) ),
00390     "field::cols(): indicies out of bounds or incorrectly used"
00391     );
00392   
00393   return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2);
00394   }

template<typename oT >
const subview_field< oT > field< oT >::cols ( const u32  in_col1,
const u32  in_col2 
) const [inline, inherited]

creation of subview_field (subfield comprised of specified columns)

Definition at line 402 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00403   {
00404   arma_extra_debug_sigprint();
00405   
00406   arma_debug_check
00407     (
00408     ( (in_col1 > in_col2) || (in_col2 >= n_cols) ),
00409     "field::cols(): indicies out of bounds or incorrectly used"
00410     );
00411   
00412   return subview_field<oT>(*this, 0, in_col1, n_rows-1, in_col2);
00413   }

template<typename oT >
subview_field< oT > field< oT >::subfield ( const u32  in_row1,
const u32  in_col1,
const u32  in_row2,
const u32  in_col2 
) [inline, inherited]

creation of subview_field (subfield with arbitrary dimensions)

Definition at line 421 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00422   {
00423   arma_extra_debug_sigprint();
00424   
00425   arma_debug_check
00426     (
00427     (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
00428     "field::subfield(): indices out of bounds or incorrectly used"
00429     );
00430   
00431   return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2);
00432   }

template<typename oT >
const subview_field< oT > field< oT >::subfield ( const u32  in_row1,
const u32  in_col1,
const u32  in_row2,
const u32  in_col2 
) const [inline, inherited]

creation of subview_field (generic submatrix)

Definition at line 440 of file field_meat.hpp.

References field< oT >::n_cols, and field< oT >::n_rows.

00441   {
00442   arma_extra_debug_sigprint();
00443   
00444   arma_debug_check
00445     (
00446     (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
00447     "field::subfield(): indices out of bounds or incorrectly used"
00448     );
00449   
00450   return subview_field<oT>(*this, in_row1, in_col1, in_row2, in_col2);
00451   }

template<typename oT >
void field< oT >::print ( const std::string  extra_text = ""  )  const [inline, inherited]

print contents of the field (to the cout stream), optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined.

Definition at line 467 of file field_meat.hpp.

Referenced by field< oT >::print().

00468   {
00469   arma_extra_debug_sigprint();
00470   
00471   if(extra_text.length() != 0)
00472     {
00473     const std::streamsize orig_width = cout.width();
00474     
00475     cout << extra_text << '\n';
00476   
00477     cout.width(orig_width);
00478     }
00479   
00480   arma_ostream::print(cout, *this);
00481   }

template<typename oT >
void field< oT >::print ( std::ostream &  user_stream,
const std::string  extra_text = "" 
) const [inline, inherited]

print contents of the field to a user specified stream, optionally preceding with a user specified line of text. the field class preserves the stream's flags but the associated operator<< function for type oT may still modify the stream's parameters. NOTE: this function assumes that type oT can be printed, i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" has been defined.

Definition at line 497 of file field_meat.hpp.

References field< oT >::print().

00498   {
00499   arma_extra_debug_sigprint();
00500   
00501   if(extra_text.length() != 0)
00502     {
00503     const std::streamsize orig_width = user_stream.width();
00504     
00505     user_stream << extra_text << '\n';
00506   
00507     user_stream.width(orig_width);
00508     }
00509   
00510   arma_ostream::print(user_stream, *this);
00511   }

template<typename oT >
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.

00520   {
00521   arma_extra_debug_sigprint();
00522   
00523   field<oT>& t = *this;
00524   
00525   for(u32 i=0; i<n_elem; ++i)
00526     {
00527     t[i] = x;
00528     }
00529   }

template<typename oT >
void field< oT >::reset (  )  [inline, inherited]

Definition at line 536 of file field_meat.hpp.

References field< oT >::init().

00537   {
00538   arma_extra_debug_sigprint();
00539   
00540   init(0,0);
00541   }

template<typename oT >
void field< oT >::reset_objects (  )  [inline, inherited]

Definition at line 548 of file field_meat.hpp.

00549   {
00550   arma_extra_debug_sigprint();
00551   
00552   field_aux::reset_objects(*this);
00553   }

template<typename oT >
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().

00561   {
00562   arma_extra_debug_sigprint();
00563   
00564   std::string err_msg;
00565   const bool save_okay = field_aux::save(*this, name, type, err_msg);
00566   
00567   if( (print_status == true) && (save_okay == false) )
00568     {
00569     if(err_msg.length() > 0)
00570       {
00571       arma_print("field::save(): ", err_msg, name);
00572       }
00573     else
00574       {
00575       arma_print("field::save(): couldn't write to ", name);
00576       }
00577     }
00578   
00579   return save_okay;
00580   }

template<typename oT >
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().

00588   {
00589   arma_extra_debug_sigprint();
00590   
00591   std::string err_msg;
00592   const bool save_okay = field_aux::save(*this, os, type, err_msg);
00593   
00594   if( (print_status == true) && (save_okay == false) )
00595     {
00596     if(err_msg.length() > 0)
00597       {
00598       arma_print("field::save(): ", err_msg, "[ostream]");
00599       }
00600     else
00601       {
00602       arma_print("field::save(): couldn't write to [ostream]");
00603       }
00604     }
00605   
00606   return save_okay;
00607   }

template<typename oT >
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().

00615   {
00616   arma_extra_debug_sigprint();
00617   
00618   std::string err_msg;
00619   const bool load_okay = field_aux::load(*this, name, type, err_msg);
00620   
00621   if( (print_status == true) && (load_okay == false) )
00622     {
00623     if(err_msg.length() > 0)
00624       {
00625       arma_print("field::load(): ", err_msg, name);
00626       }
00627     else
00628       {
00629       arma_print("field::load(): couldn't read from ", name);
00630       }
00631     }
00632   
00633   if(load_okay == false)
00634     {
00635     (*this).reset();
00636     }
00637   
00638   return load_okay;
00639   }

template<typename oT >
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().

00647   {
00648   arma_extra_debug_sigprint();
00649   
00650   std::string err_msg;
00651   const bool load_okay = field_aux::load(*this, is, type, err_msg);
00652   
00653   if( (print_status == true) && (load_okay == false) )
00654     {
00655     if(err_msg.length() > 0)
00656       {
00657       arma_print("field::load(): ", err_msg, "[istream]");
00658       }
00659     else
00660       {
00661       arma_print("field::load(): couldn't read from [istream]");
00662       }
00663     }
00664   
00665   if(load_okay == false)
00666     {
00667     (*this).reset();
00668     }
00669   
00670   return load_okay;
00671   }

template<typename oT >
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.

00679   {
00680   arma_extra_debug_sigprint();
00681   
00682   return (*this).save(name, type, false);
00683   }

template<typename oT >
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.

00691   {
00692   arma_extra_debug_sigprint();
00693   
00694   return (*this).save(os, type, false);
00695   }

template<typename oT >
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.

00703   {
00704   arma_extra_debug_sigprint();
00705   
00706   return (*this).load(name, type, false);
00707   }

template<typename oT >
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.

00715   {
00716   arma_extra_debug_sigprint();
00717   
00718   return (*this).load(is, type, false);
00719   }

template<typename oT >
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().

00728   {
00729   arma_extra_debug_sigprint();
00730   
00731   if(this != &x)
00732     {
00733     init(x.n_rows, x.n_cols);
00734     
00735     field& t = *this;
00736     
00737     for(u32 col=0; col<x.n_cols; ++col)
00738     for(u32 row=0; row<x.n_rows; ++row)
00739       {
00740       t.at(row,col) = x.at(row,col);
00741       }
00742     }
00743   
00744   }

template<typename oT >
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().

00753   {
00754   arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in );
00755   
00756   const u32 n_elem_new = n_rows_in * n_cols_in;
00757 
00758   if(n_elem == n_elem_new)
00759     {
00760     // delete_objects();
00761     // create_objects();
00762     access::rw(n_rows) = n_rows_in;
00763     access::rw(n_cols) = n_cols_in;
00764     }
00765   else
00766     {
00767     delete_objects();
00768     
00769     if(n_elem > sizeof(mem_local)/sizeof(oT*) )
00770       {
00771       delete [] mem;
00772       }
00773     
00774     if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) )
00775       {
00776       mem = mem_local;
00777       }
00778     else
00779       {
00780       mem = new(std::nothrow) oT* [n_elem_new];
00781       arma_check( (mem == 0), "field::init(): out of memory" );
00782       }
00783     
00784     access::rw(n_elem) = n_elem_new;
00785     
00786     if(n_elem_new == 0)
00787       {
00788       access::rw(n_rows) = 0;
00789       access::rw(n_cols) = 0;
00790       }
00791     else
00792       {
00793       access::rw(n_rows) = n_rows_in;
00794       access::rw(n_cols) = n_cols_in;
00795       }
00796     
00797     create_objects();
00798     
00799     }
00800   
00801   }

template<typename oT >
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().

00809   {
00810   arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem );
00811   
00812   for(u32 i=0; i<n_elem; ++i)
00813     {
00814     if(mem[i] != 0)
00815       {
00816       delete mem[i];
00817       mem[i] = 0;
00818       }
00819     }
00820   
00821   }

template<typename oT >
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().

00829   {
00830   arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem );
00831   
00832   for(u32 i=0; i<n_elem; ++i)
00833     {
00834     mem[i] = new oT;
00835     }
00836   
00837   }

template<typename 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.

00844   : M(in_M)
00845   , i( (at_end == false) ? 0 : in_M.n_elem )
00846   {
00847   arma_extra_debug_sigprint();
00848   }

template<typename oT >
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.

00856   {
00857   return M[i];
00858   }

template<typename oT >
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++().

00866   {
00867   ++i;
00868   
00869   return *this;
00870   }

template<typename oT >
void field< oT >::iterator::operator++ ( int   )  [inline, inherited]

Definition at line 877 of file field_meat.hpp.

References field< oT >::iterator::operator++().

00878   {
00879   operator++();
00880   }

template<typename oT >
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--().

00888   {
00889   if(i > 0)
00890     {
00891     --i;
00892     }
00893   
00894   return *this;
00895   }

template<typename oT >
void field< oT >::iterator::operator-- ( int   )  [inline, inherited]

Definition at line 902 of file field_meat.hpp.

References field< oT >::iterator::operator--().

00903   {
00904   operator--();
00905   }

template<typename oT >
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.

00932   : M(in_M)
00933   , i( (at_end == false) ? 0 : in_M.n_elem )
00934   {
00935   arma_extra_debug_sigprint();
00936   }

template<typename oT >
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.

00955   {
00956   return M[i];
00957   }

template<typename oT >
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++().

00965   {
00966   ++i;
00967   
00968   return *this;
00969   }

template<typename oT >
void field< oT >::const_iterator::operator++ ( int   )  [inline, inherited]

Definition at line 976 of file field_meat.hpp.

References field< oT >::const_iterator::operator++().

00977   {
00978   operator++();
00979   }

template<typename oT >
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--().

00987   {
00988   if(i > 0)
00989     {
00990     --i;
00991     }
00992   
00993   return *this;
00994   }

template<typename oT >
void field< oT >::const_iterator::operator-- ( int   )  [inline, inherited]

Definition at line 1001 of file field_meat.hpp.

References field< oT >::const_iterator::operator--().

01002   {
01003   operator--();
01004   }

template<typename oT >
field< oT >::iterator field< oT >::begin (  )  [inline, inherited]

Definition at line 1031 of file field_meat.hpp.

01032   {
01033   arma_extra_debug_sigprint();
01034   
01035   return field<oT>::iterator(*this);
01036   }

template<typename oT >
field< oT >::const_iterator field< oT >::begin (  )  const [inline, inherited]

Definition at line 1043 of file field_meat.hpp.

01044   {
01045   arma_extra_debug_sigprint();
01046   
01047   return field<oT>::const_iterator(*this);
01048   }

template<typename oT >
field< oT >::iterator field< oT >::end (  )  [inline, inherited]

Definition at line 1055 of file field_meat.hpp.

01056   {
01057   arma_extra_debug_sigprint();
01058   
01059   return field<oT>::iterator(*this, true);
01060   }

template<typename oT >
field< oT >::const_iterator field< oT >::end (  )  const [inline, inherited]

Definition at line 1067 of file field_meat.hpp.

01068   {
01069   arma_extra_debug_sigprint();
01070   
01071   return field<oT>::const_iterator(*this, true);
01072   }

template<typename oT >
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().

01086   {
01087   arma_extra_debug_sigprint();
01088   
01089   x.delete_objects();
01090   x.create_objects();
01091   }

template<typename eT >
void field_aux::reset_objects ( field< Mat< eT > > &  x  )  [inline, static, inherited]

Definition at line 1098 of file field_meat.hpp.

01099   {
01100   arma_extra_debug_sigprint();
01101   
01102   for(u32 i=0; i<x.n_elem; ++i)
01103     {
01104     (*(x.mem[i])).reset();
01105     }
01106   }

template<typename eT >
void field_aux::reset_objects ( field< Col< eT > > &  x  )  [inline, static, inherited]

Definition at line 1113 of file field_meat.hpp.

01114   {
01115   arma_extra_debug_sigprint();
01116   
01117   for(u32 i=0; i<x.n_elem; ++i)
01118     {
01119     (*(x.mem[i])).reset();
01120     }
01121   }

template<typename eT >
void field_aux::reset_objects ( field< Row< eT > > &  x  )  [inline, static, inherited]

Definition at line 1128 of file field_meat.hpp.

01129   {
01130   arma_extra_debug_sigprint();
01131   
01132   for(u32 i=0; i<x.n_elem; ++i)
01133     {
01134     (*(x.mem[i])).reset();
01135     }
01136   }

template<typename eT >
void field_aux::reset_objects ( field< Cube< eT > > &  x  )  [inline, static, inherited]

Definition at line 1143 of file field_meat.hpp.

01144   {
01145   arma_extra_debug_sigprint();
01146   
01147   for(u32 i=0; i<x.n_elem; ++i)
01148     {
01149     (*(x.mem[i])).reset();
01150     }
01151   }

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.

01158   {
01159   arma_extra_debug_sigprint();
01160   
01161   for(u32 i=0; i<x.n_elem; ++i)
01162     {
01163     (*(x.mem[i])).clear();
01164     }
01165   }

template<typename oT >
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.

01179   {
01180   arma_extra_debug_sigprint();
01181   
01182   err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = ";
01183   
01184   return false;
01185   }

template<typename oT >
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.

01193   {
01194   arma_extra_debug_sigprint();
01195   
01196   err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = ";
01197   
01198   return false;
01199   }

template<typename oT >
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.

01207   {
01208   arma_extra_debug_sigprint();
01209   
01210   err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = ";
01211   
01212   return false;
01213   }

template<typename oT >
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.

01221   {
01222   arma_extra_debug_sigprint();
01223   
01224   err_msg = " [sorry, saving/loading this type of field is currently not supported] filename = ";
01225   
01226   return false;
01227   }

template<typename eT >
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().

01235   {
01236   arma_extra_debug_sigprint();
01237   
01238   switch(type)
01239     {
01240     case arma_binary:
01241       return diskio::save_arma_binary(x, name);
01242       break;
01243       
01244     case ppm_binary:
01245       return diskio::save_ppm_binary(x, name);
01246       break;
01247     
01248     default:
01249       err_msg = " [unsupported type] filename = ";
01250       return false;
01251     }
01252   }

template<typename eT >
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().

01260   {
01261   arma_extra_debug_sigprint();
01262   
01263   switch(type)
01264     {
01265     case arma_binary:
01266       return diskio::save_arma_binary(x, os);
01267       break;
01268       
01269     case ppm_binary:
01270       return diskio::save_ppm_binary(x, os);
01271       break;
01272     
01273     default:
01274       err_msg = " [unsupported type] filename = ";
01275       return false;
01276     }
01277   }

template<typename eT >
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.

01285   {
01286   arma_extra_debug_sigprint();
01287   
01288   switch(type)
01289     {
01290     case auto_detect:
01291       return diskio::load_auto_detect(x, name, err_msg);
01292       break;
01293     
01294     case arma_binary:
01295       return diskio::load_arma_binary(x, name, err_msg);
01296       break;
01297       
01298     case ppm_binary:
01299       return diskio::load_ppm_binary(x, name, err_msg);
01300       break;
01301     
01302     default:
01303       err_msg = " [unsupported type] filename = ";
01304       return false;
01305     }
01306   }

template<typename eT >
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.

01314   {
01315   arma_extra_debug_sigprint();
01316   
01317   switch(type)
01318     {
01319     case auto_detect:
01320       return diskio::load_auto_detect(x, is, err_msg);
01321       break;
01322     
01323     case arma_binary:
01324       return diskio::load_arma_binary(x, is, err_msg);
01325       break;
01326       
01327     case ppm_binary:
01328       return diskio::load_ppm_binary(x, is, err_msg);
01329       break;
01330     
01331     default:
01332       err_msg = " [unsupported type] filename = ";
01333       return false;
01334     }
01335   }

template<typename eT >
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().

01343   {
01344   arma_extra_debug_sigprint();
01345   
01346   switch(type)
01347     {
01348     case arma_binary:
01349       return diskio::save_arma_binary(x, name);
01350       break;
01351       
01352     case ppm_binary:
01353       return diskio::save_ppm_binary(x, name);
01354       break;
01355     
01356     default:
01357       err_msg = " [unsupported type] filename = ";
01358       return false;
01359     }
01360   }

template<typename eT >
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().

01368   {
01369   arma_extra_debug_sigprint();
01370   
01371   switch(type)
01372     {
01373     case arma_binary:
01374       return diskio::save_arma_binary(x, os);
01375       break;
01376       
01377     case ppm_binary:
01378       return diskio::save_ppm_binary(x, os);
01379       break;
01380     
01381     default:
01382       err_msg = " [unsupported type] filename = ";
01383       return false;
01384     }
01385   }

template<typename eT >
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.

01393   {
01394   arma_extra_debug_sigprint();
01395   
01396   switch(type)
01397     {
01398     case auto_detect:
01399       return diskio::load_auto_detect(x, name, err_msg);
01400       break;
01401     
01402     case arma_binary:
01403       return diskio::load_arma_binary(x, name, err_msg);
01404       break;
01405       
01406     case ppm_binary:
01407       return diskio::load_ppm_binary(x, name, err_msg);
01408       break;
01409     
01410     default:
01411       err_msg = " [unsupported type] filename = ";
01412       return false;
01413     }
01414   }

template<typename eT >
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.

01422   {
01423   arma_extra_debug_sigprint();
01424   
01425   switch(type)
01426     {
01427     case auto_detect:
01428       return diskio::load_auto_detect(x, is, err_msg);
01429       break;
01430     
01431     case arma_binary:
01432       return diskio::load_arma_binary(x, is, err_msg);
01433       break;
01434       
01435     case ppm_binary:
01436       return diskio::load_ppm_binary(x, is, err_msg);
01437       break;
01438     
01439     default:
01440       err_msg = " [unsupported type] filename = ";
01441       return false;
01442     }
01443   }

template<typename eT >
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().

01451   {
01452   arma_extra_debug_sigprint();
01453   
01454   switch(type)
01455     {
01456     case arma_binary:
01457       return diskio::save_arma_binary(x, name, err_msg);
01458       break;
01459       
01460     case ppm_binary:
01461       return diskio::save_ppm_binary(x, name, err_msg);
01462       break;
01463     
01464     default:
01465       err_msg = " [unsupported type] filename = ";
01466       return false;
01467     }
01468   }

template<typename eT >
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().

01476   {
01477   arma_extra_debug_sigprint();
01478   
01479   switch(type)
01480     {
01481     case arma_binary:
01482       return diskio::save_arma_binary(x, os, err_msg);
01483       break;
01484       
01485     case ppm_binary:
01486       return diskio::save_ppm_binary(x, os, err_msg);
01487       break;
01488     
01489     default:
01490       err_msg = " [unsupported type] filename = ";
01491       return false;
01492     }
01493   }

template<typename eT >
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.

01501   {
01502   arma_extra_debug_sigprint();
01503   
01504   switch(type)
01505     {
01506     case auto_detect:
01507       return diskio::load_auto_detect(x, name, err_msg);
01508       break;
01509     
01510     case arma_binary:
01511       return diskio::load_arma_binary(x, name, err_msg);
01512       break;
01513       
01514     case ppm_binary:
01515       return diskio::load_ppm_binary(x, name, err_msg);
01516       break;
01517     
01518     default:
01519       err_msg = " [unsupported type] filename = ";
01520       return false;
01521     }
01522   }

template<typename eT >
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.

01530   {
01531   arma_extra_debug_sigprint();
01532   
01533   switch(type)
01534     {
01535     case auto_detect:
01536       return diskio::load_auto_detect(x, is, err_msg);
01537       break;
01538     
01539     case arma_binary:
01540       return diskio::load_arma_binary(x, is, err_msg);
01541       break;
01542       
01543     case ppm_binary:
01544       return diskio::load_ppm_binary(x, is, err_msg);
01545       break;
01546     
01547     default:
01548       err_msg = " [unsupported type] filename = ";
01549       return false;
01550     }
01551   }

template<typename eT >
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().

01559   {
01560   arma_extra_debug_sigprint();
01561   
01562   switch(type)
01563     {
01564     case arma_binary:
01565       return diskio::save_arma_binary(x, name, err_msg);
01566       break;
01567       
01568     case ppm_binary:
01569       return diskio::save_ppm_binary(x, name, err_msg);
01570       break;
01571     
01572     default:
01573       err_msg = " [unsupported type] filename = ";
01574       return false;
01575     }
01576   }

template<typename eT >
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().

01584   {
01585   arma_extra_debug_sigprint();
01586   
01587   switch(type)
01588     {
01589     case arma_binary:
01590       return diskio::save_arma_binary(x, os, err_msg);
01591       break;
01592       
01593     case ppm_binary:
01594       return diskio::save_ppm_binary(x, os, err_msg);
01595       break;
01596     
01597     default:
01598       err_msg = " [unsupported type] filename = ";
01599       return false;
01600     }
01601   }

template<typename eT >
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.

01609   {
01610   arma_extra_debug_sigprint();
01611   
01612   switch(type)
01613     {
01614     case auto_detect:
01615       return diskio::load_auto_detect(x, name, err_msg);
01616       break;
01617     
01618     case arma_binary:
01619       return diskio::load_arma_binary(x, name, err_msg);
01620       break;
01621       
01622     case ppm_binary:
01623       return diskio::load_ppm_binary(x, name, err_msg);
01624       break;
01625     
01626     default:
01627       err_msg = " [unsupported type] filename = ";
01628       return false;
01629     }
01630   }

template<typename eT >
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.

01638   {
01639   arma_extra_debug_sigprint();
01640   
01641   switch(type)
01642     {
01643     case auto_detect:
01644       return diskio::load_auto_detect(x, is, err_msg);
01645       break;
01646     
01647     case arma_binary:
01648       return diskio::load_arma_binary(x, is, err_msg);
01649       break;
01650       
01651     case ppm_binary:
01652       return diskio::load_ppm_binary(x, is, err_msg);
01653       break;
01654     
01655     default:
01656       err_msg = " [unsupported type] filename = ";
01657       return false;
01658     }
01659   }

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().

01666   {
01667   arma_extra_debug_sigprint();
01668   
01669   err_msg.clear();
01670   
01671   return diskio::save_std_string(x, name);
01672   }

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().

01679   {
01680   arma_extra_debug_sigprint();
01681   
01682   err_msg.clear();
01683   
01684   return diskio::save_std_string(x, os);
01685   }

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().

01692   {
01693   arma_extra_debug_sigprint();
01694   
01695   return diskio::load_std_string(x, name, err_msg);
01696   }

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().

01703   {
01704   arma_extra_debug_sigprint();
01705   
01706   return diskio::load_std_string(x, is, err_msg);
01707   }