IT++ Logo Newcom Logo

itpp::Mat< Num_T > Class Template Reference

Templated Matrix Class. More...

#include <itpp/base/mat.h>

List of all members.

Public Types

typedef Num_T value_type
 The type of the matrix values.

Public Member Functions

 Mat (const Factory &f=DEFAULT_FACTORY)
 Default constructor. An element factory f can be specified.
 Mat (int inrow, int incol, const Factory &f=DEFAULT_FACTORY)
 Create a matrix of size (inrow, incol). An element factory f can be specified.
 Mat (const Mat< Num_T > &m)
 Copy constructor.
 Mat (const Mat< Num_T > &m, const Factory &f)
 Constructor, similar to the copy constructor, but also takes an element factory f as argument.
 Mat (const Vec< Num_T > &invector, const Factory &f=DEFAULT_FACTORY)
 Create a copy of the vector invector treated as a column vector. An element factory f can be specified.
 Mat (const std::string &str, const Factory &f=DEFAULT_FACTORY)
 Set matrix equal to values in string. An element factory f can be specified.
 Mat (const char *str, const Factory &f=DEFAULT_FACTORY)
 Set matrix equal to values in string. An element factory f can be specified.
 Mat (Num_T *c_array, int rows, int cols, bool RowMajor=true, const Factory &f=DEFAULT_FACTORY)
 Constructor taking a C-array as input. Copies all data. An element factory f can be specified.
 ~Mat ()
 Destructor.
int cols () const
 The number of columns.
int rows () const
 The number of rows.
int size () const
 The number of elements.
void set_size (int inrow, int incol, bool copy=false)
 Set size of matrix. If copy = true then keep the data before resizing.
void zeros ()
 Set matrix equal to the all zero matrix.
void clear ()
 Set matrix equal to the all zero matrix.
void ones ()
 Set matrix equal to the all one matrix.
bool set (const char *values)
 Set matrix equal to values in values.
bool set (const std::string &str)
 Set matrix equal to values in the string str.
const Num_T & operator() (int R, int C) const
 Get element (R,C) from matrix.
Num_T & operator() (int R, int C)
 Get element (R,C) from matrix.
Num_T & operator() (int index)
 Get element index using linear addressing (by rows).
const Num_T & operator() (int index) const
 Get element index using linear addressing (by rows).
const Num_T & get (int R, int C) const
 Get element (R,C) from matrix.
void set (int R, int C, const Num_T &v)
 Set element (R,C) of matrix.
const Mat< Num_T > operator() (int r1, int r2, int c1, int c2) const
 Sub-matrix from row r1 to row r2 and columns c1 to c2.
const Mat< Num_T > get (int r1, int r2, int c1, int c2) const
 Sub-matrix from row r1 to row r2 and columns c1 to c2.
const Vec< Num_T > get_row (int Index) const
 Get row Index.
const Mat< Num_T > get_rows (int r1, int r2) const
 Get rows r1 through r2.
const Mat< Num_T > get_rows (const Vec< int > &indexlist) const
 Get the rows specified by indexlist.
const Vec< Num_T > get_col (int Index) const
 Get column Index.
const Mat< Num_T > get_cols (int c1, int c2) const
 Get columns c1 through c2.
const Mat< Num_T > get_cols (const Vec< int > &indexlist) const
 Get the columns specified by indexlist.
void set_row (int Index, const Vec< Num_T > &invector)
 Set row Index to invector.
void set_col (int Index, const Vec< Num_T > &invector)
 Set column Index to invector.
void copy_row (int to, int from)
 Copy row from onto row to.
void copy_col (int to, int from)
 Copy column from onto column to.
void swap_rows (int r1, int r2)
 Swap the rows r1 and r2.
void swap_cols (int c1, int c2)
 Swap the columns c1 and c2.
void set_submatrix (int r1, int r2, int c1, int c2, const Mat< Num_T > &m)
 Set submatrix defined by rows r1,r2 and columns c1,c2 to matrix m.
void set_submatrix (int r, int c, const Mat< Num_T > &m)
 Set submatrix defined by upper-left element (r,c) and the size of matrix m to m.
void set_submatrix (int r1, int r2, int c1, int c2, const Num_T t)
 Set all elements of submatrix defined by rows r1,r2 and columns c1,c2 to value t.
void del_row (int r)
 Delete row number r.
void del_rows (int r1, int r2)
 Delete rows from r1 to r2.
void del_col (int c)
 Delete column number c.
void del_cols (int c1, int c2)
 Delete columns from c1 to c2.
void ins_row (int r, const Vec< Num_T > &in)
 Insert vector in at row number r, the matrix can be empty.
void ins_col (int c, const Vec< Num_T > &in)
 Insert vector in at column number c, the matrix can be empty.
void append_row (const Vec< Num_T > &in)
 Append vector to the bottom of the matrix, the matrix can be empty.
void append_col (const Vec< Num_T > &in)
 Append vector to the right of the matrix, the matrix can be empty.
const Mat< Num_T > transpose () const
 Matrix transpose.
const Mat< Num_T > T () const
 Matrix transpose.
const Mat< Num_T > hermitian_transpose () const
 Hermitian matrix transpose (conjugate transpose).
const Mat< Num_T > H () const
 Hermitian matrix transpose (conjugate transpose).
Mat< Num_T > & operator= (Num_T t)
 Set all elements of the matrix equal to t.
Mat< Num_T > & operator= (const Mat< Num_T > &m)
 Set matrix equal to m.
Mat< Num_T > & operator= (const Vec< Num_T > &v)
 Set matrix equal to the vector v, assuming column vector.
Mat< Num_T > & operator= (const char *values)
 Set matrix equal to values in the string.
Mat< Num_T > & operator+= (const Mat< Num_T > &m)
 Addition of matrices.
Mat< Num_T > & operator+= (Num_T t)
 Addition of scalar to matrix.
Mat< Num_T > & operator-= (const Mat< Num_T > &m)
 Subtraction of matrix.
Mat< Num_T > & operator-= (Num_T t)
 Subtraction of scalar from matrix.
Mat< Num_T > & operator *= (const Mat< Num_T > &m)
 Matrix multiplication.
Mat< Num_T > & operator *= (Num_T t)
 Multiplication by a scalar.
Mat< Num_T > & operator/= (Num_T t)
 Division by a scalar.
Mat< Num_T > & operator/= (const Mat< Num_T > &m)
 Elementwise division with the current matrix.
bool operator== (const Mat< Num_T > &m) const
 Compare two matrices. False if wrong sizes or different values.
bool operator!= (const Mat< Num_T > &m) const
 Compare two matrices. True if different.
Num_T & _elem (int R, int C)
 Get element (R,C) from matrix without boundary check (Not recommended to use).
const Num_T & _elem (int R, int C) const
 Get element (R,C) from matrix without boundary check (Not recommended to use).
Num_T & _elem (int index)
 Get element index using linear addressing (by rows) without boundary check (Not recommended to use).
const Num_T & _elem (int index) const
 Get element index using linear addressing (by rows) without boundary check (Not recommended to use).
Num_T * _data ()
 Access of the internal data structure. Don't use. May be changed!
const Num_T * _data () const
 Access to the internal data structure. Don't use. May be changed!
int _datasize () const
 Access to the internal data structure. Don't use. May be changed!
template<>
bool set (const char *values)
template<>
bool set (const char *values)
template<>
const cmat hermitian_transpose () const
template<>
matoperator *= (const mat &m)
template<>
cmatoperator *= (const cmat &m)
template<>
bool set (const char *values)
template<>
bool set (const char *values)
template<>
const cmat hermitian_transpose () const
template<>
matoperator *= (const mat &m)
template<>
cmatoperator *= (const cmat &m)

Protected Member Functions

void alloc (int rows, int cols)
 Allocate memory for the matrix.
void free ()
 Free the memory space of the matrix.

Protected Attributes

int datasize
 Protected integer variables.
int no_rows
int no_cols
Num_T * data
 Protected data pointer.
const Factoryfactory
 Element factory (set to DEFAULT_FACTORY to use Num_T default constructors only).

Friends

const Mat< Num_T > concat_horizontal (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Concatenate the matrices m1 and m2 horizontally.
const Mat< Num_T > concat_vertical (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Concatenate the matrices m1 and m2 vertically.
const Mat< Num_T > operator+ (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Addition of two matrices.
const Mat< Num_T > operator+ (const Mat< Num_T > &m, Num_T t)
 Addition of matrix and scalar.
const Mat< Num_T > operator+ (Num_T t, const Mat< Num_T > &m)
 Addition of scalar and matrix.
const Mat< Num_T > operator- (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Subtraction of m2 from m1.
const Mat< Num_T > operator- (const Mat< Num_T > &m, Num_T t)
 Subraction of scalar from matrix.
const Mat< Num_T > operator- (Num_T t, const Mat< Num_T > &m)
 Subtract matrix from scalar.
const Mat< Num_T > operator- (const Mat< Num_T > &m)
 Subraction of matrix.
const Mat< Num_T > operator * (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Multiplication of two matrices.
const Vec< Num_T > operator * (const Mat< Num_T > &m, const Vec< Num_T > &v)
 Multiplication of matrix m and vector v (column vector).
const Mat< Num_T > operator * (const Vec< Num_T > &v, const Mat< Num_T > &m)
 Multiplication of transposed vector v and matrix m.
const Mat< Num_T > operator * (const Mat< Num_T > &m, Num_T t)
 Multiplication of matrix and scalar.
const Mat< Num_T > operator * (Num_T t, const Mat< Num_T > &m)
 Multiplication of scalar and matrix.
const Mat< Num_T > elem_mult (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Elementwise multiplication of two matrices.
const Mat< Num_T > operator/ (const Mat< Num_T > &m, Num_T t)
 Division of matrix with scalar.
const Mat< Num_T > elem_div (const Mat< Num_T > &m1, const Mat< Num_T > &m2)
 Elementwise division of matrix m1 with matrix m2.

Related Functions

(Note that these are not member functions.)

typedef Mat< double > mat
 Default Matrix Type.
typedef Mat< std::complex<
double > > 
cmat
 Default Complex Matrix Type.
typedef Mat< int > imat
 Integer matrix.
typedef Mat< short int > smat
 short int matrix
bmat to_bmat (const Mat< T > &m)
 Converts a Mat<T> to bmat.
smat to_smat (const Mat< T > &m)
 Converts a Mat<T> to smat.
imat to_imat (const Mat< T > &m)
 Converts a Mat<T> to imat.
mat to_mat (const Mat< T > &m)
 Converts a Mat<T> to mat.
cmat to_cmat (const Mat< T > &m)
 Converts a Mat<T> to cmat.
cmat to_cmat (const Mat< T > &real, const Mat< T > &imag)
 Converts real and imaginary Mat<T> to cmat.
void sub_v_vT_m (mat &m, const vec &v)
 Calculates m=m-v*v'*m.
void sub_m_v_vT (mat &m, const vec &v)
 Calculates m=m-m*v*v'.
std::ostream & operator<< (std::ostream &os, const Mat< Num_T > &m)
 Output stream for matrices.
std::istream & operator>> (std::istream &is, Mat< Num_T > &m)
 Input stream for matrices.
mat operator+ (const float &s, const mat &m)
 Addition operator for float and mat.
mat operator+ (const short &s, const mat &m)
 Addition operator for short and mat.
mat operator+ (const int &s, const mat &m)
 Addition operator for int and mat.
mat operator+ (const mat &m, const float &s)
 Addition operator for mat and float.
mat operator+ (const mat &m, const short &s)
 Addition operator for mat and short.
mat operator+ (const mat &m, const int &s)
 Addition operator for mat and int.
mat operator- (const float &s, const mat &m)
 Subtraction operator for float and mat.
mat operator- (const short &s, const mat &m)
 Subtraction operator for short and mat.
mat operator- (const int &s, const mat &m)
 Subtraction operator for int and mat.
mat operator- (const mat &m, const float &s)
 Subtraction operator for mat and float.
mat operator- (const mat &m, const short &s)
 Subtraction operator for mat and short.
mat operator- (const mat &m, const int &s)
 Subtraction operator for mat and int.
mat operator * (const float &s, const mat &m)
 Multiplication operator for float and mat.
mat operator * (const short &s, const mat &m)
 Multiplication operator for short and mat.
mat operator * (const int &s, const mat &m)
 Multiplication operator for int and mat.
mat operator * (const mat &m, const float &s)
 Multiplication operator for mat and float.
mat operator * (const mat &m, const short &s)
 Multiplication operator for mat and short.
mat operator * (const mat &m, const int &s)
 Multiplication operator for mat and int.
mat operator/ (const mat &m, const float &s)
 Division operator for mat and float.
mat operator/ (const mat &m, const short &s)
 Division operator for mat and short.
mat operator/ (const mat &m, const int &s)
 Division operator for mat and int.
cmat operator+ (const double &s, const cmat &m)
 Addition operator for double and cmat.
cmat operator- (const double &s, const cmat &m)
 Subtraction operator for double and cmat.
cmat operator * (const double &s, const cmat &m)
 Multiplication operator for double and cmat.
cmat operator * (const std::complex< double > &s, const mat &m)
 Multiplication operator for complex<double> and mat.
cmat operator * (const mat &m, const std::complex< double > &s)
 Multiplication operator for mat and complex<double>.
cmat operator/ (const cmat &m, const double &s)
 Division operator for cmat and double.
mat operator+ (const bmat &a, const mat &b)
 Addition operator for bmat and cmat.
mat operator+ (const smat &a, const mat &b)
 Addition operator for cmat and mat.
mat operator+ (const mat &a, const bmat &b)
 Addition operator for cmat and bmat.
mat operator- (const bmat &a, const mat &b)
 Subtraction operator for bmat and cmat.
mat operator- (const smat &a, const mat &b)
 Subtraction operator for cmat and mat.
mat operator- (const mat &a, const bmat &b)
 Subtraction operator for cmat and bmat.
cmat operator * (const mat &a, const cmat &b)
 Multiplication operator for cmat and imat.
cmat operator * (const bmat &a, const cmat &b)
 Multiplication operator for bmat and cmat.
cmat operator * (const cmat &a, const bmat &b)
 Multiplication operator for cmat and bmat.
Mat< T > mat_1x1 (T m00)
 Matrix of size 1 by 1.
Mat< T > mat_1x2 (T m00, T m01)
 Matrix of size 1 by 2.
Mat< T > mat_2x1 (T m00, T m10)
 Matrix of size 2 by 1.
Mat< T > mat_2x2 (T m00, T m01, T m10, T m11)
 Matrix of size 2 by 2.
Mat< T > mat_1x3 (T m00, T m01, T m02)
 Matrix of size 1 by 3.
Mat< T > mat_3x1 (T m00, T m10, T m20)
 Matrix of size 3 by 1.
Mat< T > mat_2x3 (T m00, T m01, T m02, T m10, T m11, T m12)
 Matrix of size 2 by 3.
Mat< T > mat_3x2 (T m00, T m01, T m10, T m11, T m20, T m21)
 Matrix of size 3 by 2.
Mat< T > mat_3x3 (T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
 Matrix of size 3 by 3.


Detailed Description

template<class Num_T>
class itpp::Mat< Num_T >

Templated Matrix Class.

Author:
Tony Ottosson and Tobias Ringstrom
Matrices can be of arbitrarily types, but conversions and functions are prepared for bin, short, int, double, and complex<double> vectors and these are predefined as: bmat, smat, imat, mat, and cmat. double and complex<double> are usually double and complex<double> respectively. However, this can be changed when compiling the it++ (see installation notes for more details). (Note: for binary matrices, an alternative to the bmat class is GF2mat and GF2mat_dense, which offer a more memory efficient representation and additional functions for linear algebra.)

Examples:

Matrix Constructors: When constructing a matrix without a dimensions (memory) use

 mat temp; 
For construction of a matrix of a given size use
 mat temp(rows, cols); 
It is also possible to assign the constructed matrix the value and dimension of another matrix by
 vec temp(inmatrix); 
If you have explicit values you would like to assign to the matrix it is possible to do this using strings as:
    mat a("0 0.7;5 9.3"); // that is a = [0, 0.7; 5, 9.3]
    mat a="0 0.7;5 9.3";  // the constructor are called implicitly
It is also possible to change dimension by
 temp.set_size(new_rows, new_cols, false); 
where false is used to indicate that the old values in temp is not copied. If you like to preserve the values use true.

There are a number of methods to access parts of a matrix. Examples are

    a(5,3);     // Element number (5,3)
    a(5,9,3,5);  // Sub-matrix from rows 5, 6, 7, 8, 9 the columns 3, 4, and 5
    a.get_row(10);  // Row 10
    a.get_col(10); // Column 10

It is also possible to modify parts of a vector as e.g. in

    a.set_row(5, invector);    // Set row 5 to \c invector
    a.set_col(3, invector); // Set column 3 to \c invector
    a.copy_col(1, 5); // Copy column 5 to column 1
    a.swap_cols(1, 5); // Swap the contents of columns 1 and 5

It is of course also possible to perform the common linear algebra methods such as addition, subtraction, and matrix multiplication. Observe though, that vectors are assumed to be column-vectors in operations with matrices.

Most elementary functions such as sin(), cosh(), log(), abs(), ..., are available as operations on the individual elements of the matrices. Please see the individual functions for more details.

By default, the Mat elements are created using the default constructor for the element type. This can be changed by specifying a suitable Factory in the Mat constructor call; see Detailed Description for Factory.

Definition at line 171 of file mat.h.


Member Typedef Documentation

template<class Num_T>
typedef Num_T itpp::Mat< Num_T >::value_type

The type of the matrix values.

Definition at line 174 of file mat.h.


Constructor & Destructor Documentation

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const Factory f = DEFAULT_FACTORY  )  [inline, explicit]

Default constructor. An element factory f can be specified.

Definition at line 176 of file mat.h.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( int  inrow,
int  incol,
const Factory f = DEFAULT_FACTORY 
) [inline]

Create a matrix of size (inrow, incol). An element factory f can be specified.

Definition at line 178 of file mat.h.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const Mat< Num_T > &  m  )  [inline]

Copy constructor.

Definition at line 514 of file mat.h.

References itpp::Mat< Num_T >::alloc(), itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const Mat< Num_T > &  m,
const Factory f 
) [inline]

Constructor, similar to the copy constructor, but also takes an element factory f as argument.

Definition at line 522 of file mat.h.

References itpp::Mat< Num_T >::alloc(), itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const Vec< Num_T > &  invector,
const Factory f = DEFAULT_FACTORY 
) [inline]

Create a copy of the vector invector treated as a column vector. An element factory f can be specified.

Definition at line 530 of file mat.h.

References itpp::Vec< Num_T >::length(), itpp::Mat< Num_T >::set_col(), and itpp::Mat< Num_T >::set_size().

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const std::string &  str,
const Factory f = DEFAULT_FACTORY 
) [inline]

Set matrix equal to values in string. An element factory f can be specified.

Definition at line 189 of file mat.h.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( const char *  str,
const Factory f = DEFAULT_FACTORY 
) [inline]

Set matrix equal to values in string. An element factory f can be specified.

Definition at line 191 of file mat.h.

template<class Num_T>
itpp::Mat< Num_T >::Mat ( Num_T *  c_array,
int  rows,
int  cols,
bool  RowMajor = true,
const Factory f = DEFAULT_FACTORY 
) [inline]

Constructor taking a C-array as input. Copies all data. An element factory f can be specified.

By default the matrix is stored as a RowMajor matrix (i.e. listing elements in sequence beginning with the first column).

Definition at line 538 of file mat.h.

References itpp::Mat< Num_T >::alloc(), itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
itpp::Mat< Num_T >::~Mat (  )  [inline]

Destructor.

Definition at line 201 of file mat.h.


Member Function Documentation

template<class Num_T>
int itpp::Mat< Num_T >::cols (  )  const [inline]

The number of columns.

Definition at line 204 of file mat.h.

Referenced by itpp::apply_function(), itpp::bidiag(), itpp::cumsum(), itpp::cvectorize(), itpp::dht2(), itpp::diag(), itpp::dwht2(), itpp::Mat< Num_T >::get_cols(), itpp::kron(), itpp::lininterp(), itpp::max(), itpp::max_index(), itpp::min(), itpp::min_index(), itpp::operator *(), itpp::operator+(), itpp::Sparse_Mat< T >::operator+=(), itpp::Sparse_Mat< T >::operator-=(), itpp::Vec< Num_T >::operator=(), itpp::Sparse_Mat< T >::operator=(), itpp::prod(), itpp::repeat(), itpp::reshape(), itpp::rvectorize(), itpp::Mat< Num_T >::set(), itpp::Sparse_Mat< T >::set_submatrix(), itpp::Sparse_Mat< T >::Sparse_Mat(), itpp::sum(), itpp::sum_sqr(), itpp::to(), itpp::to_bmat(), itpp::to_cmat(), itpp::LLR_calc_unit::to_double(), itpp::to_imat(), itpp::to_mat(), itpp::to_smat(), itpp::trans_mult(), itpp::tridiag(), itpp::upsample(), and itpp::zero_pad().

template<class Num_T>
int itpp::Mat< Num_T >::rows (  )  const [inline]

The number of rows.

Definition at line 206 of file mat.h.

Referenced by itpp::apply_function(), itpp::bidiag(), itpp::cumsum(), itpp::cvectorize(), itpp::dht2(), itpp::diag(), itpp::dwht2(), itpp::Mat< Num_T >::get_rows(), itpp::kron(), itpp::lininterp(), itpp::max(), itpp::max_index(), itpp::min(), itpp::min_index(), itpp::operator *(), itpp::operator+(), itpp::Sparse_Mat< T >::operator+=(), itpp::Sparse_Mat< T >::operator-=(), itpp::Vec< Num_T >::operator=(), itpp::Sparse_Mat< T >::operator=(), itpp::prod(), itpp::repeat(), itpp::reshape(), itpp::rvectorize(), itpp::Mat< Num_T >::set(), itpp::Sparse_Mat< T >::set_submatrix(), itpp::Mat< Num_T >::set_submatrix(), itpp::Sparse_Mat< T >::Sparse_Mat(), itpp::sum(), itpp::sum_sqr(), itpp::to(), itpp::to_bmat(), itpp::to_cmat(), itpp::LLR_calc_unit::to_double(), itpp::to_imat(), itpp::to_mat(), itpp::to_smat(), itpp::tridiag(), itpp::upsample(), and itpp::zero_pad().

template<class Num_T>
int itpp::Mat< Num_T >::size (  )  const [inline]

The number of elements.

Definition at line 208 of file mat.h.

Referenced by itpp::lshift_fix(), itpp::rshift_fix(), and itpp::set_fix().

template<class Num_T>
void itpp::Mat< Num_T >::set_size ( int  inrow,
int  incol,
bool  copy = false 
) [inline]

Set size of matrix. If copy = true then keep the data before resizing.

Definition at line 555 of file mat.h.

References itpp::Mat< Num_T >::alloc(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::bidiag(), itpp::Cross_Interleaver< T >::Cross_Interleaver(), itpp::Mat< Num_T >::del_col(), itpp::Mat< Num_T >::del_cols(), itpp::Mat< Num_T >::del_row(), itpp::diag(), itpp::Sparse_Mat< T >::full(), itpp::GF2mat::GF2mat(), itpp::Mat< Num_T >::ins_col(), itpp::Mat< Num_T >::ins_row(), itpp::lininterp(), itpp::Mat< Num_T >::Mat(), itpp::Mat< Num_T >::operator-=(), itpp::Mat< Num_T >::operator=(), itpp::operator>>(), itpp::Mat< Num_T >::set(), itpp::set_fix(), itpp::Cross_Interleaver< T >::set_order(), itpp::tridiag(), and itpp::upsample().

template<class Num_T>
void itpp::Mat< Num_T >::zeros (  )  [inline]

Set matrix equal to the all zero matrix.

Definition at line 573 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

Referenced by itpp::Mat< unsigned short int >::clear().

template<class Num_T>
void itpp::Mat< Num_T >::clear (  )  [inline]

Set matrix equal to the all zero matrix.

Definition at line 214 of file mat.h.

Referenced by itpp::Cross_Interleaver< T >::deinterleave(), itpp::Cross_Interleaver< T >::interleave(), and itpp::upsample().

template<class Num_T>
void itpp::Mat< Num_T >::ones (  )  [inline]

Set matrix equal to the all one matrix.

Definition at line 580 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

template<class Num_T>
bool itpp::Mat< Num_T >::set ( const std::string &  str  )  [inline]

Set matrix equal to values in the string str.

Definition at line 631 of file mat.h.

template<class Num_T>
const Num_T& itpp::Mat< Num_T >::operator() ( int  R,
int  C 
) const [inline]

Get element (R,C) from matrix.

Definition at line 223 of file mat.h.

Referenced by itpp::Mat< Num_T >::set().

template<class Num_T>
Num_T& itpp::Mat< Num_T >::operator() ( int  R,
int  C 
) [inline]

Get element (R,C) from matrix.

Definition at line 227 of file mat.h.

template<class Num_T>
Num_T& itpp::Mat< Num_T >::operator() ( int  index  )  [inline]

Get element index using linear addressing (by rows).

Definition at line 231 of file mat.h.

template<class Num_T>
const Num_T& itpp::Mat< Num_T >::operator() ( int  index  )  const [inline]

Get element index using linear addressing (by rows).

Definition at line 235 of file mat.h.

template<class Num_T>
const Num_T& itpp::Mat< Num_T >::get ( int  R,
int  C 
) const [inline]

Get element (R,C) from matrix.

Definition at line 239 of file mat.h.

template<class Num_T>
void itpp::Mat< Num_T >::set ( int  R,
int  C,
const Num_T &  v 
) [inline]

Set element (R,C) of matrix.

Definition at line 243 of file mat.h.

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::operator() ( int  r1,
int  r2,
int  c1,
int  c2 
) const [inline]

Sub-matrix from row r1 to row r2 and columns c1 to c2.

Value -1 indicates the last row and column, respectively.

Definition at line 637 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::get ( int  r1,
int  r2,
int  c1,
int  c2 
) const [inline]

Sub-matrix from row r1 to row r2 and columns c1 to c2.

Value -1 indicates the last row and column, respectively.

Definition at line 658 of file mat.h.

template<class Num_T>
const Vec< Num_T > itpp::Mat< Num_T >::get_row ( int  Index  )  const [inline]

Get row Index.

Definition at line 664 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::concat_vertical(), itpp::cumsum(), itpp::dht2(), itpp::dwht2(), itpp::max(), itpp::min(), itpp::operator<<(), itpp::prod(), itpp::sum(), and itpp::sum_sqr().

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::get_rows ( int  r1,
int  r2 
) const [inline]

Get rows r1 through r2.

Definition at line 674 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::rows().

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::get_rows ( const Vec< int > &  indexlist  )  const [inline]

Get the rows specified by indexlist.

Definition at line 686 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Vec< Num_T >::size().

template<class Num_T>
const Vec< Num_T > itpp::Mat< Num_T >::get_col ( int  Index  )  const [inline]

Get column Index.

Definition at line 699 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::concat_horizontal(), itpp::cumsum(), itpp::Cross_Interleaver< T >::deinterleave(), itpp::dht2(), itpp::dwht2(), itpp::Cross_Interleaver< T >::interleave(), itpp::max(), itpp::min(), itpp::Sparse_Mat< T >::operator+=(), itpp::Sparse_Mat< T >::operator-=(), itpp::prod(), itpp::repeat(), itpp::sum(), itpp::sum_sqr(), and itpp::upsample().

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::get_cols ( int  c1,
int  c2 
) const [inline]

Get columns c1 through c2.

Definition at line 710 of file mat.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::get_cols ( const Vec< int > &  indexlist  )  const [inline]

Get the columns specified by indexlist.

Definition at line 722 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Vec< Num_T >::size().

template<class Num_T>
void itpp::Mat< Num_T >::set_row ( int  Index,
const Vec< Num_T > &  invector 
) [inline]

Set row Index to invector.

Definition at line 735 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Vec< Num_T >::length(), itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Vec< Num_T >::size().

Referenced by itpp::concat_vertical().

template<class Num_T>
void itpp::Mat< Num_T >::set_col ( int  Index,
const Vec< Num_T > &  invector 
) [inline]

Set column Index to invector.

Definition at line 744 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Vec< Num_T >::length(), itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Vec< Num_T >::size().

Referenced by itpp::concat_horizontal(), itpp::Cross_Interleaver< T >::deinterleave(), itpp::Cross_Interleaver< T >::interleave(), itpp::Mat< Num_T >::Mat(), itpp::Mat< Num_T >::operator=(), and itpp::upsample().

template<class Num_T>
void itpp::Mat< Num_T >::copy_row ( int  to,
int  from 
) [inline]

Copy row from onto row to.

Definition at line 753 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::copy_col ( int  to,
int  from 
) [inline]

Copy column from onto column to.

Definition at line 765 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::swap_rows ( int  r1,
int  r2 
) [inline]

Swap the rows r1 and r2.

Definition at line 777 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::swap_cols ( int  c1,
int  c2 
) [inline]

Swap the columns c1 and c2.

Definition at line 789 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::set_submatrix ( int  r1,
int  r2,
int  c1,
int  c2,
const Mat< Num_T > &  m 
) [inline]

Set submatrix defined by rows r1,r2 and columns c1,c2 to matrix m.

Definition at line 801 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::zero_pad().

template<class Num_T>
void itpp::Mat< Num_T >::set_submatrix ( int  r,
int  c,
const Mat< Num_T > &  m 
) [inline]

Set submatrix defined by upper-left element (r,c) and the size of matrix m to m.

Definition at line 822 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::set_submatrix ( int  r1,
int  r2,
int  c1,
int  c2,
const Num_T  t 
) [inline]

Set all elements of submatrix defined by rows r1,r2 and columns c1,c2 to value t.

Definition at line 835 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::rows().

template<class Num_T>
void itpp::Mat< Num_T >::del_row ( int  r  )  [inline]

Delete row number r.

Definition at line 860 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::set_size().

Referenced by itpp::Mat< Num_T >::del_rows().

template<class Num_T>
void itpp::Mat< Num_T >::del_rows ( int  r1,
int  r2 
) [inline]

Delete rows from r1 to r2.

Definition at line 875 of file mat.h.

References itpp::Mat< Num_T >::del_row(), it_assert1, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::del_col ( int  c  )  [inline]

Delete column number c.

Definition at line 896 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::set_size().

template<class Num_T>
void itpp::Mat< Num_T >::del_cols ( int  c1,
int  c2 
) [inline]

Delete columns from c1 to c2.

Definition at line 907 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::set_size().

template<class Num_T>
void itpp::Mat< Num_T >::ins_row ( int  r,
const Vec< Num_T > &  in 
) [inline]

Insert vector in at row number r, the matrix can be empty.

Definition at line 918 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, itpp::Mat< Num_T >::set_size(), and itpp::Vec< Num_T >::size().

Referenced by itpp::Mat< Num_T >::append_row().

template<class Num_T>
void itpp::Mat< Num_T >::ins_col ( int  c,
const Vec< Num_T > &  in 
) [inline]

Insert vector in at column number c, the matrix can be empty.

Definition at line 940 of file mat.h.

References itpp::Vec< Num_T >::_data(), itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, itpp::Mat< Num_T >::set_size(), and itpp::Vec< Num_T >::size().

Referenced by itpp::Mat< Num_T >::append_col().

template<class Num_T>
void itpp::Mat< Num_T >::append_row ( const Vec< Num_T > &  in  )  [inline]

Append vector to the bottom of the matrix, the matrix can be empty.

Definition at line 958 of file mat.h.

References itpp::Mat< Num_T >::ins_row(), and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
void itpp::Mat< Num_T >::append_col ( const Vec< Num_T > &  in  )  [inline]

Append vector to the right of the matrix, the matrix can be empty.

Definition at line 964 of file mat.h.

References itpp::Mat< Num_T >::ins_col(), and itpp::Mat< Num_T >::no_cols.

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::transpose (  )  const [inline]

Matrix transpose.

Definition at line 970 of file mat.h.

References itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::Mat< unsigned short int >::T().

template<class Num_T>
const Mat<Num_T> itpp::Mat< Num_T >::T (  )  const [inline]

Matrix transpose.

Definition at line 312 of file mat.h.

Referenced by itpp::transpose().

template<class Num_T>
const Mat< Num_T > itpp::Mat< Num_T >::hermitian_transpose (  )  const [inline]

Hermitian matrix transpose (conjugate transpose).

Definition at line 983 of file mat.h.

References itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

Referenced by itpp::Mat< unsigned short int >::H().

template<class Num_T>
const Mat<Num_T> itpp::Mat< Num_T >::H (  )  const [inline]

Hermitian matrix transpose (conjugate transpose).

Definition at line 316 of file mat.h.

Referenced by itpp::hermitian_transpose(), itpp::is_hermitian(), and itpp::is_unitary().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator= ( Num_T  t  )  [inline]

Set all elements of the matrix equal to t.

Definition at line 1030 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

Referenced by itpp::Mat< Num_T >::operator *=(), and itpp::Mat< Num_T >::operator+=().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator= ( const Mat< Num_T > &  m  )  [inline]

Set matrix equal to m.

Definition at line 1038 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::set_size().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator= ( const Vec< Num_T > &  v  )  [inline]

Set matrix equal to the vector v, assuming column vector.

Definition at line 1049 of file mat.h.

References it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, itpp::Mat< Num_T >::set_col(), itpp::Mat< Num_T >::set_size(), and itpp::Vec< Num_T >::size().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator= ( const char *  values  )  [inline]

Set matrix equal to values in the string.

Definition at line 1062 of file mat.h.

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator+= ( const Mat< Num_T > &  m  )  [inline]

Addition of matrices.

Definition at line 1071 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::operator=().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator+= ( Num_T  t  )  [inline]

Addition of scalar to matrix.

Definition at line 1089 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator-= ( const Mat< Num_T > &  m  )  [inline]

Subtraction of matrix.

Definition at line 1140 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::set_size().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator-= ( Num_T  t  )  [inline]

Subtraction of scalar from matrix.

Definition at line 1187 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator *= ( const Mat< Num_T > &  m  )  [inline]

Matrix multiplication.

Definition at line 1251 of file mat.h.

References itpp::Mat< Num_T >::data, it_assert1, itpp::Mat< Num_T >::no_cols, itpp::Mat< Num_T >::no_rows, and itpp::Mat< Num_T >::operator=().

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator *= ( Num_T  t  )  [inline]

Multiplication by a scalar.

Definition at line 1278 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator/= ( Num_T  t  )  [inline]

Division by a scalar.

Definition at line 1388 of file mat.h.

References itpp::Mat< Num_T >::data, and itpp::Mat< Num_T >::datasize.

template<class Num_T>
Mat< Num_T > & itpp::Mat< Num_T >::operator/= ( const Mat< Num_T > &  m  )  [inline]

Elementwise division with the current matrix.

Definition at line 1407 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, it_assert1, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
bool itpp::Mat< Num_T >::operator== ( const Mat< Num_T > &  m  )  const [inline]

Compare two matrices. False if wrong sizes or different values.

Definition at line 1429 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
bool itpp::Mat< Num_T >::operator!= ( const Mat< Num_T > &  m  )  const [inline]

Compare two matrices. True if different.

Definition at line 1439 of file mat.h.

References itpp::Mat< Num_T >::data, itpp::Mat< Num_T >::datasize, itpp::Mat< Num_T >::no_cols, and itpp::Mat< Num_T >::no_rows.

template<class Num_T>
Num_T& itpp::Mat< Num_T >::_elem ( int  R,
int  C 
) [inline]

Get element (R,C) from matrix without boundary check (Not recommended to use).

Definition at line 388 of file mat.h.

template<class Num_T>
const Num_T& itpp::Mat< Num_T >::_elem ( int  R,
int  C 
) const [inline]

Get element (R,C) from matrix without boundary check (Not recommended to use).

Definition at line 390 of file mat.h.

template<class Num_T>
Num_T& itpp::Mat< Num_T >::_elem ( int  index  )  [inline]

Get element index using linear addressing (by rows) without boundary check (Not recommended to use).

Definition at line 392 of file mat.h.

template<class Num_T>
const Num_T& itpp::Mat< Num_T >::_elem ( int  index  )  const [inline]

Get element index using linear addressing (by rows) without boundary check (Not recommended to use).

Definition at line 394 of file mat.h.

template<class Num_T>
Num_T* itpp::Mat< Num_T >::_data (  )  [inline]

Access of the internal data structure. Don't use. May be changed!

Definition at line 397 of file mat.h.

Referenced by itpp::operator *(), and itpp::Vec< Num_T >::operator=().

template<class Num_T>
const Num_T* itpp::Mat< Num_T >::_data (  )  const [inline]

Access to the internal data structure. Don't use. May be changed!

Definition at line 399 of file mat.h.

template<class Num_T>
int itpp::Mat< Num_T >::_datasize (  )  const [inline]

Access to the internal data structure. Don't use. May be changed!

Definition at line 401 of file mat.h.

template<class Num_T>
void itpp::Mat< Num_T >::alloc ( int  rows,
int  cols 
) [inline, protected]

Allocate memory for the matrix.

Definition at line 405 of file mat.h.

Referenced by itpp::Mat< Num_T >::Mat(), itpp::Mat< unsigned short int >::Mat(), itpp::Mat< Num_T >::set(), and itpp::Mat< Num_T >::set_size().

template<class Num_T>
void itpp::Mat< Num_T >::free (  )  [inline, protected]

Free the memory space of the matrix.

Definition at line 423 of file mat.h.

Referenced by itpp::Mat< unsigned short int >::alloc(), and itpp::Mat< unsigned short int >::~Mat().


Friends And Related Function Documentation

template<class Num_T>
typedef Mat<double> mat [related]

Default Matrix Type.

Definition at line 450 of file mat.h.

template<class Num_T>
typedef Mat<std::complex<double> > cmat [related]

Default Complex Matrix Type.

Definition at line 456 of file mat.h.

template<class Num_T>
typedef Mat<int> imat [related]

Integer matrix.

Definition at line 462 of file mat.h.

template<class Num_T>
typedef Mat<short int> smat [related]

short int matrix

Definition at line 468 of file mat.h.

template<class Num_T>
const Mat<Num_T> concat_horizontal ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Concatenate the matrices m1 and m2 horizontally.

template<class Num_T>
const Mat<Num_T> concat_vertical ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Concatenate the matrices m1 and m2 vertically.

template<class Num_T>
const Mat<Num_T> operator+ ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Addition of two matrices.

template<class Num_T>
const Mat<Num_T> operator+ ( const Mat< Num_T > &  m,
Num_T  t 
) [friend]

Addition of matrix and scalar.

template<class Num_T>
const Mat<Num_T> operator+ ( Num_T  t,
const Mat< Num_T > &  m 
) [friend]

Addition of scalar and matrix.

template<class Num_T>
const Mat<Num_T> operator- ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Subtraction of m2 from m1.

template<class Num_T>
const Mat<Num_T> operator- ( const Mat< Num_T > &  m,
Num_T  t 
) [friend]

Subraction of scalar from matrix.

template<class Num_T>
const Mat<Num_T> operator- ( Num_T  t,
const Mat< Num_T > &  m 
) [friend]

Subtract matrix from scalar.

template<class Num_T>
const Mat<Num_T> operator- ( const Mat< Num_T > &  m  )  [friend]

Subraction of matrix.

template<class Num_T>
const Mat<Num_T> operator * ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Multiplication of two matrices.

template<class Num_T>
const Vec<Num_T> operator * ( const Mat< Num_T > &  m,
const Vec< Num_T > &  v 
) [friend]

Multiplication of matrix m and vector v (column vector).

template<class Num_T>
const Mat<Num_T> operator * ( const Vec< Num_T > &  v,
const Mat< Num_T > &  m 
) [friend]

Multiplication of transposed vector v and matrix m.

template<class Num_T>
const Mat<Num_T> operator * ( const Mat< Num_T > &  m,
Num_T  t 
) [friend]

Multiplication of matrix and scalar.

template<class Num_T>
const Mat<Num_T> operator * ( Num_T  t,
const Mat< Num_T > &  m 
) [friend]

Multiplication of scalar and matrix.

template<class Num_T>
const Mat<Num_T> elem_mult ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Elementwise multiplication of two matrices.

template<class Num_T>
const Mat<Num_T> operator/ ( const Mat< Num_T > &  m,
Num_T  t 
) [friend]

Division of matrix with scalar.

template<class Num_T>
const Mat<Num_T> elem_div ( const Mat< Num_T > &  m1,
const Mat< Num_T > &  m2 
) [friend]

Elementwise division of matrix m1 with matrix m2.

template<class Num_T>
void sub_v_vT_m ( mat m,
const vec &  v 
) [related]

Calculates m=m-v*v'*m.

template<class Num_T>
void sub_m_v_vT ( mat m,
const vec &  v 
) [related]

Calculates m=m-m*v*v'.

template<class Num_T>
std::ostream & operator<< ( std::ostream &  os,
const Mat< Num_T > &  m 
) [related]

Output stream for matrices.

Definition at line 1449 of file mat.h.

template<class Num_T>
std::istream & operator>> ( std::istream &  is,
Mat< Num_T > &  m 
) [related]

Input stream for matrices.

The input can be on the form "1 2 3; 4 5 6" or "[[1 2 3][4 5 6]]", i.e. with brackets or semicolons as row delimiters. The first form is compatible with the set method, while the second form is compatible with the ostream operator. The elements on a row can be separated by blank space or commas. Rows that are shorter than the longest row are padded with zero elements. "[]" means an empty matrix.

Definition at line 1471 of file mat.h.

template<class Num_T>
mat operator+ ( const float &  s,
const mat m 
) [related]

Addition operator for float and mat.

Definition at line 499 of file operators.h.

template<class Num_T>
mat operator+ ( const short &  s,
const mat m 
) [related]

Addition operator for short and mat.

Definition at line 505 of file operators.h.

template<class Num_T>
mat operator+ ( const int &  s,
const mat m 
) [related]

Addition operator for int and mat.

Definition at line 511 of file operators.h.

template<class Num_T>
mat operator+ ( const mat m,
const float &  s 
) [related]

Addition operator for mat and float.

Definition at line 517 of file operators.h.

template<class Num_T>
mat operator+ ( const mat m,
const short &  s 
) [related]

Addition operator for mat and short.

Definition at line 523 of file operators.h.

template<class Num_T>
mat operator+ ( const mat m,
const int &  s 
) [related]

Addition operator for mat and int.

Definition at line 529 of file operators.h.

template<class Num_T>
mat operator- ( const float &  s,
const mat m 
) [related]

Subtraction operator for float and mat.

Definition at line 535 of file operators.h.

template<class Num_T>
mat operator- ( const short &  s,
const mat m 
) [related]

Subtraction operator for short and mat.

Definition at line 541 of file operators.h.

template<class Num_T>
mat operator- ( const int &  s,
const mat m 
) [related]

Subtraction operator for int and mat.

Definition at line 547 of file operators.h.

template<class Num_T>
mat operator- ( const mat m,
const float &  s 
) [related]

Subtraction operator for mat and float.

Definition at line 553 of file operators.h.

template<class Num_T>
mat operator- ( const mat m,
const short &  s 
) [related]

Subtraction operator for mat and short.

Definition at line 559 of file operators.h.

template<class Num_T>
mat operator- ( const mat m,
const int &  s 
) [related]

Subtraction operator for mat and int.

Definition at line 565 of file operators.h.

template<class Num_T>
mat operator * ( const float &  s,
const mat m 
) [related]

Multiplication operator for float and mat.

Definition at line 571 of file operators.h.

template<class Num_T>
mat operator * ( const short &  s,
const mat m 
) [related]

Multiplication operator for short and mat.

Definition at line 577 of file operators.h.

template<class Num_T>
mat operator * ( const int &  s,
const mat m 
) [related]

Multiplication operator for int and mat.

Definition at line 583 of file operators.h.

template<class Num_T>
mat operator * ( const mat m,
const float &  s 
) [related]

Multiplication operator for mat and float.

Definition at line 589 of file operators.h.

template<class Num_T>
mat operator * ( const mat m,
const short &  s 
) [related]

Multiplication operator for mat and short.

Definition at line 595 of file operators.h.

template<class Num_T>
mat operator * ( const mat m,
const int &  s 
) [related]

Multiplication operator for mat and int.

Definition at line 601 of file operators.h.

template<class Num_T>
mat operator/ ( const mat m,
const float &  s 
) [related]

Division operator for mat and float.

Definition at line 607 of file operators.h.

template<class Num_T>
mat operator/ ( const mat m,
const short &  s 
) [related]

Division operator for mat and short.

Definition at line 613 of file operators.h.

template<class Num_T>
mat operator/ ( const mat m,
const int &  s 
) [related]

Division operator for mat and int.

Definition at line 619 of file operators.h.

template<class Num_T>
cmat operator+ ( const double &  s,
const cmat m 
) [related]

Addition operator for double and cmat.

template<class Num_T>
cmat operator- ( const double &  s,
const cmat m 
) [related]

Subtraction operator for double and cmat.

template<class Num_T>
cmat operator * ( const double &  s,
const cmat m 
) [related]

Multiplication operator for double and cmat.

template<class Num_T>
cmat operator * ( const std::complex< double > &  s,
const mat m 
) [related]

Multiplication operator for complex<double> and mat.

template<class Num_T>
cmat operator * ( const mat m,
const std::complex< double > &  s 
) [related]

Multiplication operator for mat and complex<double>.

Definition at line 651 of file operators.h.

template<class Num_T>
cmat operator/ ( const cmat m,
const double &  s 
) [related]

Division operator for cmat and double.

template<class Num_T>
cmat operator+ ( const bmat a,
const mat b 
) [related]

Addition operator for bmat and cmat.

template<class Num_T>
cmat operator+ ( const smat a,
const mat b 
) [related]

Addition operator for cmat and mat.

Definition at line 373 of file fix_operators.cpp.

template<class Num_T>
cmat operator+ ( const mat a,
const bmat b 
) [related]

Addition operator for cmat and bmat.

Definition at line 908 of file operators.h.

template<class Num_T>
cmat operator- ( const bmat a,
const mat b 
) [related]

Subtraction operator for bmat and cmat.

Definition at line 926 of file operators.h.

template<class Num_T>
cmat operator- ( const smat a,
const mat b 
) [related]

Subtraction operator for cmat and mat.

Definition at line 932 of file operators.h.

template<class Num_T>
cmat operator- ( const mat a,
const bmat b 
) [related]

Subtraction operator for cmat and bmat.

Definition at line 944 of file operators.h.

template<class Num_T>
cmat operator * ( const mat a,
const cmat b 
) [related]

Multiplication operator for cmat and imat.

Definition at line 1060 of file operators.h.

References itpp::to_cmat().

template<class Num_T>
cmat operator * ( const bmat a,
const cmat b 
) [related]

Multiplication operator for bmat and cmat.

Definition at line 1066 of file operators.h.

References itpp::to_cmat().

template<class Num_T>
cmat operator * ( const cmat a,
const bmat b 
) [related]

Multiplication operator for cmat and bmat.

Definition at line 1090 of file operators.h.

References itpp::to_cmat().

template<class Num_T>
Mat< T > mat_1x1 ( m00  )  [related]

Matrix of size 1 by 1.

Definition at line 261 of file specmat.h.

template<class Num_T>
Mat< T > mat_1x2 ( m00,
m01 
) [related]

Matrix of size 1 by 2.

Definition at line 273 of file specmat.h.

template<class Num_T>
Mat< T > mat_2x1 ( m00,
m10 
) [related]

Matrix of size 2 by 1.

Definition at line 285 of file specmat.h.

template<class Num_T>
Mat< T > mat_2x2 ( m00,
m01,
m10,
m11 
) [related]

Matrix of size 2 by 2.

Definition at line 299 of file specmat.h.

template<class Num_T>
Mat< T > mat_1x3 ( m00,
m01,
m02 
) [related]

Matrix of size 1 by 3.

Definition at line 313 of file specmat.h.

template<class Num_T>
Mat< T > mat_3x1 ( m00,
m10,
m20 
) [related]

Matrix of size 3 by 1.

Definition at line 325 of file specmat.h.

template<class Num_T>
Mat< T > mat_2x3 ( m00,
m01,
m02,
m10,
m11,
m12 
) [related]

Matrix of size 2 by 3.

Definition at line 341 of file specmat.h.

template<class Num_T>
Mat< T > mat_3x2 ( m00,
m01,
m10,
m11,
m20,
m21 
) [related]

Matrix of size 3 by 2.

Definition at line 355 of file specmat.h.

template<class Num_T>
Mat< T > mat_3x3 ( m00,
m01,
m02,
m10,
m11,
m12,
m20,
m21,
m22 
) [related]

Matrix of size 3 by 3.

Definition at line 371 of file specmat.h.


Member Data Documentation

template<class Num_T>
int itpp::Mat< Num_T >::datasize [protected]

Protected integer variables.

Definition at line 426 of file mat.h.

Referenced by itpp::Mat< unsigned short int >::_datasize(), itpp::Mat< unsigned short int >::alloc(), itpp::elem_div(), itpp::elem_mult(), itpp::Mat< Num_T >::Mat(), itpp::Mat< Num_T >::ones(), itpp::operator *(), itpp::Mat< Num_T >::operator *=(), itpp::Mat< Num_T >::operator!=(), itpp::operator+(), itpp::Mat< Num_T >::operator+=(), itpp::Mat< Num_T >::operator-=(), itpp::operator/(), itpp::Mat< Num_T >::operator/=(), itpp::Mat< Num_T >::operator=(), itpp::Mat< Num_T >::operator==(), itpp::Mat< unsigned short int >::size(), and itpp::Mat< Num_T >::zeros().

template<class Num_T>
Num_T* itpp::Mat< Num_T >::data [protected]

Protected data pointer.

Definition at line 429 of file mat.h.

Referenced by itpp::Mat< unsigned short int >::_data(), itpp::Mat< unsigned short int >::_elem(), itpp::Mat< unsigned short int >::alloc(), itpp::Mat< Num_T >::copy_col(), itpp::Mat< Num_T >::copy_row(), itpp::Mat< Num_T >::del_col(), itpp::Mat< Num_T >::del_cols(), itpp::Mat< Num_T >::del_row(), itpp::elem_div(), itpp::elem_mult(), itpp::Mat< unsigned short int >::free(), itpp::Mat< unsigned short int >::get(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_cols(), itpp::Mat< Num_T >::get_row(), itpp::Mat< Num_T >::get_rows(), itpp::Mat< Num_T >::ins_col(), itpp::Mat< Num_T >::ins_row(), itpp::Mat< Num_T >::Mat(), itpp::Mat< Num_T >::ones(), itpp::operator *(), itpp::Mat< Num_T >::operator *=(), itpp::Mat< Num_T >::operator!=(), itpp::Mat< Num_T >::operator()(), itpp::Mat< unsigned short int >::operator()(), itpp::operator+(), itpp::Mat< Num_T >::operator+=(), itpp::operator-(), itpp::Mat< Num_T >::operator-=(), itpp::operator/(), itpp::Mat< Num_T >::operator/=(), itpp::Mat< Num_T >::operator=(), itpp::Mat< Num_T >::operator==(), itpp::Mat< unsigned short int >::set(), itpp::Mat< Num_T >::set_col(), itpp::Mat< Num_T >::set_row(), itpp::Mat< Num_T >::set_size(), itpp::Mat< Num_T >::set_submatrix(), itpp::Mat< Num_T >::swap_cols(), itpp::Mat< Num_T >::swap_rows(), and itpp::Mat< Num_T >::zeros().

template<class Num_T>
const Factory& itpp::Mat< Num_T >::factory [protected]

Element factory (set to DEFAULT_FACTORY to use Num_T default constructors only).

Definition at line 432 of file mat.h.

Referenced by itpp::Mat< unsigned short int >::alloc().


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Fri Jun 8 00:37:37 2007 for IT++ by Doxygen 1.5.2