Mat


Classes

class  Mat< eT >
 Dense matrix class. More...
class  Mat_aux

Functions

 Mat::~Mat ()
 Mat::Mat ()
 Mat::Mat (const u32 in_rows, const u32 in_cols)
 construct the matrix to have user specified dimensions
void Mat::set_size (const u32 in_rows, const u32 in_cols)
 change the matrix to have user specified dimensions (data is not preserved)
void Mat::init (const u32 in_rows, const u32 in_cols)
 internal matrix construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new'
 Mat::Mat (const char *text)
 create the matrix from a textual description
const MatMat::operator= (const char *text)
 create the matrix from a textual description
 Mat::Mat (const std::string &text)
 create the matrix from a textual description
const MatMat::operator= (const std::string &text)
 create the matrix from a textual description
void Mat::init (const std::string &text)
 internal function to create the matrix from a textual description
arma_inline const MatMat::operator= (const eT val)
 Set the matrix to be equal to the specified scalar. NOTE: the size of the matrix will be 1x1.
arma_inline const MatMat::operator+= (const eT val)
 In-place addition of a scalar to all elements of the matrix.
arma_inline const MatMat::operator-= (const eT val)
 In-place subtraction of a scalar from all elements of the matrix.
arma_inline const MatMat::operator*= (const eT val)
 In-place multiplication of all elements of the matrix with a scalar.
arma_inline const MatMat::operator/= (const eT val)
 In-place division of all elements of the matrix with a scalar.
 Mat::Mat (const Mat &m)
 construct a matrix from a given matrix
const MatMat::operator= (const Mat &m)
 construct a matrix from a given matrix
void Mat::init (const Mat &x)
 construct a matrix from a given matrix
 Mat::Mat (const eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols)
 construct a matrix from a given auxillary array of eTs
const MatMat::operator+= (const Mat &m)
 in-place matrix addition
const MatMat::operator-= (const Mat &m)
 in-place matrix subtraction
const MatMat::operator*= (const Mat &m)
 in-place matrix multiplication
const MatMat::operator%= (const Mat &m)
 in-place element-wise matrix multiplication
const MatMat::operator/= (const Mat &m)
 in-place element-wise matrix division
template<typename T1 , typename T2 >
 Mat::Mat (const Base< typename Mat< eT >::pod_type, T1 > &A, const Base< typename Mat< eT >::pod_type, T2 > &B)
 for constructing a complex matrix out of two non-complex matrices
 Mat::Mat (const subview< eT > &X)
 construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation)
const MatMat::operator= (const subview< eT > &X)
 construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation)
const MatMat::operator+= (const subview< eT > &X)
 in-place matrix addition (using a submatrix on the right-hand-side)
const MatMat::operator-= (const subview< eT > &X)
 in-place matrix subtraction (using a submatrix on the right-hand-side)
const MatMat::operator*= (const subview< eT > &X)
 in-place matrix mutiplication (using a submatrix on the right-hand-side)
const MatMat::operator%= (const subview< eT > &X)
 in-place element-wise matrix mutiplication (using a submatrix on the right-hand-side)
const MatMat::operator/= (const subview< eT > &X)
 in-place element-wise matrix division (using a submatrix on the right-hand-side)
 Mat::Mat (const diagview< eT > &X)
 construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation)
const MatMat::operator= (const diagview< eT > &X)
 construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation)
arma_inline subview_row< eT > Mat::row (const u32 row_num)
 creation of subview (row vector)
arma_inline const subview_row< eT > Mat::row (const u32 row_num) const
 creation of subview (row vector)
arma_inline subview_col< eT > Mat::col (const u32 col_num)
 creation of subview (column vector)
arma_inline const subview_col< eT > Mat::col (const u32 col_num) const
 creation of subview (column vector)
arma_inline subview< eT > Mat::rows (const u32 in_row1, const u32 in_row2)
 creation of subview (submatrix comprised of specified row vectors)
arma_inline const subview< eT > Mat::rows (const u32 in_row1, const u32 in_row2) const
 creation of subview (submatrix comprised of specified row vectors)
arma_inline subview< eT > Mat::cols (const u32 in_col1, const u32 in_col2)
 creation of subview (submatrix comprised of specified column vectors)
arma_inline const subview< eT > Mat::cols (const u32 in_col1, const u32 in_col2) const
 creation of subview (submatrix comprised of specified column vectors)
arma_inline subview< eT > Mat::submat (const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2)
 creation of subview (submatrix)
arma_inline const subview< eT > Mat::submat (const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2) const
 creation of subview (generic submatrix)
arma_inline diagview< eT > Mat::diag (const s32 in_id=0)
 creation of diagview (diagonal)
arma_inline const diagview< eT > Mat::diag (const s32 in_id=0) const
 creation of diagview (diagonal)
void Mat::swap_rows (const u32 in_row1, const u32 in_row2)
void Mat::swap_cols (const u32 in_col1, const u32 in_col2)
template<typename T1 , typename op_type >
 Mat::Mat (const Op< T1, op_type > &X)
 create a matrix from Op, i.e. run the previously delayed unary operations
template<typename T1 , typename op_type >
const MatMat::operator= (const Op< T1, op_type > &X)
 create a matrix from Op, i.e. run the previously delayed unary operations
template<typename T1 , typename op_type >
const MatMat::operator+= (const Op< T1, op_type > &X)
 in-place matrix addition, with the right-hand-side operand having delayed operations
template<typename T1 , typename op_type >
const MatMat::operator-= (const Op< T1, op_type > &X)
 in-place matrix subtraction, with the right-hand-side operand having delayed operations
template<typename T1 , typename op_type >
const MatMat::operator*= (const Op< T1, op_type > &X)
 in-place matrix multiplication, with the right-hand-side operand having delayed operations
template<typename T1 , typename op_type >
const MatMat::operator%= (const Op< T1, op_type > &X)
 in-place matrix element-wise multiplication, with the right-hand-side operand having delayed operations
template<typename T1 , typename op_type >
const MatMat::operator/= (const Op< T1, op_type > &X)
 in-place matrix element-wise division, with the right-hand-side operand having delayed operations
template<typename T1 , typename T2 , typename glue_type >
 Mat::Mat (const Glue< T1, T2, glue_type > &X)
 create a matrix from Glue, i.e. run the previously delayed binary operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator= (const Glue< T1, T2, glue_type > &X)
 create a matrix from Glue, i.e. run the previously delayed binary operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator+= (const Glue< T1, T2, glue_type > &X)
 in-place matrix addition, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator-= (const Glue< T1, T2, glue_type > &X)
 in-place matrix subtraction, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator*= (const Glue< T1, T2, glue_type > &X)
 in-place matrix multiplications, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator%= (const Glue< T1, T2, glue_type > &X)
 in-place matrix element-wise multiplication, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator/= (const Glue< T1, T2, glue_type > &X)
 in-place matrix element-wise division, with the right-hand-side operands having delayed operations
arma_inline eT & Mat::operator() (const u32 i)
 linear element accessor (treats the matrix as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
arma_inline eT Mat::operator() (const u32 i) const
 linear element accessor (treats the matrix as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
arma_inline eT & Mat::operator[] (const u32 i)
 linear element accessor (treats the matrix as a vector); no bounds check.
arma_inline eT Mat::operator[] (const u32 i) const
 linear element accessor (treats the matrix as a vector); no bounds check
arma_inline eT & Mat::operator() (const u32 in_row, const u32 in_col)
 element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
arma_inline eT Mat::operator() (const u32 in_row, const u32 in_col) const
 element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
arma_inline eT & Mat::at (const u32 in_row, const u32 in_col)
 element accessor; no bounds check
arma_inline eT Mat::at (const u32 in_row, const u32 in_col) const
 element accessor; no bounds check
arma_inline const MatMat::operator++ ()
 prefix ++
arma_inline void Mat::operator++ (int)
 postfix ++ (must not return the object by reference)
arma_inline const MatMat::operator-- ()
 prefix --
arma_inline void Mat::operator-- (int)
 postfix -- (must not return the object by reference)
arma_inline bool Mat::is_vec () const
 returns true if the object can be interpreted as a column or row vector
arma_inline bool Mat::is_square () const
 returns true if the object has the same number of non-zero rows and columnns
arma_inline bool Mat::is_finite () const
 returns true if all of the elements are finite
arma_inline eT * Mat::colptr (const u32 in_col)
 returns a pointer to array of eTs for a specified column; no bounds check
arma_inline const eT * Mat::colptr (const u32 in_col) const
 returns a pointer to array of eTs for a specified column; no bounds check
arma_inline eT * Mat::memptr ()
 returns a pointer to array of eTs used by the matrix
arma_inline const eT * Mat::memptr () const
 returns a pointer to array of eTs used by the matrix
void Mat::print (const std::string extra_text="") const
 print contents of the matrix (to the cout stream), optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.
void Mat::print (std::ostream &user_stream, const std::string extra_text="") const
 print contents of the matrix to a user specified stream, optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.
void Mat::raw_print (const std::string extra_text="") const
 print contents of the matrix (to the cout stream), optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified (i.e. the precision and cell width are not modified).
void Mat::raw_print (std::ostream &user_stream, const std::string extra_text="") const
 print contents of the matrix to a user specified stream, optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified. (i.e. the precision and cell width are not modified).
void Mat::fill (const eT val)
 fill the matrix with the specified value
void Mat::zeros ()
void Mat::zeros (const u32 in_rows, const u32 in_cols)
void Mat::reset ()
void Mat::save (const std::string name, const file_type type=arma_binary) const
 save the matrix to a file
void Mat::load (const std::string name, const file_type type=auto_detect)
 load a matrix from a file
template<typename eT >
static arma_inline void Mat_aux::prefix_pp (Mat< eT > &x)
 prefix ++
template<typename T >
static arma_inline void Mat_aux::prefix_pp (Mat< std::complex< T > > &x)
 prefix ++ for complex numbers (work around for limitations of the std::complex class)
template<typename eT >
static arma_inline void Mat_aux::postfix_pp (Mat< eT > &x)
 postfix ++
template<typename T >
static arma_inline void Mat_aux::postfix_pp (Mat< std::complex< T > > &x)
 postfix ++ for complex numbers (work around for limitations of the std::complex class)
template<typename eT >
static arma_inline void Mat_aux::prefix_mm (Mat< eT > &x)
 prefix --
template<typename T >
static arma_inline void Mat_aux::prefix_mm (Mat< std::complex< T > > &x)
 prefix -- for complex numbers (work around for limitations of the std::complex class)
template<typename eT >
static arma_inline void Mat_aux::postfix_mm (Mat< eT > &x)
 postfix --
template<typename T >
static arma_inline void Mat_aux::postfix_mm (Mat< std::complex< T > > &x)
 postfix ++ for complex numbers (work around for limitations of the std::complex class)

Function Documentation

template<typename eT >
Mat< eT >::~Mat (  )  [inline, inherited]

Definition at line 22 of file Mat_meat.hpp.

References arma_config::debug, Mat< eT >::mem, Mat< eT >::mem_local, Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and access::rw().

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

template<typename eT >
Mat< eT >::Mat (  )  [inline, inherited]

Definition at line 47 of file Mat_meat.hpp.

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

template<typename eT >
Mat< eT >::Mat ( const u32  in_rows,
const u32  in_cols 
) [inline, inherited]

construct the matrix to have user specified dimensions

Definition at line 61 of file Mat_meat.hpp.

References Mat< eT >::init().

00062   : n_rows(0)
00063   , n_cols(0)
00064   , n_elem(0)
00065   //, mem(0)
00066   , mem(mem)
00067   {
00068   arma_extra_debug_sigprint_this(this);
00069   
00070   init(in_n_rows, in_n_cols);
00071   }

template<typename eT >
void Mat< eT >::set_size ( const u32  in_rows,
const u32  in_cols 
) [inline, inherited]

change the matrix to have user specified dimensions (data is not preserved)

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 79 of file Mat_meat.hpp.

References Mat< eT >::init().

Referenced by op_var::apply(), op_atanh::apply(), op_tanh::apply(), op_atan::apply(), op_tan::apply(), op_asinh::apply(), op_sinh::apply(), op_asin::apply(), op_sin::apply(), op_acosh::apply(), op_cosh::apply(), op_acos::apply(), op_cos::apply(), op_trans::apply(), op_sum::apply(), op_stddev::apply(), op_sort::apply(), op_scalar_div_post::apply(), op_scalar_div_pre::apply(), op_scalar_times::apply(), op_scalar_minus_post::apply(), op_scalar_minus_pre::apply(), op_scalar_plus::apply(), op_randn::apply(), op_rand::apply(), op_ones_full::apply(), op_neg::apply(), op_conj::apply(), op_pow_s32::apply(), op_pow::apply(), op_square::apply(), op_sqrt::apply(), op_trunc_exp::apply(), op_exp::apply(), op_log10::apply(), op_trunc_log::apply(), op_log::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::apply(), op_diagmat::apply(), glue_times_vec::apply(), glue_times_diag::apply(), glue_times::apply(), glue_schur::apply(), glue_plus_diag::apply(), glue_plus::apply(), glue_minus_diag::apply(), glue_minus::apply(), glue_div::apply(), glue_plus::apply_mixed(), op_trans::apply_noalias(), glue_times::apply_noalias(), eig_gen(), auxlib::eig_gen(), subview< eT >::extract(), diagview< eT >::extract(), Mat< eT >::init(), auxlib::inv_noalias(), linspace(), diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_field_ppm_binary(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), auxlib::lu(), auxlib::qr(), reshape(), auxlib::solve_od(), auxlib::solve_ud(), auxlib::svd(), and Mat< eT >::zeros().

00080   {
00081   arma_extra_debug_sigprint(arma_boost::format("in_n_rows = %d, in_n_cols = %d") % in_n_rows % in_n_cols);
00082   
00083   init(in_n_rows,in_n_cols);
00084   }

template<typename eT >
void Mat< eT >::init ( const u32  in_rows,
const u32  in_cols 
) [inline, protected, inherited]

internal matrix construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new'

Definition at line 91 of file Mat_meat.hpp.

References arma_check(), Mat< eT >::mem, Mat< eT >::mem_local, Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and access::rw().

Referenced by Mat< eT >::init(), Mat< eT >::Mat(), Mat< eT >::operator=(), Mat< eT >::reset(), and Mat< eT >::set_size().

00092   {
00093   arma_extra_debug_sigprint( arma_boost::format("in_n_rows = %d, in_n_cols = %d") % in_n_rows % in_n_cols );
00094   
00095   
00096   const u32 new_n_elem = in_n_rows * in_n_cols;
00097 
00098   if(n_elem == new_n_elem)
00099     {
00100     access::rw(n_rows) = in_n_rows;
00101     access::rw(n_cols) = in_n_cols;
00102     }
00103   else
00104     {
00105     
00106     if(n_elem > sizeof(mem_local)/sizeof(eT) )
00107       {
00108       delete [] mem;
00109       }
00110     
00111     if(new_n_elem <= sizeof(mem_local)/sizeof(eT) )
00112       {
00113       access::rw(mem) = mem_local;
00114       }
00115     else
00116       {
00117       access::rw(mem) = new(std::nothrow) eT[new_n_elem];
00118       arma_check( (mem == 0), "Mat::init(): out of memory" );
00119       }
00120     
00121     access::rw(n_elem) = new_n_elem;
00122 
00123     if(new_n_elem == 0)
00124       {
00125       access::rw(n_rows) = 0;
00126       access::rw(n_cols) = 0;
00127       }
00128     else
00129       {
00130       access::rw(n_rows) = in_n_rows;
00131       access::rw(n_cols) = in_n_cols;
00132       }
00133     
00134     }
00135   
00136   }

template<typename eT >
Mat< eT >::Mat ( const char *  text  )  [inline, inherited]

create the matrix from a textual description

Definition at line 142 of file Mat_meat.hpp.

References Mat< eT >::init().

00143   : n_rows(0)
00144   , n_cols(0)
00145   , n_elem(0)
00146   //, mem(0)
00147   , mem(mem)
00148   {
00149   arma_extra_debug_sigprint_this(this);
00150   
00151   init( std::string(text) );
00152   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator= ( const char *  text  )  [inline, inherited]

create the matrix from a textual description

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 160 of file Mat_meat.hpp.

References Mat< eT >::init().

Referenced by Mat< eT >::Mat().

00161   {
00162   arma_extra_debug_sigprint();
00163   
00164   init( std::string(text) );
00165   return *this;
00166   }

template<typename eT >
Mat< eT >::Mat ( const std::string &  text  )  [inline, inherited]

create the matrix from a textual description

Definition at line 173 of file Mat_meat.hpp.

References Mat< eT >::init().

00174   : n_rows(0)
00175   , n_cols(0)
00176   , n_elem(0)
00177   //, mem(0)
00178   , mem(mem)
00179   {
00180   arma_extra_debug_sigprint_this(this);
00181   
00182   init(text);
00183   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator= ( const std::string &  text  )  [inline, inherited]

create the matrix from a textual description

Definition at line 191 of file Mat_meat.hpp.

References Mat< eT >::init().

00192   {
00193   arma_extra_debug_sigprint();
00194   
00195   init(text);
00196   return *this;
00197   }

template<typename eT >
void Mat< eT >::init ( const std::string &  text  )  [inline, protected, inherited]

internal function to create the matrix from a textual description

Definition at line 205 of file Mat_meat.hpp.

References arma_check(), Mat< eT >::at(), Mat< eT >::col(), Mat< eT >::row(), and Mat< eT >::set_size().

00206   {
00207   arma_extra_debug_sigprint();
00208   
00209   //
00210   // work out the size
00211   
00212   u32 t_n_rows = 0;
00213   u32 t_n_cols = 0;
00214   
00215   bool t_n_cols_found = false;
00216   
00217   std::string token;
00218   
00219   std::string::size_type line_start = 0;
00220   std::string::size_type   line_end = 0;
00221   
00222   while( line_start < text.length() )
00223     {
00224     
00225     line_end = text.find(';', line_start);
00226     
00227     if(line_end == std::string::npos)
00228       line_end = text.length()-1;
00229     
00230     std::string::size_type line_len = line_end - line_start + 1;
00231     std::stringstream line_stream( text.substr(line_start,line_len) );
00232     
00233     
00234     u32 line_n_cols = 0;
00235     while(line_stream >> token)
00236       {
00237       ++line_n_cols;
00238       }
00239     
00240     
00241     if(line_n_cols > 0)
00242       {
00243       if(t_n_cols_found == false)
00244         {
00245         t_n_cols = line_n_cols;
00246         t_n_cols_found = true;
00247         }
00248       else
00249         arma_check( (line_n_cols != t_n_cols), "Mat::init(): inconsistent number of columns in given string");
00250       
00251       ++t_n_rows;
00252       }
00253     line_start = line_end+1;
00254     
00255     }
00256     
00257   Mat<eT> &x = *this;
00258   x.set_size(t_n_rows, t_n_cols);
00259   
00260   line_start = 0;
00261   line_end = 0;
00262   
00263   u32 row = 0;
00264   
00265   while( line_start < text.length() )
00266     {
00267     
00268     line_end = text.find(';', line_start);
00269     
00270     if(line_end == std::string::npos)
00271       line_end = text.length()-1;
00272     
00273     std::string::size_type line_len = line_end - line_start + 1;
00274     std::stringstream line_stream( text.substr(line_start,line_len) );
00275     
00276 //     u32 col = 0;
00277 //     while(line_stream >> token)
00278 //       {
00279 //       x.at(row,col) = strtod(token.c_str(), 0);
00280 //       ++col;
00281 //       }
00282     
00283     u32 col = 0;
00284     eT val;
00285     while(line_stream >> val)
00286       {
00287       x.at(row,col) = val;
00288       ++col;
00289       }
00290     
00291     ++row;
00292     line_start = line_end+1;
00293     }
00294   
00295   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator= ( const eT  val  )  [inline, inherited]

Set the matrix to be equal to the specified scalar. NOTE: the size of the matrix will be 1x1.

Definition at line 304 of file Mat_meat.hpp.

References Mat< eT >::init(), Mat< eT >::mem, and access::rw().

00305   {
00306   arma_extra_debug_sigprint();
00307   
00308   init(1,1);
00309   access::rw(mem[0]) = val;
00310   return *this;
00311   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator+= ( const eT  val  )  [inline, inherited]

In-place addition of a scalar to all elements of the matrix.

Definition at line 319 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

00320   {
00321   arma_extra_debug_sigprint();
00322   
00323   for(u32 i=0; i<n_elem; ++i)
00324     {
00325     access::rw(mem[i]) += val;
00326     }
00327   
00328   return *this;
00329   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator-= ( const eT  val  )  [inline, inherited]

In-place subtraction of a scalar from all elements of the matrix.

Definition at line 337 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

00338   {
00339   arma_extra_debug_sigprint();
00340   
00341   for(u32 i=0; i<n_elem; ++i)
00342     {
00343     access::rw(mem[i]) -= val;
00344     }
00345       
00346   return *this;
00347   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator*= ( const eT  val  )  [inline, inherited]

In-place multiplication of all elements of the matrix with a scalar.

Definition at line 355 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

00356   {
00357   arma_extra_debug_sigprint();
00358   
00359   for(u32 i=0; i<n_elem; ++i)
00360     {
00361     access::rw(mem[i]) *= val;
00362     }
00363   
00364   return *this;
00365   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator/= ( const eT  val  )  [inline, inherited]

In-place division of all elements of the matrix with a scalar.

Definition at line 373 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

00374   {
00375   arma_extra_debug_sigprint();
00376   
00377   for(u32 i=0; i<n_elem; ++i)
00378     {
00379     access::rw(mem[i]) /= val;
00380     }
00381   
00382   return *this;
00383   }

template<typename eT >
Mat< eT >::Mat ( const Mat< eT > &  m  )  [inline, inherited]

construct a matrix from a given matrix

Definition at line 390 of file Mat_meat.hpp.

References Mat< eT >::init().

00391   : n_rows(0)
00392   , n_cols(0)
00393   , n_elem(0)
00394   //, mem(0)
00395   , mem(mem)
00396   {
00397   arma_extra_debug_sigprint(arma_boost::format("this = %x   in_mat = %x") % this % &in_mat);
00398   
00399   init(in_mat);
00400   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator= ( const Mat< eT > &  m  )  [inline, inherited]

construct a matrix from a given matrix

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 408 of file Mat_meat.hpp.

References Mat< eT >::init().

00409   {
00410   arma_extra_debug_sigprint();
00411   
00412   init(x);
00413   return *this;
00414   }

template<typename eT >
void Mat< eT >::init ( const Mat< eT > &  x  )  [inline, protected, inherited]

construct a matrix from a given matrix

Definition at line 422 of file Mat_meat.hpp.

References syslib::copy_elem(), Mat< eT >::init(), Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

00423   {
00424   arma_extra_debug_sigprint();
00425   
00426   if(this != &x)
00427     {
00428     init(x.n_rows, x.n_cols);
00429     syslib::copy_elem( memptr(), x.mem, n_elem );
00430     }
00431   }

template<typename eT >
Mat< eT >::Mat ( const eT *  aux_mem,
const u32  aux_n_rows,
const u32  aux_n_cols 
) [inline, inherited]

construct a matrix from a given auxillary array of eTs

Definition at line 438 of file Mat_meat.hpp.

References syslib::copy_elem(), Mat< eT >::init(), Mat< eT >::memptr(), and Mat< eT >::n_elem.

00439   : n_rows(0)
00440   , n_cols(0)
00441   , n_elem(0)
00442   //, mem(0)
00443   , mem(mem)
00444   {
00445   arma_extra_debug_sigprint_this(this);
00446   
00447   init(aux_n_rows, aux_n_cols);
00448   syslib::copy_elem( memptr(), aux_mem, n_elem );
00449   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator+= ( const Mat< eT > &  m  )  [inline, inherited]

in-place matrix addition

Definition at line 457 of file Mat_meat.hpp.

References glue_plus::apply_inplace().

00458   {
00459   arma_extra_debug_sigprint();
00460   
00461   glue_plus::apply_inplace(*this, m);
00462   return *this;
00463   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator-= ( const Mat< eT > &  m  )  [inline, inherited]

in-place matrix subtraction

Definition at line 471 of file Mat_meat.hpp.

References glue_minus::apply_inplace().

00472   {
00473   arma_extra_debug_sigprint();
00474   
00475   glue_minus::apply_inplace(*this, m);
00476   return *this;
00477   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator*= ( const Mat< eT > &  m  )  [inline, inherited]

in-place matrix multiplication

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 485 of file Mat_meat.hpp.

References glue_times::apply_inplace().

00486   {
00487   arma_extra_debug_sigprint();
00488   
00489   glue_times::apply_inplace(*this, m);
00490   return *this;
00491   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator%= ( const Mat< eT > &  m  )  [inline, inherited]

in-place element-wise matrix multiplication

Definition at line 499 of file Mat_meat.hpp.

References glue_schur::apply_inplace().

00500   {
00501   arma_extra_debug_sigprint();
00502   
00503   glue_schur::apply_inplace(*this, m);
00504   return *this;
00505   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator/= ( const Mat< eT > &  m  )  [inline, inherited]

in-place element-wise matrix division

Definition at line 513 of file Mat_meat.hpp.

References glue_div::apply_inplace().

00514   {
00515   arma_extra_debug_sigprint();
00516   
00517   glue_div::apply_inplace(*this, m);
00518   return *this;
00519   }

template<typename eT >
template<typename T1 , typename T2 >
Mat< eT >::Mat ( const Base< typename Mat< eT >::pod_type, T1 > &  A,
const Base< typename Mat< eT >::pod_type, T2 > &  B 
) [inline, inherited]

for constructing a complex matrix out of two non-complex matrices

< compile-time abort if eT isn't std::complex

< compile-time abort if T is std::complex

< compile-time abort if types are not compatible

Definition at line 528 of file Mat_meat.hpp.

References arma_assert_same_size(), Mat< eT >::mem, Mat< eT >::n_cols, and access::rw().

00532   : n_rows(0)
00533   , n_cols(0)
00534   , n_elem(0)
00535   //, mem(0)
00536   , mem(mem)
00537   {
00538   arma_extra_debug_sigprint_this(this);
00539   
00540   arma_type_check< is_complex<eT>::value == false >::apply();   //!< compile-time abort if eT isn't std::complex
00541   
00542   typedef typename T1::elem_type T;
00543   arma_type_check< is_complex<T>::value == true >::apply();   //!< compile-time abort if T is std::complex
00544   
00545   isnt_same_type<std::complex<T>, eT>::check();   //!< compile-time abort if types are not compatible
00546   
00547   const unwrap<T1> tmp_A(A.get_ref());
00548   const unwrap<T2> tmp_B(B.get_ref());
00549   
00550   const Mat<T>& X = tmp_A.M;
00551   const Mat<T>& Y = tmp_B.M;
00552   
00553   arma_assert_same_size(X, Y, "Mat()");
00554   
00555   init(X.n_rows, Y.n_cols);
00556   
00557   const T* X_mem = X.mem;
00558   const T* Y_mem = Y.mem;
00559   
00560   for(u32 i=0; i<n_elem; ++i)
00561     {
00562     access::rw(mem[i]) = std::complex<T>(X_mem[i], Y_mem[i]);
00563     }
00564   }

template<typename eT >
Mat< eT >::Mat ( const subview< eT > &  X  )  [inline, inherited]

construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation)

Definition at line 571 of file Mat_meat.hpp.

References Mat< eT >::operator=().

00572   : n_rows(0)
00573   , n_cols(0)
00574   , n_elem(0)
00575   //, mem(0)
00576   , mem(mem)
00577   {
00578   arma_extra_debug_sigprint_this(this);
00579   
00580   this->operator=(X);
00581   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator= ( const subview< eT > &  X  )  [inline, inherited]

construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation)

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 589 of file Mat_meat.hpp.

00590   {
00591   arma_extra_debug_sigprint();
00592   
00593   subview<eT>::extract(*this, X);
00594   return *this;
00595   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator+= ( const subview< eT > &  X  )  [inline, inherited]

in-place matrix addition (using a submatrix on the right-hand-side)

Definition at line 602 of file Mat_meat.hpp.

00603   {
00604   arma_extra_debug_sigprint();
00605   
00606   subview<eT>::plus_inplace(*this, X);
00607   return *this;
00608   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator-= ( const subview< eT > &  X  )  [inline, inherited]

in-place matrix subtraction (using a submatrix on the right-hand-side)

Definition at line 615 of file Mat_meat.hpp.

00616   {
00617   arma_extra_debug_sigprint();
00618   
00619   subview<eT>::minus_inplace(*this, X);
00620   return *this;
00621   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator*= ( const subview< eT > &  X  )  [inline, inherited]

in-place matrix mutiplication (using a submatrix on the right-hand-side)

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 629 of file Mat_meat.hpp.

00630   {
00631   arma_extra_debug_sigprint();
00632   
00633   subview<eT>::times_inplace(*this, X);
00634   return *this;
00635   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator%= ( const subview< eT > &  X  )  [inline, inherited]

in-place element-wise matrix mutiplication (using a submatrix on the right-hand-side)

Definition at line 643 of file Mat_meat.hpp.

00644   {
00645   arma_extra_debug_sigprint();
00646   
00647   subview<eT>::schur_inplace(*this, X);
00648   return *this;
00649   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator/= ( const subview< eT > &  X  )  [inline, inherited]

in-place element-wise matrix division (using a submatrix on the right-hand-side)

Definition at line 657 of file Mat_meat.hpp.

00658   {
00659   arma_extra_debug_sigprint();
00660   
00661   subview<eT>::div_inplace(*this, X);
00662   return *this;
00663   }

template<typename eT >
Mat< eT >::Mat ( const diagview< eT > &  X  )  [inline, inherited]

construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation)

Definition at line 670 of file Mat_meat.hpp.

References Mat< eT >::operator=().

00671   : n_rows(0)
00672   , n_cols(0)
00673   , n_elem(0)
00674   //, mem(0)
00675   , mem(mem)
00676   {
00677   arma_extra_debug_sigprint_this(this);
00678   
00679   this->operator=(X);
00680   }

template<typename eT >
const Mat< eT > & Mat< eT >::operator= ( const diagview< eT > &  X  )  [inline, inherited]

construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation)

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 688 of file Mat_meat.hpp.

00689   {
00690   arma_extra_debug_sigprint();
00691   
00692   diagview<eT>::extract(*this, X);
00693   return *this;
00694   }

template<typename eT >
arma_inline subview_row< eT > Mat< eT >::row ( const u32  row_num  )  [inline, inherited]

creation of subview (row vector)

Definition at line 702 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

Referenced by Mat< eT >::init(), diskio::load_arma_ascii(), diskio::load_field_ppm_binary(), diskio::load_field_std_string(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), diskio::save_arma_ascii(), diskio::save_field_ppm_binary(), diskio::save_field_std_string(), diskio::save_pgm_binary(), diskio::save_raw_ascii(), and Mat< eT >::swap_cols().

00703   {
00704   arma_extra_debug_sigprint();
00705   
00706   arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" );
00707   
00708   return subview_row<eT>(*this, row_num);
00709   }

template<typename eT >
arma_inline const subview_row< eT > Mat< eT >::row ( const u32  row_num  )  const [inline, inherited]

creation of subview (row vector)

Definition at line 717 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

00718   {
00719   arma_extra_debug_sigprint();
00720   
00721   arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" );
00722   
00723   return subview_row<eT>(*this, row_num);
00724   }

template<typename eT >
arma_inline subview_col< eT > Mat< eT >::col ( const u32  col_num  )  [inline, inherited]

creation of subview (column vector)

Definition at line 732 of file Mat_meat.hpp.

References Mat< eT >::n_cols.

Referenced by Mat< eT >::init(), diskio::load_arma_ascii(), diskio::load_field_ppm_binary(), diskio::load_field_std_string(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), diskio::save_arma_ascii(), diskio::save_field_ppm_binary(), diskio::save_field_std_string(), diskio::save_pgm_binary(), diskio::save_raw_ascii(), and Mat< eT >::swap_rows().

00733   {
00734   arma_extra_debug_sigprint();
00735   
00736   arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds");
00737   
00738   return subview_col<eT>(*this, col_num);
00739   }

template<typename eT >
arma_inline const subview_col< eT > Mat< eT >::col ( const u32  col_num  )  const [inline, inherited]

creation of subview (column vector)

Definition at line 747 of file Mat_meat.hpp.

References Mat< eT >::n_cols.

00748   {
00749   arma_extra_debug_sigprint();
00750   
00751   arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds");
00752   
00753   return subview_col<eT>(*this, col_num);
00754   }

template<typename eT >
arma_inline subview< eT > Mat< eT >::rows ( const u32  in_row1,
const u32  in_row2 
) [inline, inherited]

creation of subview (submatrix comprised of specified row vectors)

Definition at line 762 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00763   {
00764   arma_extra_debug_sigprint();
00765   
00766   arma_debug_check
00767     (
00768     (in_row1 > in_row2) || (in_row2 >= n_rows),
00769     "Mat::rows(): indices out of bounds or incorrectly used"
00770     );
00771   
00772   return subview<eT>(*this, in_row1, 0, in_row2, n_cols-1);
00773   }

template<typename eT >
arma_inline const subview< eT > Mat< eT >::rows ( const u32  in_row1,
const u32  in_row2 
) const [inline, inherited]

creation of subview (submatrix comprised of specified row vectors)

Definition at line 781 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00782   {
00783   arma_extra_debug_sigprint();
00784   
00785   arma_debug_check
00786     (
00787     (in_row1 > in_row2) || (in_row2 >= n_rows),
00788     "Mat::rows(): indices out of bounds or incorrectly used"
00789     );
00790   
00791   return subview<eT>(*this, in_row1, 0, in_row2, n_cols-1);
00792   }

template<typename eT >
arma_inline subview< eT > Mat< eT >::cols ( const u32  in_col1,
const u32  in_col2 
) [inline, inherited]

creation of subview (submatrix comprised of specified column vectors)

Definition at line 800 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00801   {
00802   arma_extra_debug_sigprint();
00803   
00804   arma_debug_check
00805     (
00806     (in_col1 > in_col2) || (in_col2 >= n_cols),
00807     "Mat::cols(): indices out of bounds or incorrectly used"
00808     );
00809   
00810   return subview<eT>(*this, 0, in_col1, n_rows-1, in_col2);
00811   }

template<typename eT >
arma_inline const subview< eT > Mat< eT >::cols ( const u32  in_col1,
const u32  in_col2 
) const [inline, inherited]

creation of subview (submatrix comprised of specified column vectors)

Definition at line 819 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00820   {
00821   arma_extra_debug_sigprint();
00822   
00823   arma_debug_check
00824     (
00825     (in_col1 > in_col2) || (in_col2 >= n_cols),
00826     "Mat::cols(): indices out of bounds or incorrectly used"
00827     );
00828   
00829   return subview<eT>(*this, 0, in_col1, n_rows-1, in_col2);
00830   }

template<typename eT >
arma_inline subview< eT > Mat< eT >::submat ( const u32  in_row1,
const u32  in_col1,
const u32  in_row2,
const u32  in_col2 
) [inline, inherited]

creation of subview (submatrix)

Definition at line 838 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00839   {
00840   arma_extra_debug_sigprint();
00841   
00842   arma_debug_check
00843     (
00844     (in_row1 > in_row2) || (in_col1 >  in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
00845     "Mat::submat(): indices out of bounds or incorrectly used"
00846     );
00847   
00848   return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2);
00849   }

template<typename eT >
arma_inline const subview< eT > Mat< eT >::submat ( const u32  in_row1,
const u32  in_col1,
const u32  in_row2,
const u32  in_col2 
) const [inline, inherited]

creation of subview (generic submatrix)

Definition at line 857 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

00858   {
00859   arma_extra_debug_sigprint();
00860   
00861   arma_debug_check
00862     (
00863     (in_row1 > in_row2) || (in_col1 >  in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
00864     "Mat::submat(): indices out of bounds or incorrectly used"
00865     );
00866     
00867   return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2);
00868   }

template<typename eT >
arma_inline diagview< eT > Mat< eT >::diag ( const s32  in_id = 0  )  [inline, inherited]

creation of diagview (diagonal)

Definition at line 876 of file Mat_meat.hpp.

References min(), Mat< eT >::n_cols, and Mat< eT >::n_rows.

00877   {
00878   arma_extra_debug_sigprint();
00879   
00880   const u32 row_offset = (in_id < 0) ? -in_id : 0;
00881   const u32 col_offset = (in_id > 0) ?  in_id : 0;
00882   
00883   arma_debug_check
00884     (
00885     (row_offset >= n_rows) || (col_offset >= n_cols),
00886     "Mat::diag(): out of bounds"
00887     );
00888   
00889   const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset);
00890   
00891   return diagview<eT>(*this, row_offset, col_offset, len);
00892   }

template<typename eT >
arma_inline const diagview< eT > Mat< eT >::diag ( const s32  in_id = 0  )  const [inline, inherited]

creation of diagview (diagonal)

Definition at line 900 of file Mat_meat.hpp.

References min(), Mat< eT >::n_cols, and Mat< eT >::n_rows.

00901   {
00902   arma_extra_debug_sigprint();
00903   
00904   const u32 row_offset = (in_id < 0) ? -in_id : 0;
00905   const u32 col_offset = (in_id > 0) ?  in_id : 0;
00906   
00907   arma_debug_check
00908     (
00909     (row_offset >= n_rows) || (col_offset >= n_cols),
00910     "Mat::diag(): out of bounds"
00911     );
00912   
00913   
00914   const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset);
00915   
00916   return diagview<eT>(*this, row_offset, col_offset, len);
00917   }

template<typename eT >
void Mat< eT >::swap_rows ( const u32  in_row1,
const u32  in_row2 
) [inline, inherited]

Definition at line 924 of file Mat_meat.hpp.

References Mat< eT >::col(), Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_rows, and access::rw().

Referenced by auxlib::lu().

00925   {
00926   arma_extra_debug_sigprint();
00927   
00928   arma_debug_check
00929     (
00930     (in_row1 >= n_rows) || (in_row2 >= n_rows),
00931     "Mat::swap_rows(): out of bounds"
00932     );
00933   
00934   for(u32 col=0; col<n_cols; ++col)
00935     {
00936     const u32 offset = col*n_rows;
00937     const u32 pos1   = in_row1 + offset;
00938     const u32 pos2   = in_row2 + offset;
00939     
00940     const eT tmp          = mem[pos1];
00941     access::rw(mem[pos1]) = mem[pos2];
00942     access::rw(mem[pos2]) = tmp;
00943     }
00944   
00945   }

template<typename eT >
void Mat< eT >::swap_cols ( const u32  in_col1,
const u32  in_col2 
) [inline, inherited]

Definition at line 952 of file Mat_meat.hpp.

References Mat< eT >::colptr(), Mat< eT >::n_cols, Mat< eT >::n_rows, and Mat< eT >::row().

00953   {
00954   arma_extra_debug_sigprint();
00955   
00956   arma_debug_check
00957     (
00958     (in_col1 >= n_cols) || (in_col2 >= n_cols),
00959     "Mat::swap_cols(): out of bounds"
00960     );
00961   
00962   eT* ptr1 = colptr(in_col1);
00963   eT* ptr2 = colptr(in_col2);
00964   
00965   for(u32 row=0; row<n_rows; ++row)
00966     {
00967     const eT tmp = ptr1[row];
00968     ptr1[row]    = ptr2[row];
00969     ptr2[row]    = tmp;
00970     }
00971   
00972   }

template<typename eT >
template<typename T1 , typename op_type >
Mat< eT >::Mat ( const Op< T1, op_type > &  X  )  [inline, inherited]

create a matrix from Op, i.e. run the previously delayed unary operations

Definition at line 980 of file Mat_meat.hpp.

00981   : n_rows(0)
00982   , n_cols(0)
00983   , n_elem(0)
00984   //, mem(0)
00985   , mem(mem)
00986   {
00987   arma_extra_debug_sigprint_this(this);
00988 
00989   isnt_same_type<eT, typename T1::elem_type>::check();
00990   
00991   op_type::apply(*this, X);
00992   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator= ( const Op< T1, op_type > &  X  )  [inline, inherited]

create a matrix from Op, i.e. run the previously delayed unary operations

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1001 of file Mat_meat.hpp.

01002   {
01003   arma_extra_debug_sigprint();
01004 
01005   isnt_same_type<eT, typename T1::elem_type>::check();
01006   
01007   op_type::apply(*this, X);
01008   
01009   return *this;
01010   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator+= ( const Op< T1, op_type > &  X  )  [inline, inherited]

in-place matrix addition, with the right-hand-side operand having delayed operations

Definition at line 1019 of file Mat_meat.hpp.

References glue_plus::apply_inplace().

01020   {
01021   arma_extra_debug_sigprint();
01022   
01023   isnt_same_type<eT, typename T1::elem_type>::check();
01024   
01025   glue_plus::apply_inplace(*this, X);
01026   
01027   return *this;
01028   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator-= ( const Op< T1, op_type > &  X  )  [inline, inherited]

in-place matrix subtraction, with the right-hand-side operand having delayed operations

Definition at line 1037 of file Mat_meat.hpp.

References glue_minus::apply_inplace().

01038   {
01039   arma_extra_debug_sigprint();
01040   
01041   isnt_same_type<eT, typename T1::elem_type>::check();
01042   
01043   glue_minus::apply_inplace(*this, X);
01044   
01045   return *this;
01046   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator*= ( const Op< T1, op_type > &  X  )  [inline, inherited]

in-place matrix multiplication, with the right-hand-side operand having delayed operations

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1055 of file Mat_meat.hpp.

References glue_times::apply_inplace().

01056   {
01057   arma_extra_debug_sigprint();
01058   
01059   isnt_same_type<eT, typename T1::elem_type>::check();
01060   
01061   glue_times::apply_inplace(*this, X);
01062   
01063   return *this;
01064   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator%= ( const Op< T1, op_type > &  X  )  [inline, inherited]

in-place matrix element-wise multiplication, with the right-hand-side operand having delayed operations

Definition at line 1073 of file Mat_meat.hpp.

References glue_schur::apply_inplace().

01074   {
01075   arma_extra_debug_sigprint();
01076   
01077   isnt_same_type<eT, typename T1::elem_type>::check();
01078   glue_schur::apply_inplace(*this, X);
01079   
01080   return *this;
01081   }

template<typename eT >
template<typename T1 , typename op_type >
const Mat< eT > & Mat< eT >::operator/= ( const Op< T1, op_type > &  X  )  [inline, inherited]

in-place matrix element-wise division, with the right-hand-side operand having delayed operations

Definition at line 1090 of file Mat_meat.hpp.

References glue_div::apply_inplace().

01091   {
01092   arma_extra_debug_sigprint();
01093   
01094   isnt_same_type<eT, typename T1::elem_type>::check();
01095   glue_div::apply_inplace(*this, X);
01096   
01097   return *this;
01098   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
Mat< eT >::Mat ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

create a matrix from Glue, i.e. run the previously delayed binary operations

Definition at line 1106 of file Mat_meat.hpp.

References Mat< eT >::operator=().

01107   : n_rows(0)
01108   , n_cols(0)
01109   , n_elem(0)
01110   //, mem(0)
01111   , mem(mem)
01112   {
01113   arma_extra_debug_sigprint_this(this);
01114   this->operator=(X);
01115   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

create a matrix from Glue, i.e. run the previously delayed binary operations

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1124 of file Mat_meat.hpp.

01125   {
01126   arma_extra_debug_sigprint();
01127   
01128   // TODO:
01129   // it may be simpler to pass the two objects (currently wrapped in X)
01130   // directly to the apply function.
01131   // (many adjustments throughout the source code will be required)
01132   
01133   isnt_same_type<eT, typename T1::elem_type>::check();
01134   isnt_same_type<eT, typename T2::elem_type>::check();
01135   
01136   glue_type::apply(*this, X);
01137   
01138   return *this;
01139   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator+= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

in-place matrix addition, with the right-hand-side operands having delayed operations

Definition at line 1147 of file Mat_meat.hpp.

References glue_plus::apply_inplace().

01148   {
01149   arma_extra_debug_sigprint();
01150   
01151   isnt_same_type<eT, typename T1::elem_type>::check();
01152   isnt_same_type<eT, typename T2::elem_type>::check();
01153   
01154   glue_plus::apply_inplace(*this, X);
01155   
01156   return *this;
01157   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator-= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

in-place matrix subtraction, with the right-hand-side operands having delayed operations

Definition at line 1166 of file Mat_meat.hpp.

References glue_minus::apply_inplace().

01167   {
01168   arma_extra_debug_sigprint();
01169   
01170   isnt_same_type<eT, typename T1::elem_type>::check();
01171   isnt_same_type<eT, typename T2::elem_type>::check();
01172   
01173   glue_minus::apply_inplace(*this, X);
01174   
01175   return *this;
01176   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator*= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

in-place matrix multiplications, with the right-hand-side operands having delayed operations

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1185 of file Mat_meat.hpp.

References glue_times::apply_inplace().

01186   {
01187   arma_extra_debug_sigprint();
01188   
01189   isnt_same_type<eT, typename T1::elem_type>::check();
01190   isnt_same_type<eT, typename T2::elem_type>::check();
01191   
01192   glue_times::apply_inplace(*this, X);
01193   return *this;
01194   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator%= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

in-place matrix element-wise multiplication, with the right-hand-side operands having delayed operations

Definition at line 1203 of file Mat_meat.hpp.

References glue_schur::apply_inplace().

01204   {
01205   arma_extra_debug_sigprint();
01206   
01207   isnt_same_type<eT, typename T1::elem_type>::check();
01208   isnt_same_type<eT, typename T2::elem_type>::check();
01209   
01210   glue_schur::apply_inplace(*this, X);
01211   return *this;
01212   }

template<typename eT >
template<typename T1 , typename T2 , typename glue_type >
const Mat< eT > & Mat< eT >::operator/= ( const Glue< T1, T2, glue_type > &  X  )  [inline, inherited]

in-place matrix element-wise division, with the right-hand-side operands having delayed operations

Definition at line 1221 of file Mat_meat.hpp.

References glue_div::apply_inplace().

01222   {
01223   arma_extra_debug_sigprint();
01224   
01225   isnt_same_type<eT, typename T1::elem_type>::check();
01226   isnt_same_type<eT, typename T2::elem_type>::check();
01227   
01228   glue_div::apply_inplace(*this, X);
01229   return *this;
01230   }

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

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

Definition at line 1238 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

01239   {
01240   arma_debug_check( (i >= n_elem), "Mat::operator(): index out of bounds");
01241   return access::rw(mem[i]);
01242   }

template<typename eT >
arma_inline eT Mat< eT >::operator() ( const u32  i  )  const [inline, inherited]

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

Definition at line 1250 of file Mat_meat.hpp.

References Mat< eT >::mem, and Mat< eT >::n_elem.

01251   {
01252   arma_debug_check( (i >= n_elem), "Mat::operator(): index out of bounds");
01253   return mem[i];
01254   }

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

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

Definition at line 1261 of file Mat_meat.hpp.

References Mat< eT >::mem, and access::rw().

01262   {
01263   return access::rw(mem[i]);
01264   }

template<typename eT >
arma_inline eT Mat< eT >::operator[] ( const u32  i  )  const [inline, inherited]

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

Definition at line 1272 of file Mat_meat.hpp.

References Mat< eT >::mem.

01273   {
01274   return mem[i];
01275   }

template<typename eT >
arma_inline eT & Mat< eT >::operator() ( const u32  in_row,
const u32  in_col 
) [inline, inherited]

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 1283 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_rows, and access::rw().

01284   {
01285   arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds");
01286   return access::rw(mem[in_row + in_col*n_rows]);
01287   }

template<typename eT >
arma_inline eT Mat< eT >::operator() ( const u32  in_row,
const u32  in_col 
) const [inline, inherited]

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 1295 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_cols, and Mat< eT >::n_rows.

01296   {
01297   arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds");
01298   return mem[in_row + in_col*n_rows];
01299   }

template<typename eT >
arma_inline eT & Mat< eT >::at ( const u32  in_row,
const u32  in_col 
) [inline, inherited]

element accessor; no bounds check

Definition at line 1307 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_rows, and access::rw().

Referenced by accu(), op_var::apply(), op_trans::apply(), op_sum::apply(), op_stddev::apply(), op_sort::apply(), op_ones_diag::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::apply(), op_inv::apply(), op_diagmat_vec::apply(), op_diagmat::apply(), glue_times_diag::apply(), glue_times::apply(), glue_schur_diag::apply(), glue_plus_diag::apply(), glue_plus::apply(), glue_minus_diag::apply(), gemv_arma< do_trans_A, use_alpha, use_beta >::apply(), gemm_mixed_simple< do_trans_A, do_trans_B, use_alpha, use_beta >::apply(), gemm_mixed_cache< do_trans_A, do_trans_B, use_alpha, use_beta >::apply(), gemm_emul_simple< do_trans_A, do_trans_B, use_alpha, use_beta >::apply(), gemm_emul_cache< do_trans_A, do_trans_B, use_alpha, use_beta >::apply(), op_inv::apply_diagvec(), glue_times::apply_inplace(), op_trans::apply_noalias(), det(), auxlib::det(), diagmat(), glue_times::direct_rowvec_diagmat_colvec(), glue_times::direct_rowvec_invdiagmat_colvec(), glue_times::direct_rowvec_mat_colvec(), eig_gen(), diagview< eT >::extract(), diagview< eT >::fill(), Mat< eT >::init(), auxlib::inv_inplace(), auxlib::inv_noalias(), diskio::load_arma_ascii(), diskio::load_field_ppm_binary(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), auxlib::lu(), operator*(), operator/(), operator<<(), diagview< eT >::operator=(), arma_ostream::print(), auxlib::qr(), diskio::save_arma_ascii(), diskio::save_field_ppm_binary(), diskio::save_raw_ascii(), trace(), and diagview< eT >::zeros().

01308   {
01309   return access::rw( mem[in_row + in_col*n_rows] );
01310   }

template<typename eT >
arma_inline eT Mat< eT >::at ( const u32  in_row,
const u32  in_col 
) const [inline, inherited]

element accessor; no bounds check

Definition at line 1318 of file Mat_meat.hpp.

References Mat< eT >::mem, and Mat< eT >::n_rows.

01319   {
01320   return mem[in_row + in_col*n_rows];
01321   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator++ (  )  [inline, inherited]

prefix ++

Definition at line 1329 of file Mat_meat.hpp.

References Mat_aux::prefix_pp().

01330   {
01331   Mat_aux::prefix_pp(*this);
01332   return *this;
01333   }

template<typename eT >
arma_inline void Mat< eT >::operator++ ( int   )  [inline, inherited]

postfix ++ (must not return the object by reference)

Definition at line 1341 of file Mat_meat.hpp.

References Mat_aux::postfix_pp().

01342   {
01343   Mat_aux::postfix_pp(*this);
01344   }

template<typename eT >
arma_inline const Mat< eT > & Mat< eT >::operator-- (  )  [inline, inherited]

prefix --

Definition at line 1352 of file Mat_meat.hpp.

References Mat_aux::prefix_mm().

01353   {
01354   Mat_aux::prefix_mm(*this);
01355   return *this;
01356   }

template<typename eT >
arma_inline void Mat< eT >::operator-- ( int   )  [inline, inherited]

postfix -- (must not return the object by reference)

Definition at line 1364 of file Mat_meat.hpp.

References Mat_aux::postfix_mm().

01365   {
01366   Mat_aux::postfix_mm(*this);
01367   }

template<typename eT >
arma_inline bool Mat< eT >::is_vec (  )  const [inline, inherited]

returns true if the object can be interpreted as a column or row vector

Definition at line 1375 of file Mat_meat.hpp.

References Mat< eT >::n_cols, and Mat< eT >::n_rows.

Referenced by accu(), op_inv::apply_diagvec(), det(), operator<<(), and trace().

01376   {
01377   return ( (n_rows == 1) || (n_cols == 1) );
01378   }

template<typename eT >
arma_inline bool Mat< eT >::is_square (  )  const [inline, inherited]

returns true if the object has the same number of non-zero rows and columnns

Definition at line 1386 of file Mat_meat.hpp.

References Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

Referenced by accu(), op_inv::apply(), op_diagmat::apply(), glue_times_diag::apply(), glue_schur_diag::apply(), glue_plus_diag::apply(), glue_minus_diag::apply(), det(), operator<<(), and trace().

01387   {
01388   return ( (n_rows == n_cols) && (n_elem > 0) );
01389   }

template<typename eT >
arma_inline bool Mat< eT >::is_finite (  )  const [inline, inherited]

returns true if all of the elements are finite

Definition at line 1397 of file Mat_meat.hpp.

References arma_isfinite(), Mat< eT >::mem, and Mat< eT >::n_elem.

01398   {
01399   for(u32 i=0; i<n_elem; ++i)
01400     {
01401     if(arma_isfinite(mem[i]) == false)
01402       {
01403       return false;
01404       }
01405     }
01406 
01407   return true;
01408   }

template<typename eT >
arma_inline eT * Mat< eT >::colptr ( const u32  in_col  )  [inline, inherited]

template<typename eT >
arma_inline const eT * Mat< eT >::colptr ( const u32  in_col  )  const [inline, inherited]

returns a pointer to array of eTs for a specified column; no bounds check

Definition at line 1427 of file Mat_meat.hpp.

References Mat< eT >::mem, and Mat< eT >::n_rows.

01428   {
01429   return & mem[in_col*n_rows];
01430   }

template<typename eT >
arma_inline eT * Mat< eT >::memptr (  )  [inline, inherited]

returns a pointer to array of eTs used by the matrix

Definition at line 1438 of file Mat_meat.hpp.

References Mat< eT >::mem.

Referenced by abs(), op_atanh::apply(), op_tanh::apply(), op_atan::apply(), op_tan::apply(), op_asinh::apply(), op_sinh::apply(), op_asin::apply(), op_sin::apply(), op_acosh::apply(), op_cosh::apply(), op_acos::apply(), op_cos::apply(), op_sort::apply(), op_scalar_div_post::apply(), op_scalar_div_pre::apply(), op_scalar_times::apply(), op_scalar_minus_post::apply(), op_scalar_minus_pre::apply(), op_scalar_plus::apply(), op_randn::apply(), op_rand::apply(), op_neg::apply(), op_conj::apply(), op_pow_s32::apply(), op_pow::apply(), op_square::apply(), op_sqrt::apply(), op_trunc_exp::apply(), op_exp::apply(), op_log10::apply(), op_trunc_log::apply(), op_log::apply(), glue_times_vec::apply(), glue_schur::apply(), glue_plus::apply(), glue_minus::apply(), gemm< do_trans_A, do_trans_B, use_alpha, use_beta >::apply_blas_type(), glue_plus::apply_inplace(), glue_minus::apply_inplace(), glue_plus::apply_mixed(), op_trans::apply_noalias(), auxlib::chol(), auxlib::det(), subview< eT >::div_inplace(), auxlib::eig_gen(), auxlib::eig_sym(), diagview< eT >::extract(), conv_to< Col< out_eT > >::from(), conv_to< Row< out_eT > >::from(), conv_to< Mat< out_eT > >::from(), imag(), Mat< eT >::init(), auxlib::inv_inplace(), auxlib::inv_noalias(), diskio::load_arma_binary(), auxlib::lu(), Mat< eT >::Mat(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), subview< eT >::plus_inplace(), Mat_aux::postfix_mm(), Mat_aux::postfix_pp(), Mat_aux::prefix_mm(), Mat_aux::prefix_pp(), auxlib::qr(), real(), reshape(), subview< eT >::schur_inplace(), auxlib::solve(), auxlib::solve_od(), auxlib::solve_ud(), and auxlib::svd().

01439   {
01440   return const_cast<eT*>(mem);
01441   }

template<typename eT >
arma_inline const eT * Mat< eT >::memptr (  )  const [inline, inherited]

returns a pointer to array of eTs used by the matrix

Definition at line 1449 of file Mat_meat.hpp.

References Mat< eT >::mem.

01450   {
01451   return mem;
01452   }

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

print contents of the matrix (to the cout stream), optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.

Definition at line 1463 of file Mat_meat.hpp.

Referenced by Mat< eT >::print(), and Mat< eT >::raw_print().

01464   {
01465   arma_extra_debug_sigprint();
01466   
01467   if(extra_text.length() != 0)
01468     {
01469     cout << extra_text << '\n';
01470     }
01471   
01472   arma_ostream::print(cout, *this, true);
01473   }

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

print contents of the matrix to a user specified stream, optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.

Definition at line 1483 of file Mat_meat.hpp.

References Mat< eT >::print().

01484   {
01485   arma_extra_debug_sigprint();
01486   
01487   if(extra_text.length() != 0)
01488     {
01489     user_stream << extra_text << '\n';
01490     }
01491   
01492   arma_ostream::print(user_stream, *this, true);
01493   }

template<typename eT >
void Mat< eT >::raw_print ( const std::string  extra_text = ""  )  const [inline, inherited]

print contents of the matrix (to the cout stream), optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified (i.e. the precision and cell width are not modified).

Definition at line 1504 of file Mat_meat.hpp.

References Mat< eT >::print().

01505   {
01506   arma_extra_debug_sigprint();
01507   
01508   if(extra_text.length() != 0)
01509     {
01510     cout << extra_text << '\n';
01511     }
01512   
01513   arma_ostream::print(cout, *this, false);
01514   }

template<typename eT >
void Mat< eT >::raw_print ( std::ostream &  user_stream,
const std::string  extra_text = "" 
) const [inline, inherited]

print contents of the matrix to a user specified stream, optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified. (i.e. the precision and cell width are not modified).

Definition at line 1525 of file Mat_meat.hpp.

References Mat< eT >::print().

01526   {
01527   arma_extra_debug_sigprint();
01528   
01529   if(extra_text.length() != 0)
01530     {
01531     user_stream << extra_text << '\n';
01532     }
01533   
01534   arma_ostream::print(user_stream, *this, false);
01535   }

template<typename eT >
void Mat< eT >::fill ( const eT  val  )  [inline, inherited]

fill the matrix with the specified value

Definition at line 1543 of file Mat_meat.hpp.

References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().

Referenced by op_ones_full::apply(), operator*(), operator/(), and Mat< eT >::zeros().

01544   {
01545   arma_extra_debug_sigprint();
01546   
01547   for(u32 i=0; i<n_elem; ++i)
01548     {
01549     access::rw(mem[i]) = val;
01550     }
01551   }

template<typename eT >
void Mat< eT >::zeros (  )  [inline, inherited]

template<typename eT >
void Mat< eT >::zeros ( const u32  in_rows,
const u32  in_cols 
) [inline, inherited]

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1570 of file Mat_meat.hpp.

References Mat< eT >::fill(), and Mat< eT >::set_size().

01571   {
01572   arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d") % in_rows % in_cols );
01573 
01574   set_size(in_rows, in_cols);
01575   fill(eT(0));
01576   }

template<typename eT >
void Mat< eT >::reset (  )  [inline, inherited]

Definition at line 1583 of file Mat_meat.hpp.

References Mat< eT >::init().

Referenced by diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_pgm_binary(), and diskio::load_raw_ascii().

01584   {
01585   arma_extra_debug_sigprint();
01586   
01587   init(0,0);
01588   }

template<typename eT >
void Mat< eT >::save ( const std::string  name,
const file_type  type = arma_binary 
) const [inline, inherited]

save the matrix to a file

Definition at line 1596 of file Mat_meat.hpp.

References arma_ascii, arma_binary, arma_stop(), pgm_binary, raw_ascii, diskio::save_arma_ascii(), diskio::save_arma_binary(), diskio::save_pgm_binary(), and diskio::save_raw_ascii().

01597   {
01598   arma_extra_debug_sigprint();
01599   
01600   switch(type)
01601     {
01602     case raw_ascii:
01603       diskio::save_raw_ascii(*this, name);
01604       break;
01605     
01606     case arma_ascii:
01607       diskio::save_arma_ascii(*this, name);
01608       break;
01609     
01610     case arma_binary:
01611       diskio::save_arma_binary(*this, name);
01612       break;
01613       
01614     case pgm_binary:
01615       diskio::save_pgm_binary(*this, name);
01616       break;
01617     
01618     default:
01619       arma_stop("Mat::save(): unsupported type");
01620     }
01621   
01622   }

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

load a matrix from a file

Reimplemented in Col< eT >, and Row< eT >.

Definition at line 1630 of file Mat_meat.hpp.

References arma_ascii, arma_binary, arma_stop(), auto_detect, diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), pgm_binary, and raw_ascii.

Referenced by diskio::load_pgm_binary().

01631   {
01632   arma_extra_debug_sigprint();
01633   
01634   switch(type)
01635     {
01636     case auto_detect:
01637       diskio::load_auto_detect(*this, name);
01638       break;
01639     
01640     case raw_ascii:
01641       diskio::load_raw_ascii(*this, name);
01642       break;
01643     
01644     case arma_ascii:
01645       diskio::load_arma_ascii(*this, name);
01646       break;
01647     
01648     case arma_binary:
01649       diskio::load_arma_binary(*this, name);
01650       break;
01651       
01652     case pgm_binary:
01653       diskio::load_pgm_binary(*this, name);
01654       break;
01655     
01656     default:
01657       arma_stop("Mat::load(): unsupported type");
01658     }
01659   
01660   }

template<typename eT >
arma_inline void Mat_aux::prefix_pp ( Mat< eT > &  x  )  [inline, static, inherited]

prefix ++

Definition at line 1668 of file Mat_meat.hpp.

References Mat< eT >::memptr(), and Mat< eT >::n_elem.

Referenced by Mat< eT >::operator++().

01669   {
01670         eT* memptr = x.memptr();
01671   const u32 n_elem = x.n_elem;
01672 
01673   for(u32 i=0; i<n_elem; ++i)
01674     {
01675     ++(memptr[i]);
01676     }
01677   }

template<typename T >
arma_inline void Mat_aux::prefix_pp ( Mat< std::complex< T > > &  x  )  [inline, static, inherited]

prefix ++ for complex numbers (work around for limitations of the std::complex class)

Definition at line 1685 of file Mat_meat.hpp.

01686   {
01687   x += T(1);
01688   }

template<typename eT >
arma_inline void Mat_aux::postfix_pp ( Mat< eT > &  x  )  [inline, static, inherited]

postfix ++

Definition at line 1696 of file Mat_meat.hpp.

References Mat< eT >::memptr(), and Mat< eT >::n_elem.

Referenced by Mat< eT >::operator++().

01697   {
01698         eT* memptr = x.memptr();
01699   const u32 n_elem = x.n_elem;
01700 
01701   for(u32 i=0; i<n_elem; ++i)
01702     {
01703     (memptr[i])++;
01704     }
01705   }

template<typename T >
arma_inline void Mat_aux::postfix_pp ( Mat< std::complex< T > > &  x  )  [inline, static, inherited]

postfix ++ for complex numbers (work around for limitations of the std::complex class)

Definition at line 1713 of file Mat_meat.hpp.

01714   {
01715   x += T(1);
01716   }

template<typename eT >
arma_inline void Mat_aux::prefix_mm ( Mat< eT > &  x  )  [inline, static, inherited]

prefix --

Definition at line 1724 of file Mat_meat.hpp.

References Mat< eT >::memptr(), and Mat< eT >::n_elem.

Referenced by Mat< eT >::operator--().

01725   {
01726         eT* memptr = x.memptr();
01727   const u32 n_elem = x.n_elem;
01728 
01729   for(u32 i=0; i<n_elem; ++i)
01730     {
01731     --(memptr[i]);
01732     }
01733   }

template<typename T >
arma_inline void Mat_aux::prefix_mm ( Mat< std::complex< T > > &  x  )  [inline, static, inherited]

prefix -- for complex numbers (work around for limitations of the std::complex class)

Definition at line 1741 of file Mat_meat.hpp.

01742   {
01743   x -= T(1);
01744   }

template<typename eT >
arma_inline void Mat_aux::postfix_mm ( Mat< eT > &  x  )  [inline, static, inherited]

postfix --

Definition at line 1752 of file Mat_meat.hpp.

References Mat< eT >::memptr(), and Mat< eT >::n_elem.

Referenced by Mat< eT >::operator--().

01753   {
01754         eT* memptr = x.memptr();
01755   const u32 n_elem = x.n_elem;
01756 
01757   for(u32 i=0; i<n_elem; ++i)
01758     {
01759     (memptr[i])--;
01760     }
01761   }

template<typename T >
arma_inline void Mat_aux::postfix_mm ( Mat< std::complex< T > > &  x  )  [inline, static, inherited]

postfix ++ for complex numbers (work around for limitations of the std::complex class)

Definition at line 1769 of file Mat_meat.hpp.

01770   {
01771   x -= T(1);
01772   }