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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::operator+= (const eT val) |
In-place addition of a scalar to all elements of the matrix. | |
arma_inline const Mat & | Mat::operator-= (const eT val) |
In-place subtraction of a scalar from all elements of the matrix. | |
arma_inline const Mat & | Mat::operator*= (const eT val) |
In-place multiplication of all elements of the matrix with a scalar. | |
arma_inline const Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::operator+= (const Mat &m) |
in-place matrix addition | |
const Mat & | Mat::operator-= (const Mat &m) |
in-place matrix subtraction | |
const Mat & | Mat::operator*= (const Mat &m) |
in-place matrix multiplication | |
const Mat & | Mat::operator%= (const Mat &m) |
in-place element-wise matrix multiplication | |
const Mat & | Mat::operator/= (const Mat &m) |
in-place element-wise matrix division | |
template<typename T1 , typename T2 > | |
Mat::Mat (const Base< pod_type, T1 > &A, const Base< 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 Mat & | Mat::operator= (const subview< eT > &X) |
construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation) | |
const Mat & | Mat::operator+= (const subview< eT > &X) |
in-place matrix addition (using a submatrix on the right-hand-side) | |
const Mat & | Mat::operator-= (const subview< eT > &X) |
in-place matrix subtraction (using a submatrix on the right-hand-side) | |
const Mat & | Mat::operator*= (const subview< eT > &X) |
in-place matrix mutiplication (using a submatrix on the right-hand-side) | |
const Mat & | Mat::operator%= (const subview< eT > &X) |
in-place element-wise matrix mutiplication (using a submatrix on the right-hand-side) | |
const Mat & | Mat::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 Mat & | Mat::operator= (const subview_cube< eT > &X) |
construct a matrix from a subview_cube instance | |
const Mat & | Mat::operator+= (const subview_cube< eT > &X) |
in-place matrix addition (using a single-slice subcube on the right-hand-side) | |
const Mat & | Mat::operator-= (const subview_cube< eT > &X) |
in-place matrix subtraction (using a single-slice subcube on the right-hand-side) | |
const Mat & | Mat::operator*= (const subview_cube< eT > &X) |
in-place matrix mutiplication (using a single-slice subcube on the right-hand-side) | |
const Mat & | Mat::operator%= (const subview_cube< eT > &X) |
in-place element-wise matrix mutiplication (using a single-slice subcube on the right-hand-side) | |
const Mat & | Mat::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 Mat & | Mat::operator= (const diagview< eT > &X) |
construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation) | |
const Mat & | Mat::operator+= (const diagview< eT > &X) |
in-place matrix addition (using a diagview on the right-hand-side) | |
const Mat & | Mat::operator-= (const diagview< eT > &X) |
in-place matrix subtraction (using a diagview on the right-hand-side) | |
const Mat & | Mat::operator*= (const diagview< eT > &X) |
in-place matrix mutiplication (using a diagview on the right-hand-side) | |
const Mat & | Mat::operator%= (const diagview< eT > &X) |
in-place element-wise matrix mutiplication (using a diagview on the right-hand-side) | |
const Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::operator+= (const eOp< T1, eop_type > &X) |
template<typename T1 , typename eop_type > | |
const Mat & | Mat::operator-= (const eOp< T1, eop_type > &X) |
template<typename T1 , typename eop_type > | |
const Mat & | Mat::operator*= (const eOp< T1, eop_type > &X) |
template<typename T1 , typename eop_type > | |
const Mat & | Mat::operator%= (const eOp< T1, eop_type > &X) |
template<typename T1 , typename eop_type > | |
const Mat & | Mat::operator/= (const eOp< T1, eop_type > &X) |
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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::operator+= (const Glue< T1, T2, glue_times > &X) |
template<typename T1 , typename T2 > | |
const Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::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 Mat & | Mat::operator*= (const eGlue< T1, T2, eglue_type > &X) |
template<typename T1 , typename T2 , typename eglue_type > | |
const Mat & | Mat::operator%= (const eGlue< T1, T2, eglue_type > &X) |
template<typename T1 , typename T2 , typename eglue_type > | |
const Mat & | Mat::operator/= (const eGlue< T1, T2, eglue_type > &X) |
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 Mat & | Mat::operator++ () |
prefix ++ | |
arma_inline void | Mat::operator++ (int) |
postfix ++ (must not return the object by reference) | |
arma_inline const Mat & | Mat::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 () |
void | Mat::save (const std::string name, const file_type type=arma_binary) const |
save the matrix to a file | |
void | Mat::save (std::ostream &os, const file_type type=arma_binary) const |
save the matrix to a stream | |
void | Mat::load (const std::string name, const file_type type=auto_detect) |
load a matrix from a file | |
void | Mat::load (std::istream &is, const file_type type=auto_detect) |
load a matrix from a stream | |
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) |
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.
00024 { 00025 arma_extra_debug_sigprint_this(this); 00026 00027 if(use_aux_mem == false) 00028 { 00029 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00030 { 00031 delete [] mem; 00032 } 00033 } 00034 00035 if(arma_config::debug == true) 00036 { 00037 // try to expose buggy user code that accesses deleted objects 00038 access::rw(n_rows) = 0; 00039 access::rw(n_cols) = 0; 00040 access::rw(n_elem) = 0; 00041 access::rw(mem) = 0; 00042 } 00043 00044 isnt_supported_elem_type<eT>::check(); 00045 }
Definition at line 51 of file Mat_meat.hpp.
construct the matrix to have user specified dimensions
Definition at line 66 of file Mat_meat.hpp.
References Mat< eT >::init().
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().
00086 { 00087 arma_extra_debug_sigprint( arma_boost::format("in_n_rows = %d, in_n_cols = %d") % in_n_rows % in_n_cols ); 00088 00089 const u32 new_n_elem = in_n_rows * in_n_cols; 00090 00091 if(n_elem == new_n_elem) 00092 { 00093 access::rw(n_rows) = in_n_rows; 00094 access::rw(n_cols) = in_n_cols; 00095 } 00096 else 00097 { 00098 arma_debug_check 00099 ( 00100 (use_aux_mem == true), 00101 "Mat::init(): can't change the amount of memory as auxiliary memory is in use" 00102 ); 00103 00104 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00105 { 00106 delete [] mem; 00107 } 00108 00109 if(new_n_elem <= sizeof(mem_local)/sizeof(eT) ) 00110 { 00111 access::rw(mem) = mem_local; 00112 } 00113 else 00114 { 00115 access::rw(mem) = new(std::nothrow) eT[new_n_elem]; 00116 arma_check( (mem == 0), "Mat::init(): out of memory" ); 00117 } 00118 00119 access::rw(n_elem) = new_n_elem; 00120 00121 if(new_n_elem == 0) 00122 { 00123 access::rw(n_rows) = 0; 00124 access::rw(n_cols) = 0; 00125 } 00126 else 00127 { 00128 access::rw(n_rows) = in_n_rows; 00129 access::rw(n_cols) = in_n_cols; 00130 } 00131 00132 } 00133 }
create the matrix from a textual description
Definition at line 139 of file Mat_meat.hpp.
References Mat< eT >::init().
const Mat< eT > & Mat< eT >::operator= | ( | const char * | text | ) | [inline, inherited] |
create the matrix from a textual description
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 158 of file Mat_meat.hpp.
References Mat< eT >::init().
Referenced by Mat< eT >::Mat().
00159 { 00160 arma_extra_debug_sigprint(); 00161 00162 init( std::string(text) ); 00163 return *this; 00164 }
create the matrix from a textual description
Definition at line 171 of file Mat_meat.hpp.
References Mat< eT >::init().
const Mat< eT > & Mat< eT >::operator= | ( | const std::string & | text | ) | [inline, inherited] |
create the matrix from a textual description
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 190 of file Mat_meat.hpp.
References Mat< eT >::init().
00191 { 00192 arma_extra_debug_sigprint(); 00193 00194 init(text); 00195 return *this; 00196 }
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().
00205 { 00206 arma_extra_debug_sigprint(); 00207 00208 // 00209 // work out the size 00210 00211 u32 t_n_rows = 0; 00212 u32 t_n_cols = 0; 00213 00214 bool t_n_cols_found = false; 00215 00216 std::string token; 00217 00218 std::string::size_type line_start = 0; 00219 std::string::size_type line_end = 0; 00220 00221 while( line_start < text.length() ) 00222 { 00223 00224 line_end = text.find(';', line_start); 00225 00226 if(line_end == std::string::npos) 00227 line_end = text.length()-1; 00228 00229 std::string::size_type line_len = line_end - line_start + 1; 00230 std::stringstream line_stream( text.substr(line_start,line_len) ); 00231 00232 00233 u32 line_n_cols = 0; 00234 while(line_stream >> token) 00235 { 00236 ++line_n_cols; 00237 } 00238 00239 00240 if(line_n_cols > 0) 00241 { 00242 if(t_n_cols_found == false) 00243 { 00244 t_n_cols = line_n_cols; 00245 t_n_cols_found = true; 00246 } 00247 else 00248 arma_check( (line_n_cols != t_n_cols), "Mat::init(): inconsistent number of columns in given string"); 00249 00250 ++t_n_rows; 00251 } 00252 line_start = line_end+1; 00253 00254 } 00255 00256 Mat<eT>& x = *this; 00257 x.set_size(t_n_rows, t_n_cols); 00258 00259 line_start = 0; 00260 line_end = 0; 00261 00262 u32 row = 0; 00263 00264 while( line_start < text.length() ) 00265 { 00266 00267 line_end = text.find(';', line_start); 00268 00269 if(line_end == std::string::npos) 00270 line_end = text.length()-1; 00271 00272 std::string::size_type line_len = line_end - line_start + 1; 00273 std::stringstream line_stream( text.substr(line_start,line_len) ); 00274 00275 // u32 col = 0; 00276 // while(line_stream >> token) 00277 // { 00278 // x.at(row,col) = strtod(token.c_str(), 0); 00279 // ++col; 00280 // } 00281 00282 u32 col = 0; 00283 eT val; 00284 while(line_stream >> val) 00285 { 00286 x.at(row,col) = val; 00287 ++col; 00288 } 00289 00290 ++row; 00291 line_start = line_end+1; 00292 } 00293 00294 }
arma_inline const Mat< eT > & Mat< eT >::operator= | ( | const eT | val | ) | [inline, inherited] |
Set the matrix to be equal to the specified scalar. NOTE: the size of the matrix will be 1x1.
Definition at line 303 of file Mat_meat.hpp.
References Mat< eT >::init(), Mat< eT >::mem, and access::rw().
00304 { 00305 arma_extra_debug_sigprint(); 00306 00307 init(1,1); 00308 access::rw(mem[0]) = val; 00309 return *this; 00310 }
arma_inline const Mat< eT > & Mat< eT >::operator+= | ( | const eT | val | ) | [inline, inherited] |
In-place addition of a scalar to all elements of the matrix.
Definition at line 318 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
00319 { 00320 arma_extra_debug_sigprint(); 00321 00322 eT* local_ptr = memptr(); 00323 const u32 local_n_elem = n_elem; 00324 00325 u32 i,j; 00326 00327 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00328 { 00329 local_ptr[i] += val; 00330 local_ptr[j] += val; 00331 } 00332 00333 if(i < local_n_elem) 00334 { 00335 local_ptr[i] += val; 00336 } 00337 00338 return *this; 00339 }
arma_inline const Mat< eT > & Mat< eT >::operator-= | ( | const eT | val | ) | [inline, inherited] |
In-place subtraction of a scalar from all elements of the matrix.
Definition at line 347 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
00348 { 00349 arma_extra_debug_sigprint(); 00350 00351 eT* local_ptr = memptr(); 00352 const u32 local_n_elem = n_elem; 00353 00354 u32 i,j; 00355 00356 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00357 { 00358 local_ptr[i] -= val; 00359 local_ptr[j] -= val; 00360 } 00361 00362 if(i < local_n_elem) 00363 { 00364 local_ptr[i] -= val; 00365 } 00366 00367 return *this; 00368 }
arma_inline const Mat< eT > & Mat< eT >::operator*= | ( | const eT | val | ) | [inline, inherited] |
In-place multiplication of all elements of the matrix with a scalar.
Definition at line 376 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
00377 { 00378 arma_extra_debug_sigprint(); 00379 00380 eT* local_ptr = memptr(); 00381 const u32 local_n_elem = n_elem; 00382 00383 u32 i,j; 00384 00385 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00386 { 00387 local_ptr[i] *= val; 00388 local_ptr[j] *= val; 00389 } 00390 00391 if(i < local_n_elem) 00392 { 00393 local_ptr[i] *= val; 00394 } 00395 00396 return *this; 00397 }
arma_inline const Mat< eT > & Mat< eT >::operator/= | ( | const eT | val | ) | [inline, inherited] |
In-place division of all elements of the matrix with a scalar.
Definition at line 405 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
00406 { 00407 arma_extra_debug_sigprint(); 00408 00409 eT* local_ptr = memptr(); 00410 const u32 local_n_elem = n_elem; 00411 00412 u32 i,j; 00413 00414 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00415 { 00416 local_ptr[i] /= val; 00417 local_ptr[j] /= val; 00418 } 00419 00420 if(i < local_n_elem) 00421 { 00422 local_ptr[i] /= val; 00423 } 00424 00425 return *this; 00426 }
construct a matrix from a given matrix
Definition at line 433 of file Mat_meat.hpp.
References Mat< eT >::init().
00434 : n_rows(0) 00435 , n_cols(0) 00436 , n_elem(0) 00437 , use_aux_mem(false) 00438 //, mem(0) 00439 , mem(mem) 00440 { 00441 arma_extra_debug_sigprint(arma_boost::format("this = %x in_mat = %x") % this % &in_mat); 00442 00443 init(in_mat); 00444 }
const Mat< eT > & Mat< eT >::operator= | ( | const Mat< eT > & | m | ) | [inline, inherited] |
construct a matrix from a given matrix
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 452 of file Mat_meat.hpp.
References Mat< eT >::init().
00453 { 00454 arma_extra_debug_sigprint(); 00455 00456 init(x); 00457 return *this; 00458 }
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.
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.
00487 : n_rows (copy_aux_mem ? 0 : aux_n_rows ) 00488 , n_cols (copy_aux_mem ? 0 : aux_n_cols ) 00489 , n_elem (copy_aux_mem ? 0 : aux_n_rows*aux_n_cols) 00490 , use_aux_mem(copy_aux_mem ? false : true ) 00491 , mem (copy_aux_mem ? mem : aux_mem ) 00492 { 00493 arma_extra_debug_sigprint_this(this); 00494 00495 if(copy_aux_mem == true) 00496 { 00497 init(aux_n_rows, aux_n_cols); 00498 syslib::copy_elem( memptr(), aux_mem, n_elem ); 00499 } 00500 }
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.
00509 : n_rows(0) 00510 , n_cols(0) 00511 , n_elem(0) 00512 , use_aux_mem(false) 00513 //, mem(0) 00514 , mem(mem) 00515 { 00516 arma_extra_debug_sigprint_this(this); 00517 00518 init(aux_n_rows, aux_n_cols); 00519 syslib::copy_elem( memptr(), aux_mem, n_elem ); 00520 }
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.
00531 : n_rows (aux_n_rows ) 00532 , n_cols (aux_n_cols ) 00533 , n_elem (aux_n_rows*aux_n_cols) 00534 , use_aux_mem(true ) 00535 , mem (aux_mem ) 00536 { 00537 arma_extra_debug_sigprint_this(this); 00538 }
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.
00547 { 00548 arma_extra_debug_sigprint(); 00549 00550 arma_debug_assert_same_size(*this, m, "matrix addition"); 00551 00552 const u32 local_n_elem = m.n_elem; 00553 00554 eT* out_mem = (*this).memptr(); 00555 const eT* m_mem = m.memptr(); 00556 00557 u32 i,j; 00558 00559 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00560 { 00561 out_mem[i] += m_mem[i]; 00562 out_mem[j] += m_mem[j]; 00563 } 00564 00565 if(i < local_n_elem) 00566 { 00567 out_mem[i] += m_mem[i]; 00568 } 00569 00570 return *this; 00571 }
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.
00580 { 00581 arma_extra_debug_sigprint(); 00582 00583 arma_debug_assert_same_size(*this, m, "matrix subtraction"); 00584 00585 const u32 local_n_elem = m.n_elem; 00586 00587 eT* out_mem = (*this).memptr(); 00588 const eT* m_mem = m.memptr(); 00589 00590 u32 i,j; 00591 00592 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00593 { 00594 out_mem[i] -= m_mem[i]; 00595 out_mem[j] -= m_mem[j]; 00596 } 00597 00598 if(i < local_n_elem) 00599 { 00600 out_mem[i] -= m_mem[i]; 00601 } 00602 00603 return *this; 00604 }
const Mat< eT > & Mat< eT >::operator*= | ( | const Mat< eT > & | m | ) | [inline, inherited] |
in-place matrix multiplication
Reimplemented in Row< eT >.
Definition at line 612 of file Mat_meat.hpp.
References glue_times::apply_inplace().
00613 { 00614 arma_extra_debug_sigprint(); 00615 00616 glue_times::apply_inplace(*this, m); 00617 return *this; 00618 }
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.
00627 { 00628 arma_extra_debug_sigprint(); 00629 00630 arma_debug_assert_same_size(*this, m, "element-wise matrix multplication"); 00631 00632 const u32 local_n_elem = m.n_elem; 00633 00634 eT* out_mem = (*this).memptr(); 00635 const eT* m_mem = m.memptr(); 00636 00637 u32 i,j; 00638 00639 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00640 { 00641 out_mem[i] *= m_mem[i]; 00642 out_mem[j] *= m_mem[j]; 00643 } 00644 00645 if(i < local_n_elem) 00646 { 00647 out_mem[i] *= m_mem[i]; 00648 } 00649 00650 return *this; 00651 }
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.
00660 { 00661 arma_extra_debug_sigprint(); 00662 00663 arma_debug_assert_same_size(*this, m, "element-wise matrix division"); 00664 00665 const u32 local_n_elem = m.n_elem; 00666 00667 eT* out_mem = (*this).memptr(); 00668 const eT* m_mem = m.memptr(); 00669 00670 u32 i,j; 00671 00672 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 00673 { 00674 out_mem[i] /= m_mem[i]; 00675 out_mem[j] /= m_mem[j]; 00676 } 00677 00678 if(i < local_n_elem) 00679 { 00680 out_mem[i] /= m_mem[i]; 00681 } 00682 00683 return *this; 00684 }
Mat< eT >::Mat | ( | const Base< pod_type, T1 > & | A, | |
const Base< pod_type, T2 > & | B | |||
) | [inline, explicit, 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().
00697 : n_rows(0) 00698 , n_cols(0) 00699 , n_elem(0) 00700 , use_aux_mem(false) 00701 //, mem(0) 00702 , mem(mem) 00703 { 00704 arma_extra_debug_sigprint_this(this); 00705 00706 arma_type_check< is_complex<eT>::value == false >::apply(); //!< compile-time abort if eT isn't std::complex 00707 00708 typedef typename T1::elem_type T; 00709 arma_type_check< is_complex<T>::value == true >::apply(); //!< compile-time abort if T is std::complex 00710 00711 isnt_same_type<std::complex<T>, eT>::check(); //!< compile-time abort if types are not compatible 00712 00713 const unwrap<T1> tmp_A(A.get_ref()); 00714 const unwrap<T2> tmp_B(B.get_ref()); 00715 00716 const Mat<T>& X = tmp_A.M; 00717 const Mat<T>& Y = tmp_B.M; 00718 00719 arma_assert_same_size(X, Y, "Mat()"); 00720 00721 init(X.n_rows, Y.n_cols); 00722 00723 const T* X_mem = X.mem; 00724 const T* Y_mem = Y.mem; 00725 00726 for(u32 i=0; i<n_elem; ++i) 00727 { 00728 access::rw(mem[i]) = std::complex<T>(X_mem[i], Y_mem[i]); 00729 } 00730 }
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=().
const Mat< eT > & Mat< eT >::operator= | ( | const subview< eT > & | X | ) | [inline, inherited] |
construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 756 of file Mat_meat.hpp.
00757 { 00758 arma_extra_debug_sigprint(); 00759 00760 subview<eT>::extract(*this, X); 00761 return *this; 00762 }
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.
00770 { 00771 arma_extra_debug_sigprint(); 00772 00773 subview<eT>::plus_inplace(*this, X); 00774 return *this; 00775 }
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.
00783 { 00784 arma_extra_debug_sigprint(); 00785 00786 subview<eT>::minus_inplace(*this, X); 00787 return *this; 00788 }
const Mat< eT > & Mat< eT >::operator*= | ( | const subview< eT > & | X | ) | [inline, inherited] |
in-place matrix mutiplication (using a submatrix on the right-hand-side)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 796 of file Mat_meat.hpp.
References glue_times::apply_inplace().
00797 { 00798 arma_extra_debug_sigprint(); 00799 00800 glue_times::apply_inplace(*this, X); 00801 return *this; 00802 }
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.
00811 { 00812 arma_extra_debug_sigprint(); 00813 00814 subview<eT>::schur_inplace(*this, X); 00815 return *this; 00816 }
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.
00825 { 00826 arma_extra_debug_sigprint(); 00827 00828 subview<eT>::div_inplace(*this, X); 00829 return *this; 00830 }
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=().
const Mat< eT > & Mat< eT >::operator= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
construct a matrix from a subview_cube instance
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 856 of file Mat_meat.hpp.
00857 { 00858 arma_extra_debug_sigprint(); 00859 00860 subview_cube<eT>::extract(*this, X); 00861 return *this; 00862 }
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.
00871 { 00872 arma_extra_debug_sigprint(); 00873 00874 subview_cube<eT>::plus_inplace(*this, X); 00875 return *this; 00876 }
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.
00885 { 00886 arma_extra_debug_sigprint(); 00887 00888 subview_cube<eT>::minus_inplace(*this, X); 00889 return *this; 00890 }
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)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 898 of file Mat_meat.hpp.
References glue_times::apply_inplace().
00899 { 00900 arma_extra_debug_sigprint(); 00901 00902 const Mat<eT> tmp(X); 00903 glue_times::apply_inplace(*this, tmp); 00904 return *this; 00905 }
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.
00914 { 00915 arma_extra_debug_sigprint(); 00916 00917 subview_cube<eT>::schur_inplace(*this, X); 00918 return *this; 00919 }
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.
00928 { 00929 arma_extra_debug_sigprint(); 00930 00931 subview_cube<eT>::div_inplace(*this, X); 00932 return *this; 00933 }
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=().
const Mat< eT > & Mat< eT >::operator= | ( | const diagview< eT > & | X | ) | [inline, inherited] |
construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 959 of file Mat_meat.hpp.
00960 { 00961 arma_extra_debug_sigprint(); 00962 00963 diagview<eT>::extract(*this, X); 00964 return *this; 00965 }
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.
00974 { 00975 arma_extra_debug_sigprint(); 00976 00977 diagview<eT>::plus_inplace(*this, X); 00978 return *this; 00979 }
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.
00987 { 00988 arma_extra_debug_sigprint(); 00989 00990 diagview<eT>::minus_inplace(*this, X); 00991 return *this; 00992 }
const Mat< eT > & Mat< eT >::operator*= | ( | const diagview< eT > & | X | ) | [inline, inherited] |
in-place matrix mutiplication (using a diagview on the right-hand-side)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1000 of file Mat_meat.hpp.
References glue_times::apply_inplace().
01001 { 01002 arma_extra_debug_sigprint(); 01003 01004 glue_times::apply_inplace(*this, X); 01005 return *this; 01006 }
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.
01015 { 01016 arma_extra_debug_sigprint(); 01017 01018 diagview<eT>::schur_inplace(*this, X); 01019 return *this; 01020 }
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.
01029 { 01030 arma_extra_debug_sigprint(); 01031 01032 diagview<eT>::div_inplace(*this, X); 01033 return *this; 01034 }
arma_inline subview_row< eT > Mat< eT >::row | ( | const u32 | row_num | ) | [inline, inherited] |
creation of subview (row vector)
Reimplemented in Col< eT >.
Definition at line 1042 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
Referenced by op_shuffle::apply(), op_flipud::apply(), Mat< eT >::init(), diskio::load_arma_ascii(), diskio::load_pgm_binary(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), diskio::load_std_string(), diskio::save_arma_ascii(), diskio::save_pgm_binary(), diskio::save_ppm_binary(), diskio::save_raw_ascii(), diskio::save_std_string(), and Mat< eT >::swap_cols().
01043 { 01044 arma_extra_debug_sigprint(); 01045 01046 arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" ); 01047 01048 return subview_row<eT>(*this, row_num); 01049 }
arma_inline const subview_row< eT > Mat< eT >::row | ( | const u32 | row_num | ) | const [inline, inherited] |
creation of subview (row vector)
Reimplemented in Col< eT >.
Definition at line 1057 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
01058 { 01059 arma_extra_debug_sigprint(); 01060 01061 arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" ); 01062 01063 return subview_row<eT>(*this, row_num); 01064 }
arma_inline subview_col< eT > Mat< eT >::col | ( | const u32 | col_num | ) | [inline, inherited] |
creation of subview (column vector)
Reimplemented in Row< eT >.
Definition at line 1072 of file Mat_meat.hpp.
References Mat< eT >::n_cols.
Referenced by op_shuffle::apply(), op_fliplr::apply(), Mat< eT >::init(), diskio::load_arma_ascii(), diskio::load_pgm_binary(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), diskio::load_std_string(), diskio::save_arma_ascii(), diskio::save_pgm_binary(), diskio::save_ppm_binary(), diskio::save_raw_ascii(), diskio::save_std_string(), and Mat< eT >::swap_rows().
01073 { 01074 arma_extra_debug_sigprint(); 01075 01076 arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); 01077 01078 return subview_col<eT>(*this, col_num); 01079 }
arma_inline const subview_col< eT > Mat< eT >::col | ( | const u32 | col_num | ) | const [inline, inherited] |
creation of subview (column vector)
Reimplemented in Row< eT >.
Definition at line 1087 of file Mat_meat.hpp.
References Mat< eT >::n_cols.
01088 { 01089 arma_extra_debug_sigprint(); 01090 01091 arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); 01092 01093 return subview_col<eT>(*this, col_num); 01094 }
arma_inline subview< eT > Mat< eT >::rows | ( | const u32 | in_row1, | |
const u32 | in_row2 | |||
) | [inline, inherited] |
creation of subview (submatrix comprised of specified row vectors)
Reimplemented in Col< eT >.
Definition at line 1102 of file Mat_meat.hpp.
References Mat< eT >::n_cols, and Mat< eT >::n_rows.
Referenced by find().
01103 { 01104 arma_extra_debug_sigprint(); 01105 01106 arma_debug_check 01107 ( 01108 (in_row1 > in_row2) || (in_row2 >= n_rows), 01109 "Mat::rows(): indices out of bounds or incorrectly used" 01110 ); 01111 01112 return subview<eT>(*this, in_row1, 0, in_row2, ((n_cols>0) ? n_cols-1 : 0) ); 01113 }
arma_inline const subview< eT > Mat< eT >::rows | ( | const u32 | in_row1, | |
const u32 | in_row2 | |||
) | const [inline, inherited] |
creation of subview (submatrix comprised of specified row vectors)
Reimplemented in Col< eT >.
Definition at line 1121 of file Mat_meat.hpp.
References Mat< eT >::n_cols, and Mat< eT >::n_rows.
01122 { 01123 arma_extra_debug_sigprint(); 01124 01125 arma_debug_check 01126 ( 01127 (in_row1 > in_row2) || (in_row2 >= n_rows), 01128 "Mat::rows(): indices out of bounds or incorrectly used" 01129 ); 01130 01131 return subview<eT>(*this, in_row1, 0, in_row2, ((n_cols>0) ? n_cols-1 : 0) ); 01132 }
arma_inline subview< eT > Mat< eT >::cols | ( | const u32 | in_col1, | |
const u32 | in_col2 | |||
) | [inline, inherited] |
creation of subview (submatrix comprised of specified column vectors)
Reimplemented in Row< eT >.
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().
01141 { 01142 arma_extra_debug_sigprint(); 01143 01144 arma_debug_check 01145 ( 01146 (in_col1 > in_col2) || (in_col2 >= n_cols), 01147 "Mat::cols(): indices out of bounds or incorrectly used" 01148 ); 01149 01150 return subview<eT>(*this, 0, in_col1, ((n_rows>0) ? n_rows-1 : 0), in_col2); 01151 }
arma_inline const subview< eT > Mat< eT >::cols | ( | const u32 | in_col1, | |
const u32 | in_col2 | |||
) | const [inline, inherited] |
creation of subview (submatrix comprised of specified column vectors)
Reimplemented in Row< eT >.
Definition at line 1159 of file Mat_meat.hpp.
References Mat< eT >::n_cols, and Mat< eT >::n_rows.
01160 { 01161 arma_extra_debug_sigprint(); 01162 01163 arma_debug_check 01164 ( 01165 (in_col1 > in_col2) || (in_col2 >= n_cols), 01166 "Mat::cols(): indices out of bounds or incorrectly used" 01167 ); 01168 01169 return subview<eT>(*this, 0, in_col1, ((n_rows>0) ? n_rows-1 : 0), in_col2); 01170 }
arma_inline subview< eT > Mat< eT >::submat | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_row2, | |||
const u32 | in_col2 | |||
) | [inline, inherited] |
creation of subview (submatrix)
Definition at line 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().
01179 { 01180 arma_extra_debug_sigprint(); 01181 01182 arma_debug_check 01183 ( 01184 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 01185 "Mat::submat(): indices out of bounds or incorrectly used" 01186 ); 01187 01188 return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2); 01189 }
arma_inline const subview< eT > Mat< eT >::submat | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_row2, | |||
const u32 | in_col2 | |||
) | const [inline, inherited] |
creation of subview (generic submatrix)
Definition at line 1197 of file Mat_meat.hpp.
References Mat< eT >::n_cols, and Mat< eT >::n_rows.
01198 { 01199 arma_extra_debug_sigprint(); 01200 01201 arma_debug_check 01202 ( 01203 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), 01204 "Mat::submat(): indices out of bounds or incorrectly used" 01205 ); 01206 01207 return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2); 01208 }
arma_inline diagview< eT > Mat< eT >::diag | ( | const s32 | in_id = 0 |
) | [inline, inherited] |
creation of diagview (diagonal)
Definition at line 1216 of file Mat_meat.hpp.
References min(), Mat< eT >::n_cols, and Mat< eT >::n_rows.
Referenced by op_diagvec::apply().
01217 { 01218 arma_extra_debug_sigprint(); 01219 01220 const u32 row_offset = (in_id < 0) ? -in_id : 0; 01221 const u32 col_offset = (in_id > 0) ? in_id : 0; 01222 01223 arma_debug_check 01224 ( 01225 (row_offset >= n_rows) || (col_offset >= n_cols), 01226 "Mat::diag(): requested diagonal out of bounds" 01227 ); 01228 01229 const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset); 01230 01231 return diagview<eT>(*this, row_offset, col_offset, len); 01232 }
arma_inline const diagview< eT > Mat< eT >::diag | ( | const s32 | in_id = 0 |
) | const [inline, inherited] |
creation of diagview (diagonal)
Definition at line 1240 of file Mat_meat.hpp.
References min(), Mat< eT >::n_cols, and Mat< eT >::n_rows.
01241 { 01242 arma_extra_debug_sigprint(); 01243 01244 const u32 row_offset = (in_id < 0) ? -in_id : 0; 01245 const u32 col_offset = (in_id > 0) ? in_id : 0; 01246 01247 arma_debug_check 01248 ( 01249 (row_offset >= n_rows) || (col_offset >= n_cols), 01250 "Mat::diag(): requested diagonal out of bounds" 01251 ); 01252 01253 01254 const u32 len = (std::min)(n_rows - row_offset, n_cols - col_offset); 01255 01256 return diagview<eT>(*this, row_offset, col_offset, len); 01257 }
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().
01265 { 01266 arma_extra_debug_sigprint(); 01267 01268 arma_debug_check 01269 ( 01270 (in_row1 >= n_rows) || (in_row2 >= n_rows), 01271 "Mat::swap_rows(): out of bounds" 01272 ); 01273 01274 for(u32 col=0; col<n_cols; ++col) 01275 { 01276 const u32 offset = col*n_rows; 01277 const u32 pos1 = in_row1 + offset; 01278 const u32 pos2 = in_row2 + offset; 01279 01280 const eT tmp = mem[pos1]; 01281 access::rw(mem[pos1]) = mem[pos2]; 01282 access::rw(mem[pos2]) = tmp; 01283 } 01284 01285 }
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().
01293 { 01294 arma_extra_debug_sigprint(); 01295 01296 arma_debug_check 01297 ( 01298 (in_col1 >= n_cols) || (in_col2 >= n_cols), 01299 "Mat::swap_cols(): out of bounds" 01300 ); 01301 01302 eT* ptr1 = colptr(in_col1); 01303 eT* ptr2 = colptr(in_col2); 01304 01305 for(u32 row=0; row<n_rows; ++row) 01306 { 01307 const eT tmp = ptr1[row]; 01308 ptr1[row] = ptr2[row]; 01309 ptr2[row] = tmp; 01310 } 01311 01312 }
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.
01321 : n_rows(0) 01322 , n_cols(0) 01323 , n_elem(0) 01324 , use_aux_mem(false) 01325 //, mem(0) 01326 , mem(mem) 01327 { 01328 arma_extra_debug_sigprint_this(this); 01329 01330 isnt_same_type<eT, typename T1::elem_type>::check(); 01331 01332 op_type::apply(*this, X); 01333 }
const Mat< eT > & Mat< eT >::operator= | ( | const Op< T1, op_type > & | X | ) | [inline, inherited] |
create a matrix from Op, i.e. run the previously delayed unary operations
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1342 of file Mat_meat.hpp.
01343 { 01344 arma_extra_debug_sigprint(); 01345 01346 isnt_same_type<eT, typename T1::elem_type>::check(); 01347 01348 op_type::apply(*this, X); 01349 01350 return *this; 01351 }
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.
01361 { 01362 arma_extra_debug_sigprint(); 01363 01364 isnt_same_type<eT, typename T1::elem_type>::check(); 01365 01366 const Mat<eT> m(X); 01367 01368 return (*this).operator+=(m); 01369 }
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.
01379 { 01380 arma_extra_debug_sigprint(); 01381 01382 isnt_same_type<eT, typename T1::elem_type>::check(); 01383 01384 const Mat<eT> m(X); 01385 01386 return (*this).operator-=(m); 01387 }
const Mat< eT > & Mat< eT >::operator*= | ( | const Op< T1, op_type > & | X | ) | [inline, inherited] |
in-place matrix multiplication, with the right-hand-side operand having delayed operations
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1396 of file Mat_meat.hpp.
References glue_times::apply_inplace().
01397 { 01398 arma_extra_debug_sigprint(); 01399 01400 isnt_same_type<eT, typename T1::elem_type>::check(); 01401 01402 glue_times::apply_inplace(*this, X); 01403 01404 return *this; 01405 }
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.
01415 { 01416 arma_extra_debug_sigprint(); 01417 01418 isnt_same_type<eT, typename T1::elem_type>::check(); 01419 01420 const Mat<eT> m(X); 01421 01422 return (*this).operator%=(m); 01423 }
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.
01433 { 01434 arma_extra_debug_sigprint(); 01435 01436 isnt_same_type<eT, typename T1::elem_type>::check(); 01437 01438 const Mat<eT> m(X); 01439 01440 return (*this).operator/=(m); 01441 }
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.
01450 : n_rows(0) 01451 , n_cols(0) 01452 , n_elem(0) 01453 , use_aux_mem(false) 01454 //, mem(0) 01455 , mem(mem) 01456 { 01457 arma_extra_debug_sigprint_this(this); 01458 01459 isnt_same_type<eT, typename T1::elem_type>::check(); 01460 01461 eop_type::apply(*this, X); 01462 }
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
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1471 of file Mat_meat.hpp.
01472 { 01473 arma_extra_debug_sigprint(); 01474 01475 isnt_same_type<eT, typename T1::elem_type>::check(); 01476 01477 eop_type::apply(*this, X); 01478 01479 return *this; 01480 }
const Mat< eT > & Mat< eT >::operator+= | ( | const eOp< T1, eop_type > & | X | ) | [inline, inherited] |
Definition at line 1488 of file Mat_meat.hpp.
01489 { 01490 arma_extra_debug_sigprint(); 01491 01492 isnt_same_type<eT, typename T1::elem_type>::check(); 01493 01494 eop_type::apply_inplace_plus(*this, X); 01495 01496 return *this; 01497 }
const Mat< eT > & Mat< eT >::operator-= | ( | const eOp< T1, eop_type > & | X | ) | [inline, inherited] |
Definition at line 1505 of file Mat_meat.hpp.
01506 { 01507 arma_extra_debug_sigprint(); 01508 01509 isnt_same_type<eT, typename T1::elem_type>::check(); 01510 01511 eop_type::apply_inplace_minus(*this, X); 01512 01513 return *this; 01514 }
const Mat< eT > & Mat< eT >::operator*= | ( | const eOp< T1, eop_type > & | X | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1522 of file Mat_meat.hpp.
References glue_times::apply_inplace().
01523 { 01524 arma_extra_debug_sigprint(); 01525 01526 isnt_same_type<eT, typename T1::elem_type>::check(); 01527 01528 glue_times::apply_inplace(*this, X); 01529 01530 return *this; 01531 }
const Mat< eT > & Mat< eT >::operator%= | ( | const eOp< T1, eop_type > & | X | ) | [inline, inherited] |
Definition at line 1539 of file Mat_meat.hpp.
01540 { 01541 arma_extra_debug_sigprint(); 01542 01543 isnt_same_type<eT, typename T1::elem_type>::check(); 01544 01545 eop_type::apply_inplace_schur(*this, X); 01546 01547 return *this; 01548 }
const Mat< eT > & Mat< eT >::operator/= | ( | const eOp< T1, eop_type > & | X | ) | [inline, inherited] |
Definition at line 1556 of file Mat_meat.hpp.
01557 { 01558 arma_extra_debug_sigprint(); 01559 01560 isnt_same_type<eT, typename T1::elem_type>::check(); 01561 01562 eop_type::apply_inplace_div(*this, X); 01563 01564 return *this; 01565 }
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 1573 of file Mat_meat.hpp.
01574 : n_rows(0) 01575 , n_cols(0) 01576 , n_elem(0) 01577 , use_aux_mem(false) 01578 //, mem(0) 01579 , mem(mem) 01580 { 01581 arma_extra_debug_sigprint_this(this); 01582 01583 isnt_same_type<eT, typename T1::elem_type>::check(); 01584 isnt_same_type<eT, typename T2::elem_type>::check(); 01585 01586 glue_type::apply(*this, X); 01587 }
const Mat< eT > & Mat< eT >::operator= | ( | const Glue< T1, T2, glue_type > & | X | ) | [inline, inherited] |
create a matrix from Glue, i.e. run the previously delayed binary operations
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1596 of file Mat_meat.hpp.
01597 { 01598 arma_extra_debug_sigprint(); 01599 01600 isnt_same_type<eT, typename T1::elem_type>::check(); 01601 isnt_same_type<eT, typename T2::elem_type>::check(); 01602 01603 glue_type::apply(*this, X); 01604 01605 return *this; 01606 }
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 1615 of file Mat_meat.hpp.
01616 { 01617 arma_extra_debug_sigprint(); 01618 01619 isnt_same_type<eT, typename T1::elem_type>::check(); 01620 isnt_same_type<eT, typename T2::elem_type>::check(); 01621 01622 const Mat<eT> m(X); 01623 01624 return (*this).operator+=(m); 01625 }
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 1634 of file Mat_meat.hpp.
01635 { 01636 arma_extra_debug_sigprint(); 01637 01638 isnt_same_type<eT, typename T1::elem_type>::check(); 01639 isnt_same_type<eT, typename T2::elem_type>::check(); 01640 01641 const Mat<eT> m(X); 01642 01643 return (*this).operator-=(m); 01644 }
const Mat< eT > & Mat< eT >::operator*= | ( | const Glue< T1, T2, glue_type > & | X | ) | [inline, inherited] |
in-place matrix multiplications, with the right-hand-side operands having delayed operations
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1653 of file Mat_meat.hpp.
References glue_times::apply_inplace().
01654 { 01655 arma_extra_debug_sigprint(); 01656 01657 isnt_same_type<eT, typename T1::elem_type>::check(); 01658 isnt_same_type<eT, typename T2::elem_type>::check(); 01659 01660 glue_times::apply_inplace(*this, X); 01661 01662 return *this; 01663 }
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 1672 of file Mat_meat.hpp.
01673 { 01674 arma_extra_debug_sigprint(); 01675 01676 isnt_same_type<eT, typename T1::elem_type>::check(); 01677 isnt_same_type<eT, typename T2::elem_type>::check(); 01678 01679 const Mat<eT> m(X); 01680 01681 return (*this).operator%=(m); 01682 }
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 1691 of file Mat_meat.hpp.
01692 { 01693 arma_extra_debug_sigprint(); 01694 01695 isnt_same_type<eT, typename T1::elem_type>::check(); 01696 isnt_same_type<eT, typename T2::elem_type>::check(); 01697 01698 const Mat<eT> m(X); 01699 01700 return (*this).operator/=(m); 01701 }
const Mat< eT > & Mat< eT >::operator+= | ( | const Glue< T1, T2, glue_times > & | X | ) | [inline, inherited] |
Definition at line 1709 of file Mat_meat.hpp.
References glue_times::apply_inplace_plus().
01710 { 01711 arma_extra_debug_sigprint(); 01712 01713 glue_times::apply_inplace_plus(*this, X, s32(+1)); 01714 01715 return *this; 01716 }
const Mat< eT > & Mat< eT >::operator-= | ( | const Glue< T1, T2, glue_times > & | X | ) | [inline, inherited] |
Definition at line 1724 of file Mat_meat.hpp.
References glue_times::apply_inplace_plus().
01725 { 01726 arma_extra_debug_sigprint(); 01727 01728 glue_times::apply_inplace_plus(*this, X, s32(-1)); 01729 01730 return *this; 01731 }
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 1739 of file Mat_meat.hpp.
01740 : n_rows(0) 01741 , n_cols(0) 01742 , n_elem(0) 01743 , use_aux_mem(false) 01744 //, mem(0) 01745 , mem(mem) 01746 { 01747 arma_extra_debug_sigprint_this(this); 01748 01749 isnt_same_type<eT, typename T1::elem_type>::check(); 01750 isnt_same_type<eT, typename T2::elem_type>::check(); 01751 01752 eglue_type::apply(*this, X); 01753 }
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
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1762 of file Mat_meat.hpp.
01763 { 01764 arma_extra_debug_sigprint(); 01765 01766 isnt_same_type<eT, typename T1::elem_type>::check(); 01767 isnt_same_type<eT, typename T2::elem_type>::check(); 01768 01769 eglue_type::apply(*this, X); 01770 01771 return *this; 01772 }
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 1781 of file Mat_meat.hpp.
01782 { 01783 arma_extra_debug_sigprint(); 01784 01785 isnt_same_type<eT, typename T1::elem_type>::check(); 01786 isnt_same_type<eT, typename T2::elem_type>::check(); 01787 01788 eglue_type::apply_inplace_plus(*this, X); 01789 01790 return *this; 01791 }
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 1800 of file Mat_meat.hpp.
01801 { 01802 arma_extra_debug_sigprint(); 01803 01804 isnt_same_type<eT, typename T1::elem_type>::check(); 01805 isnt_same_type<eT, typename T2::elem_type>::check(); 01806 01807 eglue_type::apply_inplace_minus(*this, X); 01808 01809 return *this; 01810 }
const Mat< eT > & Mat< eT >::operator*= | ( | const eGlue< T1, T2, eglue_type > & | X | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 1818 of file Mat_meat.hpp.
References glue_times::apply_inplace().
01819 { 01820 arma_extra_debug_sigprint(); 01821 01822 isnt_same_type<eT, typename T1::elem_type>::check(); 01823 isnt_same_type<eT, typename T2::elem_type>::check(); 01824 01825 glue_times::apply_inplace(*this, X); 01826 return *this; 01827 }
const Mat< eT > & Mat< eT >::operator%= | ( | const eGlue< T1, T2, eglue_type > & | X | ) | [inline, inherited] |
Definition at line 1835 of file Mat_meat.hpp.
01836 { 01837 arma_extra_debug_sigprint(); 01838 01839 isnt_same_type<eT, typename T1::elem_type>::check(); 01840 isnt_same_type<eT, typename T2::elem_type>::check(); 01841 01842 eglue_type::apply_inplace_schur(*this, X); 01843 return *this; 01844 }
const Mat< eT > & Mat< eT >::operator/= | ( | const eGlue< T1, T2, eglue_type > & | X | ) | [inline, inherited] |
Definition at line 1852 of file Mat_meat.hpp.
01853 { 01854 arma_extra_debug_sigprint(); 01855 01856 isnt_same_type<eT, typename T1::elem_type>::check(); 01857 isnt_same_type<eT, typename T2::elem_type>::check(); 01858 01859 eglue_type::apply_inplace_div(*this, X); 01860 return *this; 01861 }
linear element accessor (treats the matrix as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 1869 of file Mat_meat.hpp.
References Mat< eT >::mem, Mat< eT >::n_elem, and access::rw().
01870 { 01871 arma_debug_check( (i >= n_elem), "Mat::operator(): out of bounds"); 01872 return access::rw(mem[i]); 01873 }
arma_inline eT Mat< eT >::operator() | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the matrix as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 1881 of file Mat_meat.hpp.
References Mat< eT >::mem, and Mat< eT >::n_elem.
linear element accessor (treats the matrix as a vector); no bounds check.
Definition at line 1892 of file Mat_meat.hpp.
References Mat< eT >::mem, and access::rw().
01893 { 01894 return access::rw(mem[i]); 01895 }
arma_inline eT Mat< eT >::operator[] | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the matrix as a vector); no bounds check
Definition at line 1903 of file Mat_meat.hpp.
References Mat< eT >::mem.
01904 { 01905 return mem[i]; 01906 }
arma_inline eT & Mat< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col | |||
) | [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 1914 of file Mat_meat.hpp.
References Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_rows, and access::rw().
01915 { 01916 arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): out of bounds"); 01917 return access::rw(mem[in_row + in_col*n_rows]); 01918 }
arma_inline eT Mat< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col | |||
) | const [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 1926 of file Mat_meat.hpp.
References Mat< eT >::mem, Mat< eT >::n_cols, and Mat< eT >::n_rows.
arma_inline eT & Mat< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col | |||
) | [inline, inherited] |
element accessor; no bounds check
Definition at line 1938 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_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_ppm_binary(), diskio::save_raw_ascii(), diagview< eT >::schur_inplace(), and diagview< eT >::zeros().
01939 { 01940 return access::rw( mem[in_row + in_col*n_rows] ); 01941 }
arma_inline eT Mat< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col | |||
) | const [inline, inherited] |
element accessor; no bounds check
Definition at line 1949 of file Mat_meat.hpp.
References Mat< eT >::mem, and Mat< eT >::n_rows.
prefix ++
Definition at line 1960 of file Mat_meat.hpp.
References Mat_aux::prefix_pp().
01961 { 01962 Mat_aux::prefix_pp(*this); 01963 return *this; 01964 }
arma_inline void Mat< eT >::operator++ | ( | int | ) | [inline, inherited] |
postfix ++ (must not return the object by reference)
Definition at line 1972 of file Mat_meat.hpp.
References Mat_aux::postfix_pp().
01973 { 01974 Mat_aux::postfix_pp(*this); 01975 }
prefix --
Definition at line 1983 of file Mat_meat.hpp.
References Mat_aux::prefix_mm().
01984 { 01985 Mat_aux::prefix_mm(*this); 01986 return *this; 01987 }
arma_inline void Mat< eT >::operator-- | ( | int | ) | [inline, inherited] |
postfix -- (must not return the object by reference)
Definition at line 1995 of file Mat_meat.hpp.
References Mat_aux::postfix_mm().
01996 { 01997 Mat_aux::postfix_mm(*this); 01998 }
arma_inline bool Mat< eT >::is_vec | ( | ) | const [inline, inherited] |
returns true if the object can be interpreted as a column or row vector
Definition at line 2006 of file Mat_meat.hpp.
References Mat< eT >::n_cols, and Mat< eT >::n_rows.
Referenced by op_shuffle::apply(), op_diagmat::apply(), as_scalar_redirect< 3 >::apply(), as_scalar_diag(), op_cor::direct_cor(), glue_cor::direct_cor(), op_cov::direct_cov(), glue_cov::direct_cov(), and running_stat_vec_aux::update_stats().
arma_inline bool Mat< eT >::is_square | ( | ) | const [inline, inherited] |
returns true if the object has the same number of non-zero rows and columnns
Definition at line 2017 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(), and as_scalar_redirect< 3 >::apply().
arma_inline bool Mat< eT >::is_finite | ( | ) | const [inline, inherited] |
returns true if all of the elements are finite
Definition at line 2028 of file Mat_meat.hpp.
References arma_isfinite(), Mat< eT >::mem, and Mat< eT >::n_elem.
Referenced by op_sort::apply().
02029 { 02030 for(u32 i=0; i<n_elem; ++i) 02031 { 02032 if(arma_isfinite(mem[i]) == false) 02033 { 02034 return false; 02035 } 02036 } 02037 02038 return true; 02039 }
returns a pointer to array of eTs for a specified column; no bounds check
Definition at line 2047 of file Mat_meat.hpp.
References Mat< eT >::mem, Mat< eT >::n_rows, and access::rw().
Referenced by op_var::apply(), op_trans::apply(), op_sum::apply(), op_stddev::apply(), op_sort::apply(), op_prod::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::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(), glue_times::apply_inplace(), Mat< eT >::begin_col(), auxlib::chol(), auxlib::det(), op_dotext::direct_rowvec_mat_colvec(), op_dotext::direct_rowvec_transmat_colvec(), subview< eT >::div_inplace(), subview_cube< eT >::div_inplace(), Mat< eT >::end_col(), subview< eT >::extract(), subview_cube< eT >::extract(), auxlib::inv_inplace(), auxlib::inv_noalias(), subview< eT >::minus_inplace(), subview_cube< eT >::minus_inplace(), subview< eT >::plus_inplace(), subview_cube< eT >::plus_inplace(), subview< eT >::schur_inplace(), subview_cube< eT >::schur_inplace(), auxlib::solve_od(), auxlib::solve_ud(), and Mat< eT >::swap_cols().
02048 { 02049 return & access::rw(mem[in_col*n_rows]); 02050 }
arma_inline const eT * Mat< eT >::colptr | ( | const u32 | in_col | ) | const [inline, inherited] |
returns a pointer to array of eTs for a specified column; no bounds check
Definition at line 2058 of file Mat_meat.hpp.
References Mat< eT >::mem, and Mat< eT >::n_rows.
arma_inline eT * Mat< eT >::memptr | ( | ) | [inline, inherited] |
returns a pointer to array of eTs used by the matrix
Definition at line 2069 of file Mat_meat.hpp.
References Mat< eT >::mem.
Referenced by abs(), op_trans2::apply(), op_sort::apply(), op_reshape::apply(), op_diagmat::apply(), glue_times::apply(), glue_cross::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(), find(), conv_to< Col< out_eT > >::from(), conv_to< Row< out_eT > >::from(), conv_to< Mat< out_eT > >::from(), 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(), operator!=(), operator%(), Mat< eT >::operator%=(), Mat< eT >::operator*=(), operator+(), Mat< eT >::operator+=(), operator-(), Mat< eT >::operator-=(), operator/(), Mat< eT >::operator/=(), operator<(), operator<=(), operator==(), operator>(), 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().
02070 { 02071 return const_cast<eT*>(mem); 02072 }
arma_inline const eT * Mat< eT >::memptr | ( | ) | const [inline, inherited] |
returns a pointer to array of eTs used by the matrix
Definition at line 2080 of file Mat_meat.hpp.
References Mat< eT >::mem.
02081 { 02082 return mem; 02083 }
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 2094 of file Mat_meat.hpp.
Referenced by Mat< eT >::print(), Mat< eT >::print_trans(), and Mat< eT >::raw_print().
02095 { 02096 arma_extra_debug_sigprint(); 02097 02098 if(extra_text.length() != 0) 02099 { 02100 const std::streamsize orig_width = cout.width(); 02101 02102 cout << extra_text << '\n'; 02103 02104 cout.width(orig_width); 02105 } 02106 02107 arma_ostream::print(cout, *this, true); 02108 }
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 2119 of file Mat_meat.hpp.
References Mat< eT >::print().
02120 { 02121 arma_extra_debug_sigprint(); 02122 02123 if(extra_text.length() != 0) 02124 { 02125 const std::streamsize orig_width = user_stream.width(); 02126 02127 user_stream << extra_text << '\n'; 02128 02129 user_stream.width(orig_width); 02130 } 02131 02132 arma_ostream::print(user_stream, *this, true); 02133 }
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 2144 of file Mat_meat.hpp.
References op_trans::apply_noalias(), and Mat< eT >::print().
02145 { 02146 arma_extra_debug_sigprint(); 02147 02148 Mat<eT> tmp; 02149 op_trans::apply_noalias(tmp, *this); 02150 02151 tmp.print(extra_text); 02152 }
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 2163 of file Mat_meat.hpp.
References op_trans::apply_noalias(), and Mat< eT >::print().
02164 { 02165 arma_extra_debug_sigprint(); 02166 02167 Mat<eT> tmp; 02168 op_trans::apply_noalias(tmp, *this); 02169 02170 tmp.print(user_stream, extra_text); 02171 }
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 2182 of file Mat_meat.hpp.
References Mat< eT >::print().
Referenced by Mat< eT >::raw_print_trans().
02183 { 02184 arma_extra_debug_sigprint(); 02185 02186 if(extra_text.length() != 0) 02187 { 02188 const std::streamsize orig_width = cout.width(); 02189 02190 cout << extra_text << '\n'; 02191 02192 cout.width(orig_width); 02193 } 02194 02195 arma_ostream::print(cout, *this, false); 02196 }
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 2207 of file Mat_meat.hpp.
References Mat< eT >::print().
02208 { 02209 arma_extra_debug_sigprint(); 02210 02211 if(extra_text.length() != 0) 02212 { 02213 const std::streamsize orig_width = user_stream.width(); 02214 02215 user_stream << extra_text << '\n'; 02216 02217 user_stream.width(orig_width); 02218 } 02219 02220 arma_ostream::print(user_stream, *this, false); 02221 }
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 2232 of file Mat_meat.hpp.
References op_trans::apply_noalias(), and Mat< eT >::raw_print().
02233 { 02234 arma_extra_debug_sigprint(); 02235 02236 Mat<eT> tmp; 02237 op_trans::apply_noalias(tmp, *this); 02238 02239 tmp.raw_print(extra_text); 02240 }
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 2251 of file Mat_meat.hpp.
References op_trans::apply_noalias(), and Mat< eT >::raw_print().
02252 { 02253 arma_extra_debug_sigprint(); 02254 02255 Mat<eT> tmp; 02256 op_trans::apply_noalias(tmp, *this); 02257 02258 tmp.raw_print(user_stream, extra_text); 02259 }
void Mat< eT >::set_size | ( | const u32 | in_rows, | |
const u32 | in_cols | |||
) | [inline, inherited] |
change the matrix to have user specified dimensions (data is not preserved)
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2267 of file Mat_meat.hpp.
References Mat< eT >::init().
Referenced by op_sum::apply(), op_reshape::apply(), op_repmat::apply(), op_prod::apply(), op_min::apply(), op_median::apply(), op_mean::apply(), op_max::apply(), op_inv::apply(), op_diagmat::apply(), glue_times_diag::apply(), glue_times::apply(), glue_join::apply(), glue_cross::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(), 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().
02268 { 02269 arma_extra_debug_sigprint(); 02270 02271 init(in_n_rows, in_n_cols); 02272 }
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 2281 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_hot void Mat< eT >::fill | ( | const eT | val | ) | [inline, inherited] |
fill the matrix with the specified value
Definition at line 2295 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Referenced by Mat< eT >::ones(), and Mat< eT >::zeros().
02296 { 02297 arma_extra_debug_sigprint(); 02298 02299 eT* local_ptr = memptr(); 02300 const u32 local_n_elem = n_elem; 02301 02302 u32 i,j; 02303 02304 for(i=0, j=1; j<local_n_elem; i+=2, j+=2) 02305 { 02306 local_ptr[i] = val; 02307 local_ptr[j] = val; 02308 } 02309 02310 if(i < local_n_elem) 02311 { 02312 local_ptr[i] = val; 02313 } 02314 }
void Mat< eT >::zeros | ( | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2321 of file Mat_meat.hpp.
References Mat< eT >::fill().
Referenced by op_diagmat::apply(), glue_times_diag::apply(), op_pinv::direct_pinv(), op_princomp::direct_princomp(), operator*(), auxlib::solve_ud(), and running_stat_vec_aux::update_stats().
02322 { 02323 arma_extra_debug_sigprint(); 02324 02325 fill(eT(0)); 02326 }
void Mat< eT >::zeros | ( | const u32 | in_rows, | |
const u32 | in_cols | |||
) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2333 of file Mat_meat.hpp.
References Mat< eT >::fill(), and Mat< eT >::set_size().
02334 { 02335 arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d") % in_rows % in_cols ); 02336 02337 set_size(in_rows, in_cols); 02338 fill(eT(0)); 02339 }
void Mat< eT >::ones | ( | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2346 of file Mat_meat.hpp.
References Mat< eT >::fill().
02347 { 02348 arma_extra_debug_sigprint(); 02349 02350 fill(eT(1)); 02351 }
void Mat< eT >::ones | ( | const u32 | in_rows, | |
const u32 | in_cols | |||
) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2358 of file Mat_meat.hpp.
References Mat< eT >::fill(), and Mat< eT >::set_size().
02359 { 02360 arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d") % in_rows % in_cols ); 02361 02362 set_size(in_rows, in_cols); 02363 fill(eT(1)); 02364 }
void Mat< eT >::reset | ( | ) | [inline, inherited] |
Definition at line 2371 of file Mat_meat.hpp.
References Mat< eT >::init().
Referenced by glue_join::apply(), op_princomp::direct_princomp(), op_princomp_cov::direct_princomp_cov(), diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), running_stat_vec< eT >::reset(), and solve().
02372 { 02373 arma_extra_debug_sigprint(); 02374 02375 init(0,0); 02376 }
void Mat< eT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
save the matrix to a file
Definition at line 2384 of file Mat_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), pgm_binary, raw_ascii, diskio::save_arma_ascii(), diskio::save_arma_binary(), diskio::save_pgm_binary(), and diskio::save_raw_ascii().
02385 { 02386 arma_extra_debug_sigprint(); 02387 02388 switch(type) 02389 { 02390 case raw_ascii: 02391 diskio::save_raw_ascii(*this, name); 02392 break; 02393 02394 case arma_ascii: 02395 diskio::save_arma_ascii(*this, name); 02396 break; 02397 02398 case arma_binary: 02399 diskio::save_arma_binary(*this, name); 02400 break; 02401 02402 case pgm_binary: 02403 diskio::save_pgm_binary(*this, name); 02404 break; 02405 02406 default: 02407 arma_stop("Mat::save(): unsupported file type"); 02408 } 02409 02410 }
void Mat< eT >::save | ( | std::ostream & | os, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
save the matrix to a stream
Definition at line 2418 of file Mat_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), pgm_binary, raw_ascii, diskio::save_arma_ascii(), diskio::save_arma_binary(), diskio::save_pgm_binary(), and diskio::save_raw_ascii().
02419 { 02420 arma_extra_debug_sigprint(); 02421 02422 switch(type) 02423 { 02424 case raw_ascii: 02425 diskio::save_raw_ascii(*this, "[ostream]", os); 02426 break; 02427 02428 case arma_ascii: 02429 diskio::save_arma_ascii(*this, "[ostream]", os); 02430 break; 02431 02432 case arma_binary: 02433 diskio::save_arma_binary(*this, "[ostream]", os); 02434 break; 02435 02436 case pgm_binary: 02437 diskio::save_pgm_binary(*this, "[ostream]", os); 02438 break; 02439 02440 default: 02441 arma_stop("Mat::save(): unsupported file type"); 02442 } 02443 02444 }
void Mat< eT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
load a matrix from a file
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2452 of file Mat_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), auto_detect, diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), pgm_binary, and raw_ascii.
02453 { 02454 arma_extra_debug_sigprint(); 02455 02456 switch(type) 02457 { 02458 case auto_detect: 02459 diskio::load_auto_detect(*this, name); 02460 break; 02461 02462 case raw_ascii: 02463 diskio::load_raw_ascii(*this, name); 02464 break; 02465 02466 case arma_ascii: 02467 diskio::load_arma_ascii(*this, name); 02468 break; 02469 02470 case arma_binary: 02471 diskio::load_arma_binary(*this, name); 02472 break; 02473 02474 case pgm_binary: 02475 diskio::load_pgm_binary(*this, name); 02476 break; 02477 02478 default: 02479 arma_stop("Mat::load(): unsupported file type"); 02480 } 02481 02482 }
void Mat< eT >::load | ( | std::istream & | is, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
load a matrix from a stream
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2490 of file Mat_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), auto_detect, diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_pgm_binary(), diskio::load_raw_ascii(), pgm_binary, and raw_ascii.
02491 { 02492 arma_extra_debug_sigprint(); 02493 02494 switch(type) 02495 { 02496 case auto_detect: 02497 diskio::load_auto_detect(*this, "[istream]", is); 02498 break; 02499 02500 case raw_ascii: 02501 diskio::load_raw_ascii(*this, "[istream]", is); 02502 break; 02503 02504 case arma_ascii: 02505 diskio::load_arma_ascii(*this, "[istream]", is); 02506 break; 02507 02508 case arma_binary: 02509 diskio::load_arma_binary(*this, "[istream]", is); 02510 break; 02511 02512 case pgm_binary: 02513 diskio::load_pgm_binary(*this, "[istream]", is); 02514 break; 02515 02516 default: 02517 arma_stop("Mat::load(): unsupported file type"); 02518 } 02519 02520 }
Mat< eT >::row_iterator::row_iterator | ( | Mat< eT > & | in_M, | |
const u32 | in_row | |||
) | [inline, inherited] |
Definition at line 2526 of file Mat_meat.hpp.
eT & Mat< eT >::row_iterator::operator* | ( | ) | [inline, inherited] |
Definition at line 2539 of file Mat_meat.hpp.
References Mat< eT >::row_iterator::col, Mat< eT >::row_iterator::M, and Mat< eT >::row_iterator::row.
Mat< eT >::row_iterator & Mat< eT >::row_iterator::operator++ | ( | ) | [inline, inherited] |
Definition at line 2549 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++().
void Mat< eT >::row_iterator::operator++ | ( | int | ) | [inline, inherited] |
Definition at line 2567 of file Mat_meat.hpp.
References Mat< eT >::row_iterator::operator++().
02568 { 02569 operator++(); 02570 }
Mat< eT >::row_iterator & Mat< eT >::row_iterator::operator-- | ( | ) | [inline, inherited] |
Definition at line 2577 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--().
void Mat< eT >::row_iterator::operator-- | ( | int | ) | [inline, inherited] |
Definition at line 2600 of file Mat_meat.hpp.
References Mat< eT >::row_iterator::operator--().
02601 { 02602 operator--(); 02603 }
Mat< eT >::const_row_iterator::const_row_iterator | ( | const Mat< eT > & | in_M, | |
const u32 | in_row | |||
) | [inline, inherited] |
Definition at line 2629 of file Mat_meat.hpp.
eT Mat< eT >::const_row_iterator::operator* | ( | ) | const [inline, inherited] |
Definition at line 2654 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.
Mat< eT >::const_row_iterator & Mat< eT >::const_row_iterator::operator++ | ( | ) | [inline, inherited] |
Definition at line 2664 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++().
void Mat< eT >::const_row_iterator::operator++ | ( | int | ) | [inline, inherited] |
Definition at line 2682 of file Mat_meat.hpp.
References Mat< eT >::const_row_iterator::operator++().
02683 { 02684 operator++(); 02685 }
Mat< eT >::const_row_iterator & Mat< eT >::const_row_iterator::operator-- | ( | ) | [inline, inherited] |
Definition at line 2692 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--().
void Mat< eT >::const_row_iterator::operator-- | ( | int | ) | [inline, inherited] |
Definition at line 2715 of file Mat_meat.hpp.
References Mat< eT >::const_row_iterator::operator--().
02716 { 02717 operator--(); 02718 }
Definition at line 2745 of file Mat_meat.hpp.
References Mat< eT >::memptr().
02746 { 02747 arma_extra_debug_sigprint(); 02748 02749 return memptr(); 02750 }
Definition at line 2757 of file Mat_meat.hpp.
References Mat< eT >::memptr().
02758 { 02759 arma_extra_debug_sigprint(); 02760 02761 return memptr(); 02762 }
Definition at line 2769 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Definition at line 2781 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Mat< eT >::col_iterator Mat< eT >::begin_col | ( | const u32 | col_num | ) | [inline, inherited] |
Definition at line 2793 of file Mat_meat.hpp.
References Mat< eT >::colptr(), and Mat< eT >::n_cols.
Mat< eT >::const_col_iterator Mat< eT >::begin_col | ( | const u32 | col_num | ) | const [inline, inherited] |
Definition at line 2807 of file Mat_meat.hpp.
References Mat< eT >::colptr(), and Mat< eT >::n_cols.
Mat< eT >::col_iterator Mat< eT >::end_col | ( | const u32 | col_num | ) | [inline, inherited] |
Definition at line 2821 of file Mat_meat.hpp.
References Mat< eT >::colptr(), Mat< eT >::n_cols, and Mat< eT >::n_rows.
Mat< eT >::const_col_iterator Mat< eT >::end_col | ( | const u32 | col_num | ) | const [inline, inherited] |
Definition at line 2835 of file Mat_meat.hpp.
References Mat< eT >::colptr(), Mat< eT >::n_cols, and Mat< eT >::n_rows.
Mat< eT >::row_iterator Mat< eT >::begin_row | ( | const u32 | row_num | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2849 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
02850 { 02851 arma_extra_debug_sigprint(); 02852 02853 arma_debug_check( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); 02854 02855 return typename Mat<eT>::row_iterator(*this, row_num); 02856 }
Mat< eT >::const_row_iterator Mat< eT >::begin_row | ( | const u32 | row_num | ) | const [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2863 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
02864 { 02865 arma_extra_debug_sigprint(); 02866 02867 arma_debug_check( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); 02868 02869 return typename Mat<eT>::const_row_iterator(*this, row_num); 02870 }
Mat< eT >::row_iterator Mat< eT >::end_row | ( | const u32 | row_num | ) | [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2877 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
02878 { 02879 arma_extra_debug_sigprint(); 02880 02881 arma_debug_check( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); 02882 02883 return typename Mat<eT>::row_iterator(*this, row_num + 1); 02884 }
Mat< eT >::const_row_iterator Mat< eT >::end_row | ( | const u32 | row_num | ) | const [inline, inherited] |
Reimplemented in Col< eT >, and Row< eT >.
Definition at line 2891 of file Mat_meat.hpp.
References Mat< eT >::n_rows.
02892 { 02893 arma_extra_debug_sigprint(); 02894 02895 arma_debug_check( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); 02896 02897 return typename Mat<eT>::const_row_iterator(*this, row_num + 1); 02898 }
arma_inline void Mat_aux::prefix_pp | ( | Mat< eT > & | x | ) | [inline, static, inherited] |
prefix ++
Definition at line 2906 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Referenced by Mat< eT >::operator++().
arma_inline void Mat_aux::prefix_pp | ( | Mat< std::complex< T > > & | x | ) | [inline, static, inherited] |
prefix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 2931 of file Mat_meat.hpp.
arma_inline void Mat_aux::postfix_pp | ( | Mat< eT > & | x | ) | [inline, static, inherited] |
postfix ++
Definition at line 2942 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Referenced by Mat< eT >::operator++().
arma_inline void Mat_aux::postfix_pp | ( | Mat< std::complex< T > > & | x | ) | [inline, static, inherited] |
postfix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 2967 of file Mat_meat.hpp.
arma_inline void Mat_aux::prefix_mm | ( | Mat< eT > & | x | ) | [inline, static, inherited] |
prefix --
Definition at line 2978 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Referenced by Mat< eT >::operator--().
arma_inline void Mat_aux::prefix_mm | ( | Mat< std::complex< T > > & | x | ) | [inline, static, inherited] |
prefix -- for complex numbers (work around for limitations of the std::complex class)
Definition at line 3003 of file Mat_meat.hpp.
arma_inline void Mat_aux::postfix_mm | ( | Mat< eT > & | x | ) | [inline, static, inherited] |
postfix --
Definition at line 3014 of file Mat_meat.hpp.
References Mat< eT >::memptr(), and Mat< eT >::n_elem.
Referenced by Mat< eT >::operator--().
arma_inline void Mat_aux::postfix_mm | ( | Mat< std::complex< T > > & | x | ) | [inline, static, inherited] |
postfix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 3039 of file Mat_meat.hpp.