Classes | Functions

Mat

//! More...

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::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 (eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const bool copy_aux_mem=true)
 construct a matrix from a given auxiliary array of eTs. //! if copy_aux_mem is true, new memory is allocated and the array is copied. //! if copy_aux_mem is false, the auxiliary array is used directly (without allocating memory and copying). //! the default is to copy the array.
 Mat::Mat (const eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols)
 construct a matrix from a given auxiliary read-only array of eTs. //! the array is copied.
 Mat::Mat (const char junk, const eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols)
 DANGEROUS! Construct a temporary matrix, using auxiliary memory. //! This constructor is NOT intended for usage by user code. //! Its sole purpose is to be used by the Cube class.
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 subview_cube< eT > &X)
 construct a matrix from a subview_cube instance
const MatMat::operator= (const subview_cube< eT > &X)
 construct a matrix from a subview_cube instance
const MatMat::operator+= (const subview_cube< eT > &X)
 in-place matrix addition (using a single-slice subcube on the right-hand-side)
const MatMat::operator-= (const subview_cube< eT > &X)
 in-place matrix subtraction (using a single-slice subcube on the right-hand-side)
const MatMat::operator*= (const subview_cube< eT > &X)
 in-place matrix mutiplication (using a single-slice subcube on the right-hand-side)
const MatMat::operator%= (const subview_cube< eT > &X)
 in-place element-wise matrix mutiplication (using a single-slice subcube on the right-hand-side)
const MatMat::operator/= (const subview_cube< eT > &X)
 in-place element-wise matrix division (using a single-slice subcube 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)
const MatMat::operator+= (const diagview< eT > &X)
 in-place matrix addition (using a diagview on the right-hand-side)
const MatMat::operator-= (const diagview< eT > &X)
 in-place matrix subtraction (using a diagview on the right-hand-side)
const MatMat::operator*= (const diagview< eT > &X)
 in-place matrix mutiplication (using a diagview on the right-hand-side)
const MatMat::operator%= (const diagview< eT > &X)
 in-place element-wise matrix mutiplication (using a diagview on the right-hand-side)
const MatMat::operator/= (const diagview< eT > &X)
 in-place element-wise matrix division (using a diagview on the right-hand-side)
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 eop_type >
 Mat::Mat (const eOp< T1, eop_type > &X)
 create a matrix from eOp, i.e. run the previously delayed unary operations
template<typename T1 , typename eop_type >
const MatMat::operator= (const eOp< T1, eop_type > &X)
 create a matrix from eOp, i.e. run the previously delayed unary operations
template<typename T1 , typename eop_type >
const MatMat::operator+= (const eOp< T1, eop_type > &X)
template<typename T1 , typename eop_type >
const MatMat::operator-= (const eOp< T1, eop_type > &X)
template<typename T1 , typename eop_type >
const MatMat::operator*= (const eOp< T1, eop_type > &X)
template<typename T1 , typename eop_type >
const MatMat::operator%= (const eOp< T1, eop_type > &X)
template<typename T1 , typename eop_type >
const MatMat::operator/= (const eOp< T1, eop_type > &X)
template<typename T1 , typename op_type >
 Mat::Mat (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator+= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator-= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator*= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator%= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
template<typename T1 , typename op_type >
const MatMat::operator/= (const mtOp< eT, T1, op_type > &X)
 EXPERIMENTAL.
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
template<typename T1 , typename T2 >
const MatMat::operator+= (const Glue< T1, T2, glue_times > &X)
template<typename T1 , typename T2 >
const MatMat::operator-= (const Glue< T1, T2, glue_times > &X)
template<typename T1 , typename T2 , typename eglue_type >
 Mat::Mat (const eGlue< T1, T2, eglue_type > &X)
 create a matrix from eGlue, i.e. run the previously delayed binary operations
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator= (const eGlue< T1, T2, eglue_type > &X)
 create a matrix from eGlue, i.e. run the previously delayed binary operations
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator+= (const eGlue< T1, T2, eglue_type > &X)
 in-place matrix addition, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator-= (const eGlue< T1, T2, eglue_type > &X)
 in-place matrix subtraction, with the right-hand-side operands having delayed operations
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator*= (const eGlue< T1, T2, eglue_type > &X)
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator%= (const eGlue< T1, T2, eglue_type > &X)
template<typename T1 , typename T2 , typename eglue_type >
const MatMat::operator/= (const eGlue< T1, T2, eglue_type > &X)
template<typename T1 , typename T2 , typename glue_type >
 Mat::Mat (const mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: create a matrix from mtGlue, i.e. run the previously delayed binary operations.
template<typename T1 , typename T2 , typename glue_type >
const MatMat::operator= (const mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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 mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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 mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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 mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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 mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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 mtGlue< eT, T1, T2, glue_type > &X)
 EXPERIMENTAL: 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::print_trans (const std::string extra_text="") const
 print contents of the transposed version 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_trans (std::ostream &user_stream, const std::string extra_text="") const
 print contents of the transposed version of 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::raw_print_trans (const std::string extra_text="") const
 print contents of the transposed version 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_trans (std::ostream &user_stream, const std::string extra_text="") const
 print contents of the transposed version 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::set_size (const u32 in_rows, const u32 in_cols)
 change the matrix to have user specified dimensions (data is not preserved)
template<typename eT2 >
void Mat::copy_size (const Mat< eT2 > &m)
 change the matrix (without preserving data) to have the same dimensions as the given matrix
arma_hot 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::ones ()
void Mat::ones (const u32 in_rows, const u32 in_cols)
void Mat::reset ()
bool Mat::save (const std::string name, const file_type type=arma_binary, const bool print_status=true) const
 save the matrix to a file
bool Mat::save (std::ostream &os, const file_type type=arma_binary, const bool print_status=true) const
 save the matrix to a stream
bool Mat::load (const std::string name, const file_type type=auto_detect, const bool print_status=true)
 load a matrix from a file
bool Mat::load (std::istream &is, const file_type type=auto_detect, const bool print_status=true)
 load a matrix from a stream
bool Mat::quiet_save (const std::string name, const file_type type=arma_binary) const
 save the matrix to a file, without printing any error messages
bool Mat::quiet_save (std::ostream &os, const file_type type=arma_binary) const
 save the matrix to a stream, without printing any error messages
bool Mat::quiet_load (const std::string name, const file_type type=auto_detect)
 load a matrix from a file, without printing any error messages
bool Mat::quiet_load (std::istream &is, const file_type type=auto_detect)
 load a matrix from a stream, without printing any error messages
 Mat::row_iterator::row_iterator (Mat< eT > &in_M, const u32 in_row)
eT & Mat::row_iterator::operator* ()
row_iterator & Mat::row_iterator::operator++ ()
void Mat::row_iterator::operator++ (int)
row_iterator & Mat::row_iterator::operator-- ()
void Mat::row_iterator::operator-- (int)
 Mat::const_row_iterator::const_row_iterator (const Mat< eT > &in_M, const u32 in_row)
eT Mat::const_row_iterator::operator* () const
const_row_iterator & Mat::const_row_iterator::operator++ ()
void Mat::const_row_iterator::operator++ (int)
const_row_iterator & Mat::const_row_iterator::operator-- ()
void Mat::const_row_iterator::operator-- (int)
iterator Mat::begin ()
const_iterator Mat::begin () const
iterator Mat::end ()
const_iterator Mat::end () const
col_iterator Mat::begin_col (const u32 col_num)
const_col_iterator Mat::begin_col (const u32 col_num) const
col_iterator Mat::end_col (const u32 col_num)
const_col_iterator Mat::end_col (const u32 col_num) const
row_iterator Mat::begin_row (const u32 row_num)
const_row_iterator Mat::begin_row (const u32 row_num) const
row_iterator Mat::end_row (const u32 row_num)
const_row_iterator Mat::end_row (const u32 row_num) const
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)

Detailed Description

//!


Function Documentation

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

Definition at line 23 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, access::rw(), and Mat< eT >::use_aux_mem.

  {
  arma_extra_debug_sigprint_this(this);
  
  if(use_aux_mem == false)
    {
    if(n_elem > sizeof(mem_local)/sizeof(eT) )
      {
      delete [] mem;
      }
    }
    
  if(arma_config::debug == true)
    {
    // try to expose buggy user code that accesses deleted objects
    access::rw(n_rows) = 0;
    access::rw(n_cols) = 0;
    access::rw(n_elem) = 0;
    access::rw(mem)    = 0;
    }
  
  isnt_supported_elem_type<eT>::check();
  }

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

Definition at line 51 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  }

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 66 of file Mat_meat.hpp.

References Mat< eT >::init().

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init(in_n_rows, in_n_cols);
  }

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 85 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, access::rw(), and Mat< eT >::use_aux_mem.

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

  {
  arma_extra_debug_sigprint( arma_boost::format("in_n_rows = %d, in_n_cols = %d") % in_n_rows % in_n_cols );
  
  const u32 new_n_elem = in_n_rows * in_n_cols;

  if(n_elem == new_n_elem)
    {
    access::rw(n_rows) = in_n_rows;
    access::rw(n_cols) = in_n_cols;
    }
  else
    {
    arma_debug_check
      (
      (use_aux_mem == true),
      "Mat::init(): can't change the amount of memory as auxiliary memory is in use"
      );

    if(n_elem > sizeof(mem_local)/sizeof(eT) )
      {
      delete [] mem;
      }
    
    if(new_n_elem <= sizeof(mem_local)/sizeof(eT) )
      {
      access::rw(mem) = mem_local;
      }
    else
      {
      access::rw(mem) = new(std::nothrow) eT[new_n_elem];
      arma_check( (mem == 0), "Mat::init(): out of memory" );
      }
    
    access::rw(n_elem) = new_n_elem;

    if(new_n_elem == 0)
      {
      access::rw(n_rows) = 0;
      access::rw(n_cols) = 0;
      }
    else
      {
      access::rw(n_rows) = in_n_rows;
      access::rw(n_cols) = in_n_cols;
      }
    
    }
  }

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

create the matrix from a textual description

Definition at line 139 of file Mat_meat.hpp.

References Mat< eT >::init().

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init( std::string(text) );
  }

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

create the matrix from a textual description

Definition at line 158 of file Mat_meat.hpp.

References Mat< eT >::init().

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

  {
  arma_extra_debug_sigprint();
  
  init( std::string(text) );
  return *this;
  }

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

create the matrix from a textual description

Definition at line 171 of file Mat_meat.hpp.

References Mat< eT >::init().

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init(text);
  }

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 190 of file Mat_meat.hpp.

References Mat< eT >::init().

  {
  arma_extra_debug_sigprint();
  
  init(text);
  return *this;
  }

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 204 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  //
  // work out the size
  
  u32 t_n_rows = 0;
  u32 t_n_cols = 0;
  
  bool t_n_cols_found = false;
  
  std::string token;
  
  std::string::size_type line_start = 0;
  std::string::size_type   line_end = 0;
  
  while( line_start < text.length() )
    {
    
    line_end = text.find(';', line_start);
    
    if(line_end == std::string::npos)
      line_end = text.length()-1;
    
    std::string::size_type line_len = line_end - line_start + 1;
    std::stringstream line_stream( text.substr(line_start,line_len) );
    
    
    u32 line_n_cols = 0;
    while(line_stream >> token)
      {
      ++line_n_cols;
      }
    
    
    if(line_n_cols > 0)
      {
      if(t_n_cols_found == false)
        {
        t_n_cols = line_n_cols;
        t_n_cols_found = true;
        }
      else
        arma_check( (line_n_cols != t_n_cols), "Mat::init(): inconsistent number of columns in given string");
      
      ++t_n_rows;
      }
    line_start = line_end+1;
    
    }
    
  Mat<eT>& x = *this;
  x.set_size(t_n_rows, t_n_cols);
  
  line_start = 0;
  line_end = 0;
  
  u32 row = 0;
  
  while( line_start < text.length() )
    {
    
    line_end = text.find(';', line_start);
    
    if(line_end == std::string::npos)
      line_end = text.length()-1;
    
    std::string::size_type line_len = line_end - line_start + 1;
    std::stringstream line_stream( text.substr(line_start,line_len) );
    
//     u32 col = 0;
//     while(line_stream >> token)
//       {
//       x.at(row,col) = strtod(token.c_str(), 0);
//       ++col;
//       }
    
    u32 col = 0;
    eT val;
    while(line_stream >> val)
      {
      x.at(row,col) = val;
      ++col;
      }
    
    ++row;
    line_start = line_end+1;
    }
  
  }

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

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

Definition at line 303 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  init(1,1);
  access::rw(mem[0]) = val;
  return *this;
  }

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

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

Definition at line 318 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
        eT* local_ptr    = memptr();
  const u32 local_n_elem = n_elem;
    
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    local_ptr[i] += val;
    local_ptr[j] += val;
    }
  
  if(i < local_n_elem)
    {
    local_ptr[i] += val;
    }
  
  return *this;
  }

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

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

Definition at line 347 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
        eT* local_ptr    = memptr();
  const u32 local_n_elem = n_elem;
    
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    local_ptr[i] -= val;
    local_ptr[j] -= val;
    }
  
  if(i < local_n_elem)
    {
    local_ptr[i] -= val;
    }
  
  return *this;
  }

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

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

Definition at line 376 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
        eT* local_ptr    = memptr();
  const u32 local_n_elem = n_elem;
    
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    local_ptr[i] *= val;
    local_ptr[j] *= val;
    }
  
  if(i < local_n_elem)
    {
    local_ptr[i] *= val;
    }
  
  return *this;
  }

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

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

Definition at line 405 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
        eT* local_ptr    = memptr();
  const u32 local_n_elem = n_elem;
    
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    local_ptr[i] /= val;
    local_ptr[j] /= val;
    }
  
  if(i < local_n_elem)
    {
    local_ptr[i] /= val;
    }
  
  return *this;
  }

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

construct a matrix from a given matrix

Definition at line 433 of file Mat_meat.hpp.

References Mat< eT >::init().

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint(arma_boost::format("this = %x   in_mat = %x") % this % &in_mat);
  
  init(in_mat);
  }

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

construct a matrix from a given matrix

Definition at line 452 of file Mat_meat.hpp.

References Mat< eT >::init().

  {
  arma_extra_debug_sigprint();
  
  init(x);
  return *this;
  }

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

construct a matrix from a given matrix

Definition at line 466 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.

  {
  arma_extra_debug_sigprint();
  
  if(this != &x)
    {
    init(x.n_rows, x.n_cols);
    syslib::copy_elem( memptr(), x.mem, n_elem );
    }
  }

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

construct a matrix from a given auxiliary array of eTs. //! if copy_aux_mem is true, new memory is allocated and the array is copied. //! if copy_aux_mem is false, the auxiliary array is used directly (without allocating memory and copying). //! the default is to copy the array.

Definition at line 486 of file Mat_meat.hpp.

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

  : n_rows     (copy_aux_mem ? 0     : aux_n_rows           )
  , n_cols     (copy_aux_mem ? 0     : aux_n_cols           )
  , n_elem     (copy_aux_mem ? 0     : aux_n_rows*aux_n_cols)
  , use_aux_mem(copy_aux_mem ? false : true                 )
  , mem        (copy_aux_mem ? mem   : aux_mem              )
  {
  arma_extra_debug_sigprint_this(this);
  
  if(copy_aux_mem == true)
    {
    init(aux_n_rows, aux_n_cols);
    syslib::copy_elem( memptr(), aux_mem, n_elem );
    }
  }

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 auxiliary read-only array of eTs. //! the array is copied.

Definition at line 508 of file Mat_meat.hpp.

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

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init(aux_n_rows, aux_n_cols);
  syslib::copy_elem( memptr(), aux_mem, n_elem );
  }

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

DANGEROUS! Construct a temporary matrix, using auxiliary memory. //! This constructor is NOT intended for usage by user code. //! Its sole purpose is to be used by the Cube class.

Definition at line 530 of file Mat_meat.hpp.

  : n_rows     (aux_n_rows           )
  , n_cols     (aux_n_cols           )
  , n_elem     (aux_n_rows*aux_n_cols)
  , use_aux_mem(true                 )
  , mem        (aux_mem              )
  {
  arma_extra_debug_sigprint_this(this);
  }

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

in-place matrix addition

Definition at line 546 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_assert_same_size(*this, m, "matrix addition");
  
  const u32 local_n_elem = m.n_elem;
  
        eT* out_mem = (*this).memptr();
  const eT* m_mem   = m.memptr();
  
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    out_mem[i] += m_mem[i];
    out_mem[j] += m_mem[j];
    }
  
  if(i < local_n_elem)
    {
    out_mem[i] += m_mem[i];
    }
  
  return *this;
  }

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

in-place matrix subtraction

Definition at line 579 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_assert_same_size(*this, m, "matrix subtraction");
  
  const u32 local_n_elem = m.n_elem;
  
        eT* out_mem = (*this).memptr();
  const eT* m_mem   = m.memptr();
  
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    out_mem[i] -= m_mem[i];
    out_mem[j] -= m_mem[j];
    }
  
  if(i < local_n_elem)
    {
    out_mem[i] -= m_mem[i];
    }
  
  return *this;
  }

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

in-place matrix multiplication

Definition at line 612 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  glue_times::apply_inplace(*this, m);
  return *this;
  }

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

in-place element-wise matrix multiplication

Definition at line 626 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_assert_same_size(*this, m, "element-wise matrix multplication");
  
  const u32 local_n_elem = m.n_elem;
  
        eT* out_mem = (*this).memptr();
  const eT* m_mem   = m.memptr();
  
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    out_mem[i] *= m_mem[i];
    out_mem[j] *= m_mem[j];
    }
  
  if(i < local_n_elem)
    {
    out_mem[i] *= m_mem[i];
    }
  
  return *this;
  }

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

in-place element-wise matrix division

Definition at line 659 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_assert_same_size(*this, m, "element-wise matrix division");
  
  const u32 local_n_elem = m.n_elem;
  
        eT* out_mem = (*this).memptr();
  const eT* m_mem   = m.memptr();
  
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    out_mem[i] /= m_mem[i];
    out_mem[j] /= m_mem[j];
    }
  
  if(i < local_n_elem)
    {
    out_mem[i] /= m_mem[i];
    }
  
  return *this;
  }

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 693 of file Mat_meat.hpp.

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

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  arma_type_check< is_complex<eT>::value == false >::apply();   //!< compile-time abort if eT isn't std::complex
  
  typedef typename T1::elem_type T;
  arma_type_check< is_complex<T>::value == true >::apply();   //!< compile-time abort if T is std::complex
  
  isnt_same_type<std::complex<T>, eT>::check();   //!< compile-time abort if types are not compatible
  
  const unwrap<T1> tmp_A(A.get_ref());
  const unwrap<T2> tmp_B(B.get_ref());
  
  const Mat<T>& X = tmp_A.M;
  const Mat<T>& Y = tmp_B.M;
  
  arma_assert_same_size(X, Y, "Mat()");
  
  init(X.n_rows, Y.n_cols);
  
  const T* X_mem = X.mem;
  const T* Y_mem = Y.mem;
  
  for(u32 i=0; i<n_elem; ++i)
    {
    access::rw(mem[i]) = std::complex<T>(X_mem[i], Y_mem[i]);
    }
  }

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 737 of file Mat_meat.hpp.

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

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  this->operator=(X);
  }

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)

Definition at line 756 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview<eT>::extract(*this, X);
  return *this;
  }

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 769 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview<eT>::plus_inplace(*this, X);
  return *this;
  }

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 782 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview<eT>::minus_inplace(*this, X);
  return *this;
  }

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)

Definition at line 796 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  glue_times::apply_inplace(*this, X);
  return *this;
  }

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 810 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview<eT>::schur_inplace(*this, X);
  return *this;
  }

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 824 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview<eT>::div_inplace(*this, X);
  return *this;
  }

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

construct a matrix from a subview_cube instance

Definition at line 837 of file Mat_meat.hpp.

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

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  this->operator=(x);
  }

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

construct a matrix from a subview_cube instance

Definition at line 856 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview_cube<eT>::extract(*this, X);
  return *this;
  }

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

in-place matrix addition (using a single-slice subcube on the right-hand-side)

Definition at line 870 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  subview_cube<eT>::plus_inplace(*this, X);
  return *this;
  }

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

in-place matrix subtraction (using a single-slice subcube on the right-hand-side)

Definition at line 884 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview_cube<eT>::minus_inplace(*this, X);
  return *this;
  }

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

in-place matrix mutiplication (using a single-slice subcube on the right-hand-side)

Definition at line 898 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();

  const Mat<eT> tmp(X);
  glue_times::apply_inplace(*this, tmp);
  return *this;
  }

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

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

Definition at line 913 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview_cube<eT>::schur_inplace(*this, X);
  return *this;
  }

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

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

Definition at line 927 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  subview_cube<eT>::div_inplace(*this, X);
  return *this;
  }

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 940 of file Mat_meat.hpp.

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

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  this->operator=(X);
  }

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)

Definition at line 959 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  diagview<eT>::extract(*this, X);
  return *this;
  }

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

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

Definition at line 973 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  diagview<eT>::plus_inplace(*this, X);
  return *this;
  }

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

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

Definition at line 986 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  diagview<eT>::minus_inplace(*this, X);
  return *this;
  }

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

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

Definition at line 1000 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  glue_times::apply_inplace(*this, X);
  return *this;
  }

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

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

Definition at line 1014 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  diagview<eT>::schur_inplace(*this, X);
  return *this;
  }

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

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

Definition at line 1028 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  diagview<eT>::div_inplace(*this, X);
  return *this;
  }

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

creation of subview (row vector)

Definition at line 1057 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" );
  
  return subview_row<eT>(*this, row_num);
  }

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

creation of subview (column vector)

Definition at line 1087 of file Mat_meat.hpp.

References Mat< eT >::n_cols.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds");
  
  return subview_col<eT>(*this, col_num);
  }

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

creation of subview (submatrix comprised of specified row vectors)

Definition at line 1102 of file Mat_meat.hpp.

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

Referenced by op_find::apply().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_row1 > in_row2) || (in_row2 >= n_rows),
    "Mat::rows(): indices out of bounds or incorrectly used"
    );
  
  return subview<eT>(*this, in_row1, 0, in_row2, ((n_cols>0) ? n_cols-1 : 0) );
  }

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

creation of subview (submatrix comprised of specified row vectors)

Definition at line 1121 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_row1 > in_row2) || (in_row2 >= n_rows),
    "Mat::rows(): indices out of bounds or incorrectly used"
    );
  
  return subview<eT>(*this, in_row1, 0, in_row2, ((n_cols>0) ? n_cols-1 : 0) );
  }

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

creation of subview (submatrix comprised of specified column vectors)

Definition at line 1140 of file Mat_meat.hpp.

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

Referenced by op_pinv::direct_pinv(), and op_princomp::direct_princomp().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_col1 > in_col2) || (in_col2 >= n_cols),
    "Mat::cols(): indices out of bounds or incorrectly used"
    );
  
  return subview<eT>(*this, 0, in_col1, ((n_rows>0) ? n_rows-1 : 0), in_col2);
  }

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

creation of subview (submatrix comprised of specified column vectors)

Definition at line 1159 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_col1 > in_col2) || (in_col2 >= n_cols),
    "Mat::cols(): indices out of bounds or incorrectly used"
    );
  
  return subview<eT>(*this, 0, in_col1, ((n_rows>0) ? n_rows-1 : 0), in_col2);
  }

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 
) [inherited]

creation of subview (submatrix)

Definition at line 1178 of file Mat_meat.hpp.

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

Referenced by op_repmat::apply(), glue_join::apply(), and glue_kron::direct_kron().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_row1 > in_row2) || (in_col1 >  in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
    "Mat::submat(): indices out of bounds or incorrectly used"
    );
  
  return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2);
  }

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 [inherited]

creation of subview (generic submatrix)

Definition at line 1197 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_row1 > in_row2) || (in_col1 >  in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
    "Mat::submat(): indices out of bounds or incorrectly used"
    );
    
  return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2);
  }

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

creation of diagview (diagonal)

Definition at line 1216 of file Mat_meat.hpp.

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

Referenced by op_diagvec::apply().

  {
  arma_extra_debug_sigprint();
  
  const u32 row_offset = (in_id < 0) ? -in_id : 0;
  const u32 col_offset = (in_id > 0) ?  in_id : 0;
  
  arma_debug_check
    (
    (row_offset >= n_rows) || (col_offset >= n_cols),
    "Mat::diag(): requested diagonal out of bounds"
    );
  
  const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset);
  
  return diagview<eT>(*this, row_offset, col_offset, len);
  }

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

creation of diagview (diagonal)

Definition at line 1240 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  const u32 row_offset = (in_id < 0) ? -in_id : 0;
  const u32 col_offset = (in_id > 0) ?  in_id : 0;
  
  arma_debug_check
    (
    (row_offset >= n_rows) || (col_offset >= n_cols),
    "Mat::diag(): requested diagonal out of bounds"
    );
  
  
  const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset);
  
  return diagview<eT>(*this, row_offset, col_offset, len);
  }

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

Definition at line 1264 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 op_shuffle::apply(), op_flipud::apply(), and auxlib::lu().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_row1 >= n_rows) || (in_row2 >= n_rows),
    "Mat::swap_rows(): out of bounds"
    );
  
  for(u32 col=0; col<n_cols; ++col)
    {
    const u32 offset = col*n_rows;
    const u32 pos1   = in_row1 + offset;
    const u32 pos2   = in_row2 + offset;
    
    const eT tmp          = mem[pos1];
    access::rw(mem[pos1]) = mem[pos2];
    access::rw(mem[pos2]) = tmp;
    }
  
  }

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

Definition at line 1292 of file Mat_meat.hpp.

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

Referenced by op_shuffle::apply(), and op_fliplr::apply().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check
    (
    (in_col1 >= n_cols) || (in_col2 >= n_cols),
    "Mat::swap_cols(): out of bounds"
    );
  
  eT* ptr1 = colptr(in_col1);
  eT* ptr2 = colptr(in_col2);
  
  for(u32 row=0; row<n_rows; ++row)
    {
    const eT tmp = ptr1[row];
    ptr1[row]    = ptr2[row];
    ptr2[row]    = tmp;
    }
  
  }

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 1320 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  op_type::apply(*this, X);
  }

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

Definition at line 1342 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  op_type::apply(*this, X);
  
  return *this;
  }

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 1360 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator+=(m);
  }

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 1378 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator-=(m);
  }

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

Definition at line 1396 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  glue_times::apply_inplace(*this, X);
  
  return *this;
  }

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 1414 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator%=(m);
  }

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 1432 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator/=(m);
  }

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

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

Definition at line 1449 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply(*this, X);
  }

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

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

Definition at line 1471 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply(*this, X);
  
  return *this;
  }

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

Definition at line 1488 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply_inplace_plus(*this, X);
  
  return *this;
  }

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

Definition at line 1505 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply_inplace_minus(*this, X);
  
  return *this;
  }

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

Definition at line 1522 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  
  glue_times::apply_inplace(*this, X);
  
  return *this;
  }

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

Definition at line 1539 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply_inplace_schur(*this, X);
  
  return *this;
  }

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

Definition at line 1556 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();

  isnt_same_type<eT, typename T1::elem_type>::check();
  
  eop_type::apply_inplace_div(*this, X);
  
  return *this;
  }

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

EXPERIMENTAL.

Definition at line 1573 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  op_type::apply(*this, X);
  }

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

EXPERIMENTAL.

Definition at line 1593 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  op_type::apply(*this, X);
  
  return *this;
  }

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

EXPERIMENTAL.

Definition at line 1609 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator+=(m);
  }

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

EXPERIMENTAL.

Definition at line 1625 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator-=(m);
  }

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

EXPERIMENTAL.

Definition at line 1641 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator*=(m);
  }

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

EXPERIMENTAL.

Definition at line 1657 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator%=(m);
  }

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

EXPERIMENTAL.

Definition at line 1673 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator/=(m);
  }

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 1688 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  glue_type::apply(*this, X);
  }

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

Definition at line 1711 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  glue_type::apply(*this, X);
  
  return *this;
  }

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 1730 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator+=(m);
  }

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 1749 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator-=(m);
  }

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

Definition at line 1768 of file Mat_meat.hpp.

References glue_times::apply_inplace().

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 1787 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator%=(m);
  }

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 1806 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  const Mat<eT> m(X);
  
  return (*this).operator/=(m);
  }

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

Definition at line 1824 of file Mat_meat.hpp.

References glue_times::apply_inplace_plus().

  {
  arma_extra_debug_sigprint();
  
  glue_times::apply_inplace_plus(*this, X, s32(+1));
  
  return *this;
  }

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

Definition at line 1839 of file Mat_meat.hpp.

References glue_times::apply_inplace_plus().

  {
  arma_extra_debug_sigprint();
  
  glue_times::apply_inplace_plus(*this, X, s32(-1));
  
  return *this;
  }

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

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

Definition at line 1854 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply(*this, X);
  }

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

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

Definition at line 1877 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply(*this, X);
  
  return *this;
  }

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

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

Definition at line 1896 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply_inplace_plus(*this, X);
  
  return *this;
  }

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

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

Definition at line 1915 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply_inplace_minus(*this, X);
  
  return *this;
  }

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

Definition at line 1933 of file Mat_meat.hpp.

References glue_times::apply_inplace().

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

Definition at line 1950 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply_inplace_schur(*this, X);
  return *this;
  }

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

Definition at line 1967 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  isnt_same_type<eT, typename T1::elem_type>::check();
  isnt_same_type<eT, typename T2::elem_type>::check();
  
  eglue_type::apply_inplace_div(*this, X);
  return *this;
  }

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

EXPERIMENTAL: create a matrix from mtGlue, i.e. run the previously delayed binary operations.

Definition at line 1984 of file Mat_meat.hpp.

  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , use_aux_mem(false)
  //, mem(0)
  , mem(mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  glue_type::apply(*this, X);
  }

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

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

Definition at line 2004 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  glue_type::apply(*this, X);
  
  return *this;
  }

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

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

Definition at line 2020 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator+=(m);
  }

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

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

Definition at line 2036 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator-=(m);
  }

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

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

Definition at line 2052 of file Mat_meat.hpp.

References glue_times::apply_inplace().

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  glue_times::apply_inplace(*this, m);
  
  return *this;
  }

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

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

Definition at line 2070 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator%=(m);
  }

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

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

Definition at line 2086 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  const Mat<eT> m(X);
  
  return (*this).operator/=(m);
  }

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

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

Definition at line 2101 of file Mat_meat.hpp.

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

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

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

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

Definition at line 2113 of file Mat_meat.hpp.

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

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

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

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

Definition at line 2124 of file Mat_meat.hpp.

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

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

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

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

Definition at line 2135 of file Mat_meat.hpp.

References Mat< eT >::mem.

  {
  return mem[i];
  }

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

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 2146 of file Mat_meat.hpp.

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

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

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

element accessor; bounds checking not done when ARMA_NO_DEBUG is defined

Definition at line 2158 of file Mat_meat.hpp.

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

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

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

element accessor; no bounds check

Definition at line 2170 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_reshape::apply(), op_prod::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::apply(), op_diagmat::apply(), glue_toeplitz::apply(), glue_times_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_diag(), glue_times::apply_inplace(), eop_core< eop_type >::apply_inplace_div(), eop_core< eop_type >::apply_inplace_minus(), eop_core< eop_type >::apply_inplace_plus(), eop_core< eop_type >::apply_inplace_schur(), op_trans::apply_noalias(), eop_core< eop_type >::apply_proxy(), eop_core< eop_type >::apply_unwrap(), diagmat_proxy_check< Col< eT > >::at(), diagmat_proxy_check< Row< eT > >::at(), diagmat_proxy_check< Mat< eT > >::at(), diagmat_proxy_check< T1 >::at(), auxlib::det(), op_dotext::direct_rowvec_diagmat_colvec(), op_dotext::direct_rowvec_invdiagmat_colvec(), op_dotext::direct_rowvec_mat_colvec(), op_dotext::direct_rowvec_transmat_colvec(), diagview< eT >::div_inplace(), eig_gen(), subview< eT >::extract(), diagview< eT >::extract(), diagview< eT >::fill(), Mat< eT >::init(), auxlib::inv_inplace(), auxlib::inv_noalias(), diskio::load_arma_ascii(), diskio::load_pgm_binary(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), auxlib::log_det(), auxlib::lu(), diagview< eT >::minus_inplace(), diagview< eT >::ones(), operator*(), diagview< eT >::operator=(), diagmat_proxy_check< Col< eT > >::operator[](), diagmat_proxy_check< Row< eT > >::operator[](), diagmat_proxy_check< Mat< eT > >::operator[](), diagmat_proxy_check< T1 >::operator[](), diagview< eT >::plus_inplace(), arma_ostream::print(), prod(), auxlib::qr(), diskio::save_arma_ascii(), diskio::save_pgm_binary(), diskio::save_ppm_binary(), diskio::save_raw_ascii(), diagview< eT >::schur_inplace(), trace(), and diagview< eT >::zeros().

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

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

element accessor; no bounds check

Definition at line 2181 of file Mat_meat.hpp.

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

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

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

prefix ++

Definition at line 2192 of file Mat_meat.hpp.

References Mat_aux::prefix_pp().

  {
  Mat_aux::prefix_pp(*this);
  return *this;
  }

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

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

Definition at line 2204 of file Mat_meat.hpp.

References Mat_aux::postfix_pp().

  {
  Mat_aux::postfix_pp(*this);
  }

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

prefix --

Definition at line 2215 of file Mat_meat.hpp.

References Mat_aux::prefix_mm().

  {
  Mat_aux::prefix_mm(*this);
  return *this;
  }

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

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

Definition at line 2227 of file Mat_meat.hpp.

References Mat_aux::postfix_mm().

  {
  Mat_aux::postfix_mm(*this);
  }

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

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

Definition at line 2249 of file Mat_meat.hpp.

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

Referenced by op_inv::apply(), op_diagmat::apply(), op_chol::apply(), and as_scalar_redirect< 3 >::apply().

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

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

returns true if all of the elements are finite

Definition at line 2260 of file Mat_meat.hpp.

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

Referenced by op_sort::apply().

  {
  for(u32 i=0; i<n_elem; ++i)
    {
    if(arma_isfinite(mem[i]) == false)
      {
      return false;
      }
    }

  return true;
  }

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

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

Definition at line 2290 of file Mat_meat.hpp.

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

  {
  return & mem[in_col*n_rows];
  }

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

returns a pointer to array of eTs used by the matrix

Definition at line 2301 of file Mat_meat.hpp.

References Mat< eT >::mem.

Referenced by op_trans2::apply(), op_sort::apply(), op_reshape::apply(), op_rel_noteq::apply(), op_rel_eq::apply(), op_rel_gteq_post::apply(), op_rel_gteq_pre::apply(), op_rel_lteq_post::apply(), op_rel_lteq_pre::apply(), op_rel_gt_post::apply(), op_rel_gt_pre::apply(), op_rel_lt_post::apply(), op_rel_lt_pre::apply(), op_abs::apply(), op_imag::apply(), op_real::apply(), op_diagmat::apply(), glue_toeplitz::apply(), glue_times::apply(), glue_rel_noteq::apply(), glue_rel_eq::apply(), glue_rel_gteq::apply(), glue_rel_lteq::apply(), glue_rel_gt::apply(), glue_rel_lt::apply(), glue_cross::apply(), glue_conv::apply(), gemm< do_trans_A, do_trans_B, use_alpha, use_beta >::apply_blas_type(), eop_core< eop_type >::apply_inplace_div(), eglue_core< eglue_type >::apply_inplace_div(), eop_core< eop_type >::apply_inplace_minus(), eglue_core< eglue_type >::apply_inplace_minus(), glue_times::apply_inplace_plus(), eop_core< eop_type >::apply_inplace_plus(), eglue_core< eglue_type >::apply_inplace_plus(), eop_core< eop_type >::apply_inplace_schur(), eglue_core< eglue_type >::apply_inplace_schur(), op_trans::apply_noalias(), eop_core< eop_type >::apply_proxy(), eglue_core< eglue_type >::apply_proxy(), op_norm_dot::apply_unwrap(), eop_core< eop_type >::apply_unwrap(), eglue_core< eglue_type >::apply_unwrap(), Mat< eT >::begin(), Row< eT >::begin_row(), Col< eT >::begin_row(), subview_cube< eT >::check_overlap(), auxlib::chol(), auxlib::det(), glue_cor::direct_cor(), glue_cov::direct_cov(), diagview< eT >::div_inplace(), auxlib::eig_gen(), auxlib::eig_sym(), Mat< eT >::end(), Row< eT >::end_row(), Col< eT >::end_row(), eps(), subview< eT >::extract(), diagview< eT >::extract(), Mat< eT >::fill(), conv_to< Col< out_eT > >::from(), conv_to< Row< out_eT > >::from(), conv_to< Mat< out_eT > >::from(), op_find::helper(), Mat< eT >::init(), auxlib::inv_inplace(), auxlib::inv_noalias(), linspace(), diskio::load_arma_binary(), auxlib::log_det(), auxlib::lu(), Mat< eT >::Mat(), diagview< eT >::minus_inplace(), Mat< eT >::operator%=(), Mat< eT >::operator*=(), Mat< eT >::operator+=(), Mat< eT >::operator-=(), Mat< eT >::operator/=(), diagview< eT >::plus_inplace(), Mat_aux::postfix_mm(), Mat_aux::postfix_pp(), Mat_aux::prefix_mm(), Mat_aux::prefix_pp(), arma_ostream::print(), prod(), auxlib::qr(), rank(), diagview< eT >::schur_inplace(), auxlib::solve(), auxlib::solve_od(), auxlib::solve_ud(), sort_index(), auxlib::svd(), and running_stat_vec_aux::update_stats().

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

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

returns a pointer to array of eTs used by the matrix

Definition at line 2312 of file Mat_meat.hpp.

References Mat< eT >::mem.

  {
  return mem;
  }

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 2326 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  if(extra_text.length() != 0)
    {
    const std::streamsize orig_width = cout.width();
    
    cout << extra_text << '\n';
  
    cout.width(orig_width);
    }
  
  arma_ostream::print(cout, *this, true);
  }

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 2351 of file Mat_meat.hpp.

References Mat< eT >::print().

  {
  arma_extra_debug_sigprint();
  
  if(extra_text.length() != 0)
    {
    const std::streamsize orig_width = user_stream.width();
    
    user_stream << extra_text << '\n';
    
    user_stream.width(orig_width);
    }
  
  arma_ostream::print(user_stream, *this, true);
  }

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

print contents of the transposed version 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 2376 of file Mat_meat.hpp.

References op_trans::apply_noalias(), and Mat< eT >::print().

  {
  arma_extra_debug_sigprint();
  
  Mat<eT> tmp;
  op_trans::apply_noalias(tmp, *this);
  
  tmp.print(extra_text);
  }

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

print contents of the transposed version of 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 2395 of file Mat_meat.hpp.

References op_trans::apply_noalias(), and Mat< eT >::print().

  {
  arma_extra_debug_sigprint();
  
  Mat<eT> tmp;
  op_trans::apply_noalias(tmp, *this);
  
  tmp.print(user_stream, extra_text);
  }

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 2414 of file Mat_meat.hpp.

References Mat< eT >::print().

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

  {
  arma_extra_debug_sigprint();
  
  if(extra_text.length() != 0)
    {
    const std::streamsize orig_width = cout.width();
    
    cout << extra_text << '\n';
  
    cout.width(orig_width);
    }
  
  arma_ostream::print(cout, *this, false);
  }

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 2439 of file Mat_meat.hpp.

References Mat< eT >::print().

  {
  arma_extra_debug_sigprint();
  
  if(extra_text.length() != 0)
    {
    const std::streamsize orig_width = user_stream.width();
  
    user_stream << extra_text << '\n';
  
    user_stream.width(orig_width);
    }
  
  arma_ostream::print(user_stream, *this, false);
  }

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

print contents of the transposed version 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 2464 of file Mat_meat.hpp.

References op_trans::apply_noalias(), and Mat< eT >::raw_print().

  {
  arma_extra_debug_sigprint();
  
  Mat<eT> tmp;
  op_trans::apply_noalias(tmp, *this);
  
  tmp.raw_print(extra_text);
  }

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

print contents of the transposed version 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 2483 of file Mat_meat.hpp.

References op_trans::apply_noalias(), and Mat< eT >::raw_print().

  {
  arma_extra_debug_sigprint();
  
  Mat<eT> tmp;
  op_trans::apply_noalias(tmp, *this);
  
  tmp.raw_print(user_stream, extra_text);
  }

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)

Definition at line 2499 of file Mat_meat.hpp.

References Mat< eT >::init().

Referenced by op_sum::apply(), op_reshape::apply(), op_repmat::apply(), op_rel_noteq::apply(), op_rel_eq::apply(), op_rel_gteq_post::apply(), op_rel_gteq_pre::apply(), op_rel_lteq_post::apply(), op_rel_lteq_pre::apply(), op_rel_gt_post::apply(), op_rel_gt_pre::apply(), op_rel_lt_post::apply(), op_rel_lt_pre::apply(), op_prod::apply(), op_abs::apply(), op_imag::apply(), op_real::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::apply(), op_inv::apply(), op_diagmat::apply(), glue_toeplitz::apply(), glue_times_diag::apply(), glue_times::apply(), glue_rel_noteq::apply(), glue_rel_eq::apply(), glue_rel_gteq::apply(), glue_rel_lteq::apply(), glue_rel_gt::apply(), glue_rel_lt::apply(), glue_join::apply(), glue_cross::apply(), glue_conv::apply(), op_inv::apply_diag(), op_trans::apply_noalias(), eop_core< eop_type >::apply_proxy(), eglue_core< eglue_type >::apply_proxy(), eop_core< eop_type >::apply_unwrap(), eglue_core< eglue_type >::apply_unwrap(), op_cor::direct_cor(), glue_cor::direct_cor(), glue_cov::direct_cov(), glue_kron::direct_kron(), op_pinv::direct_pinv(), eig_gen(), auxlib::eig_gen(), subview< eT >::extract(), subview_cube< eT >::extract(), diagview< eT >::extract(), op_find::helper(), Mat< eT >::init(), auxlib::inv_noalias(), diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_pgm_binary(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), auxlib::lu(), Mat< eT >::ones(), auxlib::qr(), auxlib::solve_od(), auxlib::solve_ud(), auxlib::svd(), and Mat< eT >::zeros().

  {
  arma_extra_debug_sigprint();
  
  init(in_n_rows, in_n_cols);
  }

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

change the matrix (without preserving data) to have the same dimensions as the given matrix

Definition at line 2513 of file Mat_meat.hpp.

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

Referenced by op_sort::apply(), op_shuffle::apply(), op_fliplr::apply(), op_flipud::apply(), and op_princomp::direct_princomp().

  {
  arma_extra_debug_sigprint();
  
  init(m.n_rows, m.n_cols);
  }

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

fill the matrix with the specified value

Definition at line 2527 of file Mat_meat.hpp.

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

Referenced by Mat< eT >::ones(), and Mat< eT >::zeros().

  {
  arma_extra_debug_sigprint();
  
        eT* local_ptr    = memptr();
  const u32 local_n_elem = n_elem;
  
  u32 i,j;
  
  for(i=0, j=1; j<local_n_elem; i+=2, j+=2)
    {
    local_ptr[i] = val;
    local_ptr[j] = val;
    }
  
  if(i < local_n_elem)
    {
    local_ptr[i] = val;
    }
  }

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]

Definition at line 2565 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d") % in_rows % in_cols );

  set_size(in_rows, in_cols);
  fill(eT(0));
  }

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

Definition at line 2578 of file Mat_meat.hpp.

References Mat< eT >::fill().

  {
  arma_extra_debug_sigprint();
  
  fill(eT(1));
  }

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

Definition at line 2590 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d") % in_rows % in_cols );

  set_size(in_rows, in_cols);
  fill(eT(1));
  }

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

save the matrix to a file

Definition at line 2616 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  bool save_okay;
  
  switch(type)
    {
    case raw_ascii:
      save_okay = diskio::save_raw_ascii(*this, name);
      break;
    
    case arma_ascii:
      save_okay = diskio::save_arma_ascii(*this, name);
      break;
    
    case arma_binary:
      save_okay = diskio::save_arma_binary(*this, name);
      break;
      
    case pgm_binary:
      save_okay = diskio::save_pgm_binary(*this, name);
      break;
    
    default:
      arma_warn(print_status, "Mat::save(): unsupported file type");
      save_okay = false;
    }
  
  arma_warn( (print_status && (save_okay == false)), "Mat::save(): couldn't write to ", name);
  
  return save_okay;
  }

template<typename eT >
bool Mat< eT >::save ( std::ostream &  os,
const file_type  type = arma_binary,
const bool  print_status = true 
) const [inline, inherited]

save the matrix to a stream

Definition at line 2656 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  bool save_okay;
  
  switch(type)
    {
    case raw_ascii:
      save_okay = diskio::save_raw_ascii(*this, os);
      break;
    
    case arma_ascii:
      save_okay = diskio::save_arma_ascii(*this, os);
      break;
    
    case arma_binary:
      save_okay = diskio::save_arma_binary(*this, os);
      break;
      
    case pgm_binary:
      save_okay = diskio::save_pgm_binary(*this, os);
      break;
    
    default:
      arma_warn(print_status, "Mat::save(): unsupported file type");
      save_okay = false;
    }
  
  arma_warn( (print_status && (save_okay == false)), "Mat::save(): couldn't write to the given stream");
  
  return save_okay;
  }

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

load a matrix from a file

Definition at line 2696 of file Mat_meat.hpp.

References arma_ascii, arma_binary, arma_print(), arma_warn(), 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.

  {
  arma_extra_debug_sigprint();
  
  bool load_okay;
  std::string err_msg;
  
  switch(type)
    {
    case auto_detect:
      load_okay = diskio::load_auto_detect(*this, name, err_msg);
      break;
    
    case raw_ascii:
      load_okay = diskio::load_raw_ascii(*this, name, err_msg);
      break;
    
    case arma_ascii:
      load_okay = diskio::load_arma_ascii(*this, name, err_msg);
      break;
    
    case arma_binary:
      load_okay = diskio::load_arma_binary(*this, name, err_msg);
      break;
      
    case pgm_binary:
      load_okay = diskio::load_pgm_binary(*this, name, err_msg);
      break;
    
    default:
      arma_warn(print_status, "Mat::load(): unsupported file type");
      load_okay = false;
    }
  
  if( (print_status == true) && (load_okay == false) )
    {
    if(err_msg.length() > 0)
      {
      arma_print("Mat::load(): ", err_msg, name);
      }
    else
      {
      arma_print("Mat::load(): couldn't read ", name);
      }
    }
  
  if(load_okay == false)
    {
    (*this).reset();
    }
    
  return load_okay;
  }

template<typename eT >
bool Mat< eT >::load ( std::istream &  is,
const file_type  type = auto_detect,
const bool  print_status = true 
) [inline, inherited]

load a matrix from a stream

Definition at line 2756 of file Mat_meat.hpp.

References arma_ascii, arma_binary, arma_print(), arma_warn(), 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.

  {
  arma_extra_debug_sigprint();
  
  bool load_okay;
  std::string err_msg;
  
  switch(type)
    {
    case auto_detect:
      load_okay = diskio::load_auto_detect(*this, is, err_msg);
      break;
    
    case raw_ascii:
      load_okay = diskio::load_raw_ascii(*this, is, err_msg);
      break;
    
    case arma_ascii:
      load_okay = diskio::load_arma_ascii(*this, is, err_msg);
      break;
    
    case arma_binary:
      load_okay = diskio::load_arma_binary(*this, is, err_msg);
      break;
      
    case pgm_binary:
      load_okay = diskio::load_pgm_binary(*this, is, err_msg);
      break;
    
    default:
      arma_warn(print_status, "Mat::load(): unsupported file type");
      load_okay = false;
    }
  
  
  if( (print_status == true) && (load_okay == false) )
    {
    if(err_msg.length() > 0)
      {
      arma_print("Mat::load(): ", err_msg, "the given stream");
      }
    else
      {
      arma_print("Mat::load(): couldn't load from the given stream");
      }
    }
  
  if(load_okay == false)
    {
    (*this).reset();
    }
    
  return load_okay;
  }

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

save the matrix to a file, without printing any error messages

Definition at line 2817 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  return (*this).save(name, type, false);
  }

template<typename eT >
bool Mat< eT >::quiet_save ( std::ostream &  os,
const file_type  type = arma_binary 
) const [inline, inherited]

save the matrix to a stream, without printing any error messages

Definition at line 2830 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  return (*this).save(os, type, false);
  }

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

load a matrix from a file, without printing any error messages

Definition at line 2843 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  return (*this).load(name, type, false);
  }

template<typename eT >
bool Mat< eT >::quiet_load ( std::istream &  is,
const file_type  type = auto_detect 
) [inline, inherited]

load a matrix from a stream, without printing any error messages

Definition at line 2856 of file Mat_meat.hpp.

  {
  arma_extra_debug_sigprint();
  
  return (*this).load(is, type, false);
  }

template<typename eT>
Mat< eT >::row_iterator::row_iterator ( Mat< eT > &  in_M,
const u32  in_row 
) [inline, inherited]

Definition at line 2867 of file Mat_meat.hpp.

  : M  (in_M  )
  , row(in_row)
  , col(0     )
  {
  arma_extra_debug_sigprint();
  }

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

Definition at line 2880 of file Mat_meat.hpp.

References Mat< eT >::row_iterator::col, Mat< eT >::row_iterator::M, and Mat< eT >::row_iterator::row.

  {
  return M.at(row,col);
  }

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

Definition at line 2890 of file Mat_meat.hpp.

References Mat< eT >::row_iterator::col, Mat< eT >::row_iterator::M, and Mat< eT >::row_iterator::row.

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

  {
  ++col;
  
  if(col >= M.n_cols)
    {
    col = 0;
    ++row;
    }
  
  return *this;
  }

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

Definition at line 2908 of file Mat_meat.hpp.

References Mat< eT >::row_iterator::operator++().

  {
  operator++();
  }

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

Definition at line 2918 of file Mat_meat.hpp.

References Mat< eT >::row_iterator::col, Mat< eT >::row_iterator::M, and Mat< eT >::row_iterator::row.

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

  {
  if(col > 0)
    {
    --col;
    }
  else
    {
    if(row > 0)
      {
      col = M.n_cols - 1;
      --row;
      }
    }
  
  return *this;
  }

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

Definition at line 2941 of file Mat_meat.hpp.

References Mat< eT >::row_iterator::operator--().

  {
  operator--();
  }

template<typename eT>
Mat< eT >::const_row_iterator::const_row_iterator ( const Mat< eT > &  in_M,
const u32  in_row 
) [inline, inherited]

Definition at line 2970 of file Mat_meat.hpp.

  : M  (in_M  )
  , row(in_row)
  , col(0     )
  {
  arma_extra_debug_sigprint();
  }

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

Definition at line 3005 of file Mat_meat.hpp.

References Mat< eT >::const_row_iterator::col, Mat< eT >::const_row_iterator::M, and Mat< eT >::const_row_iterator::row.

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

  {
  ++col;
  
  if(col >= M.n_cols)
    {
    col = 0;
    ++row;
    }
  
  return *this;
  }

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

Definition at line 3023 of file Mat_meat.hpp.

References Mat< eT >::const_row_iterator::operator++().

  {
  operator++();
  }

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

Definition at line 3033 of file Mat_meat.hpp.

References Mat< eT >::const_row_iterator::col, Mat< eT >::const_row_iterator::M, and Mat< eT >::const_row_iterator::row.

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

  {
  if(col > 0)
    {
    --col;
    }
  else
    {
    if(row > 0)
      {
      col = M.n_cols - 1;
      --row;
      }
    }
  
  return *this;
  }

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

Definition at line 3056 of file Mat_meat.hpp.

References Mat< eT >::const_row_iterator::operator--().

  {
  operator--();
  }

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

Definition at line 3086 of file Mat_meat.hpp.

References Mat< eT >::memptr().

  {
  arma_extra_debug_sigprint();
  
  return memptr();
  }

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

Definition at line 3098 of file Mat_meat.hpp.

References Mat< eT >::memptr().

  {
  arma_extra_debug_sigprint();
  
  return memptr();
  }

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

Definition at line 3110 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  return memptr() + n_elem;
  }

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

Definition at line 3122 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  return memptr() + n_elem;
  }

template<typename eT >
Mat< eT >::col_iterator Mat< eT >::begin_col ( const u32  col_num  )  [inline, inherited]

Definition at line 3134 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (col_num >= n_cols), "begin_col(): index out of bounds");
  
  return colptr(col_num);
  }

template<typename eT >
Mat< eT >::const_col_iterator Mat< eT >::begin_col ( const u32  col_num  )  const [inline, inherited]

Definition at line 3148 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (col_num >= n_cols), "begin_col(): index out of bounds");
  
  return colptr(col_num);
  }

template<typename eT >
Mat< eT >::col_iterator Mat< eT >::end_col ( const u32  col_num  )  [inline, inherited]

Definition at line 3162 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (col_num >= n_cols), "end_col(): index out of bounds");
  
  return colptr(col_num) + n_rows;
  }

template<typename eT >
Mat< eT >::const_col_iterator Mat< eT >::end_col ( const u32  col_num  )  const [inline, inherited]

Definition at line 3176 of file Mat_meat.hpp.

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

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (col_num >= n_cols), "end_col(): index out of bounds");
  
  return colptr(col_num) + n_rows;
  }

template<typename eT >
Mat< eT >::row_iterator Mat< eT >::begin_row ( const u32  row_num  )  [inline, inherited]

Definition at line 3190 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" );
  
  return typename Mat<eT>::row_iterator(*this, row_num);
  }

template<typename eT >
Mat< eT >::const_row_iterator Mat< eT >::begin_row ( const u32  row_num  )  const [inline, inherited]

Definition at line 3204 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" );
  
  return typename Mat<eT>::const_row_iterator(*this, row_num);
  }

template<typename eT >
Mat< eT >::row_iterator Mat< eT >::end_row ( const u32  row_num  )  [inline, inherited]

Definition at line 3218 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (row_num >= n_rows), "Mat::end_row(): index out of bounds" );
  
  return typename Mat<eT>::row_iterator(*this, row_num + 1);
  }

template<typename eT >
Mat< eT >::const_row_iterator Mat< eT >::end_row ( const u32  row_num  )  const [inline, inherited]

Definition at line 3232 of file Mat_meat.hpp.

References Mat< eT >::n_rows.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (row_num >= n_rows), "Mat::end_row(): index out of bounds" );
  
  return typename Mat<eT>::const_row_iterator(*this, row_num + 1);
  }

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

prefix ++

Definition at line 3247 of file Mat_meat.hpp.

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

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

  {
        eT* memptr = x.memptr();
  const u32 n_elem = x.n_elem;
  
  u32 i,j;

  for(i=0, j=1; j<n_elem; i+=2, j+=2)
    {
    ++(memptr[i]);
    ++(memptr[j]);
    }
  
  if(i < n_elem)
    {
    ++(memptr[i]);
    }
  }

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

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

Definition at line 3272 of file Mat_meat.hpp.

  {
  x += T(1);
  }

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

postfix ++

Definition at line 3283 of file Mat_meat.hpp.

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

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

  {
        eT* memptr = x.memptr();
  const u32 n_elem = x.n_elem;
  
  u32 i,j;
  
  for(i=0, j=1; j<n_elem; i+=2, j+=2)
    {
    (memptr[i])++;
    (memptr[j])++;
    }
  
  if(i < n_elem)
    {
    (memptr[i])++;
    }
  }

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

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

Definition at line 3308 of file Mat_meat.hpp.

  {
  x += T(1);
  }

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

prefix --

Definition at line 3319 of file Mat_meat.hpp.

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

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

  {
        eT* memptr = x.memptr();
  const u32 n_elem = x.n_elem;

  u32 i,j;

  for(i=0, j=1; j<n_elem; i+=2, j+=2)
    {
    --(memptr[i]);
    --(memptr[j]);
    }
  
  if(i < n_elem)
    {
    --(memptr[i]);
    }
  }

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

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

Definition at line 3344 of file Mat_meat.hpp.

  {
  x -= T(1);
  }

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

postfix --

Definition at line 3355 of file Mat_meat.hpp.

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

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

  {
        eT* memptr = x.memptr();
  const u32 n_elem = x.n_elem;

  u32 i,j;

  for(i=0, j=1; j<n_elem; i+=2, j+=2)
    {
    (memptr[i])--;
    (memptr[j])--;
    }
  
  if(i < n_elem)
    {
    (memptr[i])--;
    }
  }

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

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

Definition at line 3380 of file Mat_meat.hpp.

  {
  x -= T(1);
  }