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 ()
void field::save (const std::string name, const file_type type=arma_binary) const
void field::save (std::ostream &os, const file_type type=arma_binary) const
void field::load (const std::string name, const file_type type=auto_detect)
void field::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 void field_aux::save (const field< oT > &x, const std::string &name, const file_type type)
template<typename oT >
static void field_aux::save (const field< oT > &x, std::ostream &os, const file_type type)
template<typename oT >
static void field_aux::load (field< oT > &x, const std::string &name, const file_type type)
template<typename oT >
static void field_aux::load (field< oT > &x, std::istream &is, const file_type type)
template<typename eT >
static void field_aux::save (const field< Mat< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::save (const field< Mat< eT > > &x, std::ostream &os, const file_type type)
template<typename eT >
static void field_aux::load (field< Mat< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::load (field< Mat< eT > > &x, std::istream &is, const file_type type)
template<typename eT >
static void field_aux::save (const field< Col< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::save (const field< Col< eT > > &x, std::ostream &os, const file_type type)
template<typename eT >
static void field_aux::load (field< Col< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::load (field< Col< eT > > &x, std::istream &is, const file_type type)
template<typename eT >
static void field_aux::save (const field< Row< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::save (const field< Row< eT > > &x, std::ostream &os, const file_type type)
template<typename eT >
static void field_aux::load (field< Row< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::load (field< Row< eT > > &x, std::istream &is, const file_type type)
template<typename eT >
static void field_aux::save (const field< Cube< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::save (const field< Cube< eT > > &x, std::ostream &os, const file_type type)
template<typename eT >
static void field_aux::load (field< Cube< eT > > &x, const std::string &name, const file_type type)
template<typename eT >
static void field_aux::load (field< Cube< eT > > &x, std::istream &is, const file_type type)
static void field_aux::save (const field< std::string > &x, const std::string &name, const file_type type)
static void field_aux::save (const field< std::string > &x, std::ostream &os, const file_type type)
static void field_aux::load (field< std::string > &x, const std::string &name, const file_type type)
static void field_aux::load (field< std::string > &x, std::istream &is, const file_type type)

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

Referenced by field_aux::load(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and diskio::load_std_string().

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

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 >
void field< oT >::save ( const std::string  name,
const file_type  type = arma_binary 
) const [inline, inherited]

Definition at line 560 of file field_meat.hpp.

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

00561   {
00562   arma_extra_debug_sigprint();
00563   
00564   field_aux::save(*this, name, type);
00565   }

template<typename oT >
void field< oT >::save ( std::ostream &  os,
const file_type  type = arma_binary 
) const [inline, inherited]

Definition at line 572 of file field_meat.hpp.

References field< oT >::save().

00573   {
00574   arma_extra_debug_sigprint();
00575   
00576   field_aux::save(*this, os, type);
00577   }

template<typename oT >
void field< oT >::load ( const std::string  name,
const file_type  type = auto_detect 
) [inline, inherited]

Definition at line 584 of file field_meat.hpp.

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

00585   {
00586   arma_extra_debug_sigprint();
00587   
00588   field_aux::load(*this, name, type);
00589   }

template<typename oT >
void field< oT >::load ( std::istream &  is,
const file_type  type = auto_detect 
) [inline, inherited]

Definition at line 596 of file field_meat.hpp.

References field< oT >::load().

00597   {
00598   arma_extra_debug_sigprint();
00599   
00600   field_aux::load(*this, is, type);
00601   }

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

construct a field from a given field

Definition at line 609 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().

00610   {
00611   arma_extra_debug_sigprint();
00612   
00613   if(this != &x)
00614     {
00615     init(x.n_rows, x.n_cols);
00616     
00617     field& t = *this;
00618     
00619     for(u32 col=0; col<x.n_cols; ++col)
00620     for(u32 row=0; row<x.n_rows; ++row)
00621       {
00622       t.at(row,col) = x.at(row,col);
00623       }
00624     }
00625   
00626   }

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

00635   {
00636   arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in );
00637   
00638   const u32 n_elem_new = n_rows_in * n_cols_in;
00639 
00640   if(n_elem == n_elem_new)
00641     {
00642     // delete_objects();
00643     // create_objects();
00644     access::rw(n_rows) = n_rows_in;
00645     access::rw(n_cols) = n_cols_in;
00646     }
00647   else
00648     {
00649     delete_objects();
00650     
00651     if(n_elem > sizeof(mem_local)/sizeof(oT*) )
00652       {
00653       delete [] mem;
00654       }
00655     
00656     if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) )
00657       {
00658       mem = mem_local;
00659       }
00660     else
00661       {
00662       mem = new(std::nothrow) oT* [n_elem_new];
00663       arma_check( (mem == 0), "field::init(): out of memory" );
00664       }
00665     
00666     access::rw(n_elem) = n_elem_new;
00667     
00668     if(n_elem_new == 0)
00669       {
00670       access::rw(n_rows) = 0;
00671       access::rw(n_cols) = 0;
00672       }
00673     else
00674       {
00675       access::rw(n_rows) = n_rows_in;
00676       access::rw(n_cols) = n_cols_in;
00677       }
00678     
00679     create_objects();
00680     
00681     }
00682   
00683   }

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

Definition at line 690 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().

00691   {
00692   arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem );
00693   
00694   for(u32 i=0; i<n_elem; ++i)
00695     {
00696     if(mem[i] != 0)
00697       {
00698       delete mem[i];
00699       mem[i] = 0;
00700       }
00701     }
00702   
00703   }

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

Definition at line 710 of file field_meat.hpp.

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

Referenced by field< oT >::init(), and field_aux::reset_objects().

00711   {
00712   arma_extra_debug_sigprint( arma_boost::format("n_elem = %d") % n_elem );
00713   
00714   for(u32 i=0; i<n_elem; ++i)
00715     {
00716     mem[i] = new oT;
00717     }
00718   
00719   }

template<typename oT >
field< oT >::iterator::iterator ( field< oT > &  in_M,
const bool  at_end = false 
) [inline, inherited]

Definition at line 725 of file field_meat.hpp.

00726   : M(in_M)
00727   , i( (at_end == false) ? 0 : in_M.n_elem )
00728   {
00729   arma_extra_debug_sigprint();
00730   }

template<typename oT >
oT & field< oT >::iterator::operator* (  )  [inline, inherited]

Definition at line 737 of file field_meat.hpp.

References field< oT >::iterator::i, and field< oT >::iterator::M.

00738   {
00739   return M[i];
00740   }

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

Definition at line 747 of file field_meat.hpp.

References field< oT >::iterator::i.

Referenced by field< oT >::iterator::operator++().

00748   {
00749   ++i;
00750   
00751   return *this;
00752   }

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

Definition at line 759 of file field_meat.hpp.

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

00760   {
00761   operator++();
00762   }

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

Definition at line 769 of file field_meat.hpp.

References field< oT >::iterator::i.

Referenced by field< oT >::iterator::operator--().

00770   {
00771   if(i > 0)
00772     {
00773     --i;
00774     }
00775   
00776   return *this;
00777   }

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

Definition at line 784 of file field_meat.hpp.

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

00785   {
00786   operator--();
00787   }

template<typename oT >
field< oT >::const_iterator::const_iterator ( const field< oT > &  in_M,
const bool  at_end = false 
) [inline, inherited]

Definition at line 813 of file field_meat.hpp.

00814   : M(in_M)
00815   , i( (at_end == false) ? 0 : in_M.n_elem )
00816   {
00817   arma_extra_debug_sigprint();
00818   }

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

Definition at line 836 of file field_meat.hpp.

References field< oT >::const_iterator::i, and field< oT >::const_iterator::M.

00837   {
00838   return M[i];
00839   }

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

Definition at line 846 of file field_meat.hpp.

References field< oT >::const_iterator::i.

Referenced by field< oT >::const_iterator::operator++().

00847   {
00848   ++i;
00849   
00850   return *this;
00851   }

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

Definition at line 858 of file field_meat.hpp.

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

00859   {
00860   operator++();
00861   }

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

Definition at line 868 of file field_meat.hpp.

References field< oT >::const_iterator::i.

Referenced by field< oT >::const_iterator::operator--().

00869   {
00870   if(i > 0)
00871     {
00872     --i;
00873     }
00874   
00875   return *this;
00876   }

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

Definition at line 883 of file field_meat.hpp.

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

00884   {
00885   operator--();
00886   }

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

Definition at line 913 of file field_meat.hpp.

00914   {
00915   arma_extra_debug_sigprint();
00916   
00917   return field<oT>::iterator(*this);
00918   }

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

Definition at line 925 of file field_meat.hpp.

00926   {
00927   arma_extra_debug_sigprint();
00928   
00929   return field<oT>::const_iterator(*this);
00930   }

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

Definition at line 937 of file field_meat.hpp.

00938   {
00939   arma_extra_debug_sigprint();
00940   
00941   return field<oT>::iterator(*this, true);
00942   }

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

Definition at line 949 of file field_meat.hpp.

00950   {
00951   arma_extra_debug_sigprint();
00952   
00953   return field<oT>::const_iterator(*this, true);
00954   }

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

Definition at line 967 of file field_meat.hpp.

References field< oT >::create_objects(), and field< oT >::delete_objects().

00968   {
00969   arma_extra_debug_sigprint();
00970   
00971   x.delete_objects();
00972   x.create_objects();
00973   }

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

Definition at line 980 of file field_meat.hpp.

00981   {
00982   arma_extra_debug_sigprint();
00983   
00984   for(u32 i=0; i<x.n_elem; ++i)
00985     {
00986     (*(x.mem[i])).reset();
00987     }
00988   }

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

Definition at line 995 of file field_meat.hpp.

00996   {
00997   arma_extra_debug_sigprint();
00998   
00999   for(u32 i=0; i<x.n_elem; ++i)
01000     {
01001     (*(x.mem[i])).reset();
01002     }
01003   }

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

Definition at line 1010 of file field_meat.hpp.

01011   {
01012   arma_extra_debug_sigprint();
01013   
01014   for(u32 i=0; i<x.n_elem; ++i)
01015     {
01016     (*(x.mem[i])).reset();
01017     }
01018   }

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

Definition at line 1025 of file field_meat.hpp.

01026   {
01027   arma_extra_debug_sigprint();
01028   
01029   for(u32 i=0; i<x.n_elem; ++i)
01030     {
01031     (*(x.mem[i])).reset();
01032     }
01033   }

void field_aux::reset_objects ( field< std::string > &  x  )  [inline, static, inherited]

Definition at line 1039 of file field_meat.hpp.

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

01040   {
01041   arma_extra_debug_sigprint();
01042   
01043   for(u32 i=0; i<x.n_elem; ++i)
01044     {
01045     (*(x.mem[i])).clear();
01046     }
01047   }

template<typename oT >
void field_aux::save ( const field< oT > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1060 of file field_meat.hpp.

References arma_print().

01061   {
01062   arma_extra_debug_sigprint();
01063   
01064   arma_print("field_aux::save(): sorry, saving this type of field is currently not supported");
01065   }

template<typename oT >
void field_aux::save ( const field< oT > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1072 of file field_meat.hpp.

References arma_print().

01073   {
01074   arma_extra_debug_sigprint();
01075   
01076   arma_print("field_aux::save(): sorry, saving this type of field is currently not supported");
01077   }

template<typename oT >
void field_aux::load ( field< oT > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1084 of file field_meat.hpp.

References arma_print(), and field< oT >::reset().

01085   {
01086   arma_extra_debug_sigprint();
01087   
01088   arma_print("field_aux::load(): sorry, loading this type of field is currently not supported");
01089   x.reset();
01090   }

template<typename oT >
void field_aux::load ( field< oT > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1097 of file field_meat.hpp.

References arma_print(), and field< oT >::reset().

01098   {
01099   arma_extra_debug_sigprint();
01100   
01101   arma_print("field_aux::load(): sorry, loading this type of field is currently not supported");
01102   x.reset();
01103   }

template<typename eT >
void field_aux::save ( const field< Mat< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1110 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01111   {
01112   arma_extra_debug_sigprint();
01113   
01114   switch(type)
01115     {
01116     case arma_binary:
01117       diskio::save_arma_binary(x, name);
01118       break;
01119       
01120     case ppm_binary:
01121       diskio::save_ppm_binary(x, name);
01122       break;
01123     
01124     default:
01125       arma_stop("field_aux::save(): unsupported type");
01126     }
01127   }

template<typename eT >
void field_aux::save ( const field< Mat< eT > > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1134 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01135   {
01136   arma_extra_debug_sigprint();
01137   
01138   switch(type)
01139     {
01140     case arma_binary:
01141       diskio::save_arma_binary(x, "[ostream]", os);
01142       break;
01143       
01144     case ppm_binary:
01145       diskio::save_ppm_binary(x, "[ostream]", os);
01146       break;
01147     
01148     default:
01149       arma_stop("field_aux::save(): unsupported type");
01150     }
01151   }

template<typename eT >
void field_aux::load ( field< Mat< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1158 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01159   {
01160   arma_extra_debug_sigprint();
01161   
01162   switch(type)
01163     {
01164     case auto_detect:
01165       diskio::load_auto_detect(x, name);
01166       break;
01167     
01168     case arma_binary:
01169       diskio::load_arma_binary(x, name);
01170       break;
01171       
01172     case ppm_binary:
01173       diskio::load_ppm_binary(x, name);
01174       break;
01175     
01176     default:
01177       arma_stop("field_aux::load(): unsupported type");
01178     }
01179   }

template<typename eT >
void field_aux::load ( field< Mat< eT > > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1186 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01187   {
01188   arma_extra_debug_sigprint();
01189   
01190   switch(type)
01191     {
01192     case auto_detect:
01193       diskio::load_auto_detect(x, "[istream]", is);
01194       break;
01195     
01196     case arma_binary:
01197       diskio::load_arma_binary(x, "[istream]", is);
01198       break;
01199       
01200     case ppm_binary:
01201       diskio::load_ppm_binary(x, "[istream]", is);
01202       break;
01203     
01204     default:
01205       arma_stop("field_aux::load(): unsupported type");
01206     }
01207   }

template<typename eT >
void field_aux::save ( const field< Col< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1214 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01215   {
01216   arma_extra_debug_sigprint();
01217   
01218   switch(type)
01219     {
01220     case arma_binary:
01221       diskio::save_arma_binary(x, name);
01222       break;
01223       
01224     case ppm_binary:
01225       diskio::save_ppm_binary(x, name);
01226       break;
01227     
01228     default:
01229       arma_stop("field_aux::save(): unsupported type");
01230     }
01231   }

template<typename eT >
void field_aux::save ( const field< Col< eT > > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1238 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01239   {
01240   arma_extra_debug_sigprint();
01241   
01242   switch(type)
01243     {
01244     case arma_binary:
01245       diskio::save_arma_binary(x, "[ostream]", os);
01246       break;
01247       
01248     case ppm_binary:
01249       diskio::save_ppm_binary(x, "[ostream]", os);
01250       break;
01251     
01252     default:
01253       arma_stop("field_aux::save(): unsupported type");
01254     }
01255   }

template<typename eT >
void field_aux::load ( field< Col< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1262 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01263   {
01264   arma_extra_debug_sigprint();
01265   
01266   switch(type)
01267     {
01268     case auto_detect:
01269       diskio::load_auto_detect(x, name);
01270       break;
01271     
01272     case arma_binary:
01273       diskio::load_arma_binary(x, name);
01274       break;
01275       
01276     case ppm_binary:
01277       diskio::load_ppm_binary(x, name);
01278       break;
01279     
01280     default:
01281       arma_stop("field_aux::load(): unsupported type");
01282     }
01283   }

template<typename eT >
void field_aux::load ( field< Col< eT > > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1290 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01291   {
01292   arma_extra_debug_sigprint();
01293   
01294   switch(type)
01295     {
01296     case auto_detect:
01297       diskio::load_auto_detect(x, "[istream]", is);
01298       break;
01299     
01300     case arma_binary:
01301       diskio::load_arma_binary(x, "[istream]", is);
01302       break;
01303       
01304     case ppm_binary:
01305       diskio::load_ppm_binary(x, "[istream]", is);
01306       break;
01307     
01308     default:
01309       arma_stop("field_aux::load(): unsupported type");
01310     }
01311   }

template<typename eT >
void field_aux::save ( const field< Row< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1318 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01319   {
01320   arma_extra_debug_sigprint();
01321   
01322   switch(type)
01323     {
01324     case arma_binary:
01325       diskio::save_arma_binary(x, name);
01326       break;
01327       
01328     case ppm_binary:
01329       diskio::save_ppm_binary(x, name);
01330       break;
01331     
01332     default:
01333       arma_stop("field_aux::save(): unsupported type");
01334     }
01335   }

template<typename eT >
void field_aux::save ( const field< Row< eT > > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1342 of file field_meat.hpp.

References arma_binary, arma_stop(), 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       diskio::save_arma_binary(x, "[ostream]", os);
01350       break;
01351       
01352     case ppm_binary:
01353       diskio::save_ppm_binary(x, "[ostream]", os);
01354       break;
01355     
01356     default:
01357       arma_stop("field_aux::save(): unsupported type");
01358     }
01359   }

template<typename eT >
void field_aux::load ( field< Row< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1366 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01367   {
01368   arma_extra_debug_sigprint();
01369   
01370   switch(type)
01371     {
01372     case auto_detect:
01373       diskio::load_auto_detect(x, name);
01374       break;
01375     
01376     case arma_binary:
01377       diskio::load_arma_binary(x, name);
01378       break;
01379       
01380     case ppm_binary:
01381       diskio::load_ppm_binary(x, name);
01382       break;
01383     
01384     default:
01385       arma_stop("field_aux::load(): unsupported type");
01386     }
01387   }

template<typename eT >
void field_aux::load ( field< Row< eT > > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1394 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01395   {
01396   arma_extra_debug_sigprint();
01397   
01398   switch(type)
01399     {
01400     case auto_detect:
01401       diskio::load_auto_detect(x, "[istream]", is);
01402       break;
01403     
01404     case arma_binary:
01405       diskio::load_arma_binary(x, "[istream]", is);
01406       break;
01407       
01408     case ppm_binary:
01409       diskio::load_ppm_binary(x, "[istream]", is);
01410       break;
01411     
01412     default:
01413       arma_stop("field_aux::load(): unsupported type");
01414     }
01415   }

template<typename eT >
void field_aux::save ( const field< Cube< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1422 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01423   {
01424   arma_extra_debug_sigprint();
01425   
01426   switch(type)
01427     {
01428     case arma_binary:
01429       diskio::save_arma_binary(x, name);
01430       break;
01431       
01432     case ppm_binary:
01433       diskio::save_ppm_binary(x, name);
01434       break;
01435     
01436     default:
01437       arma_stop("field_aux::save(): unsupported type");
01438     }
01439   }

template<typename eT >
void field_aux::save ( const field< Cube< eT > > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1446 of file field_meat.hpp.

References arma_binary, arma_stop(), ppm_binary, diskio::save_arma_binary(), and diskio::save_ppm_binary().

01447   {
01448   arma_extra_debug_sigprint();
01449   
01450   switch(type)
01451     {
01452     case arma_binary:
01453       diskio::save_arma_binary(x, "[ostream]", os);
01454       break;
01455       
01456     case ppm_binary:
01457       diskio::save_ppm_binary(x, "[ostream]", os);
01458       break;
01459     
01460     default:
01461       arma_stop("field_aux::save(): unsupported type");
01462     }
01463   }

template<typename eT >
void field_aux::load ( field< Cube< eT > > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1470 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01471   {
01472   arma_extra_debug_sigprint();
01473   
01474   switch(type)
01475     {
01476     case auto_detect:
01477       diskio::load_auto_detect(x, name);
01478       break;
01479     
01480     case arma_binary:
01481       diskio::load_arma_binary(x, name);
01482       break;
01483       
01484     case ppm_binary:
01485       diskio::load_ppm_binary(x, name);
01486       break;
01487     
01488     default:
01489       arma_stop("field_aux::load(): unsupported type");
01490     }
01491   }

template<typename eT >
void field_aux::load ( field< Cube< eT > > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1498 of file field_meat.hpp.

References arma_binary, arma_stop(), auto_detect, diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), and ppm_binary.

01499   {
01500   arma_extra_debug_sigprint();
01501   
01502   switch(type)
01503     {
01504     case auto_detect:
01505       diskio::load_auto_detect(x, "[istream]", is);
01506       break;
01507     
01508     case arma_binary:
01509       diskio::load_arma_binary(x, "[istream]", is);
01510       break;
01511       
01512     case ppm_binary:
01513       diskio::load_ppm_binary(x, "[istream]", is);
01514       break;
01515     
01516     default:
01517       arma_stop("field_aux::load(): unsupported type");
01518     }
01519   }

void field_aux::save ( const field< std::string > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1525 of file field_meat.hpp.

References diskio::save_std_string().

01526   {
01527   arma_extra_debug_sigprint();
01528   
01529   diskio::save_std_string(x, name);
01530   }

void field_aux::save ( const field< std::string > &  x,
std::ostream &  os,
const file_type  type 
) [inline, static, inherited]

Definition at line 1536 of file field_meat.hpp.

References diskio::save_std_string().

01537   {
01538   arma_extra_debug_sigprint();
01539   
01540   diskio::save_std_string(x, "[ostream]", os);
01541   }

void field_aux::load ( field< std::string > &  x,
const std::string &  name,
const file_type  type 
) [inline, static, inherited]

Definition at line 1547 of file field_meat.hpp.

References diskio::load_std_string().

01548   {
01549   arma_extra_debug_sigprint();
01550   
01551   diskio::load_std_string(x, name);
01552   }

void field_aux::load ( field< std::string > &  x,
std::istream &  is,
const file_type  type 
) [inline, static, inherited]

Definition at line 1558 of file field_meat.hpp.

References diskio::load_std_string().

01559   {
01560   arma_extra_debug_sigprint();
01561   
01562   diskio::load_std_string(x, "[istream]", is);
01563   }