CIMPL::Matrix< T > Class Template Reference

2-D Matrix class. More...

#include <Matrix.h>

List of all members.

Public Member Functions

 Matrix ()
 Matrix (const int rows, const int columns)
 Matrix (const int rows, const int columns, T init)
 Matrix (string str)
 Matrix (Matrix< T > &m)
 ~Matrix ()
void Clean ()
void Set (const int rows, const int columns, T *_data)
const T * DataPtr ()
T * Data ()
Matrix< T > Clone () const
void SwitchColumns (int i, int j)
void SyncData2Columns ()
 reorganizes data array such that matrix elements are ordered in column major ordering. Calling this function will allocate new memory with correct ordering of elements and old memory is freed.
Matrix< T > Slice (int row1, int row2, int col1, int col2)
Matrix< T > Slice (string str1, string str2)
Vector< T > Slice (string str)
const int Columns () const
const int Rows () const
const int XDim () const
const int YDim () const
const int * Dims () const
const int Length () const
const int Numel () const
const int NDims () const
void Init (const T init)
Matrix< T > & Rand (const double max)
void ReadFromMatrix (const Matrix< T > &m)
void ReadFromMatrix (const Matrix< T > &m, const int rowStart, const int colStart)
Matrix< T > & Transpose ()
 Transpose of a matrix. Does not allocate a new Matrix. Creates transpose inline.
Matrix< T > & Add (Matrix< T > &m)
Matrix< T > & Subtract (Matrix< T > &m)
Matrix< T > & Multiply (Matrix< T > &m)
Matrix< T > & Divide (Matrix< T > &m)
Matrix< T > & Add (T v)
Matrix< T > & Subtract (T v)
Matrix< T > & Multiply (T v)
Matrix< T > & Divide (T v)
Matrix< T > & operator= (Matrix< T > &m)
Matrix< T > & operator= (Array< T > &m)
Matrix< T > & operator= (Vector< T > &m)
Matrix< T > & operator= (SubMatrix< T > &m)
Matrix< T > & operator= (string str)
Matrix< T > operator+ ()
 Unary +. Does not have any effect. Returns the same matrix.
Matrix< T > operator- ()
 Unary -.
Matrix< int > operator! ()
Matrix< T > operator~ ()
 Transpose ~.
T & Coor (const int x, const int y)
 Matrix element access using coordinates (x,y). Bounds are checked.
T & CoorNC (const int x, const int y)
 Matrix element access using coordinates (x,y). Bounds are not checked.
T & Elem (const int _row, const int _col)
 Matrix element access (row,col). Bounds are checked.
T & ElemNC (const int _row, const int _col)
 Matrix element access (row,col). Bounds are not checked.
T & Elem (const int i)
 Matrix element access (sequential: column scan). Bounds are checked.
T & ElemNC (const int i)
 Matrix element access (sequential: column scan). Bounds are not checked.
T & operator() (const int i)
 Matrix element access (sequential: column scan). Bounds are checked (See ElemNC() for element access with no bounds check).
T & operator() (const int i, const int j)
 Matrix element access (row,col). Bounds are checked (See ElemNC() for element access with no bounds check).
Vector< T > & operator[] (const int i)
 Returns a pointer to the beginning of a column.
SubMatrix< T > operator() (const int row1, const int row2, const int col1, const int col2)
 Takes a rectangular slice of a matrix, makes a copy and returns the slice as a new Matrix.
SubMatrix< T > operator() (string str1, string str2)
 returns a new Matrix using the slice rectangle.
Vector< T > operator() (string str)
Matrix< T > & operator+= (Matrix< T > &m)
Matrix< T > & operator-= (Matrix< T > &m)
Matrix< T > & operator *= (Matrix< T > &m)
Matrix< T > & operator/= (Matrix< T > &m)
Matrix< T > & operator+= (T v)
Matrix< T > & operator-= (T v)
Matrix< T > & operator *= (T v)
Matrix< T > & operator/= (T v)
 Matrix (Array< T > &m)
 Matrix (Vector< T > &m)
 Matrix (SubMatrix< T > &m)

Static Public Member Functions

Matrix< T > Rand (const int rows, const int cols, const double max)
Matrix< T > Cat (int dimension, Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > Cat (int dimension, Matrix< T > &m1, Vector< T > &m2)
Matrix< T > Cat (int dimension, Vector< T > &m1, Matrix< T > &m2)
Matrix< T > Cat (int dimension, Vector< T > &m1, Vector< T > &m2)
Matrix< T > Ones (int side)
Matrix< T > Ones (int rows, int cols)
Matrix< T > Zeros (int side)
Matrix< T > Zeros (int rows, int cols)
bool IsSquare (Matrix< T > &m)
bool IsM2MCompatible (Matrix< T > &m1, Matrix< T > &m2)
 are these matrices (and in this order) are compatible for matrix multiplication
Matrix< T > MMultiply (Matrix< T > &m1, Matrix< T > &m2)
 Matrix multiplication. Also used to overload & operator.
Matrix< T > MMultiply (Matrix< T > &m1, Vector< T > &m2)
 Matrix to Vector multiplication. Vector is taken as a column vector.
Matrix< T > MMultiply (Vector< T > &m1, Matrix< T > &m2)
 Vector to Matrix multiplication. Vector is taken as a row vector.
Matrix< T > Transpose (Matrix< T > &m)
 Transpose of a matrix. Allocates a new Matrix.
bool IsCompatible (Matrix< T > &m1, Matrix< T > &m2)
 Check if two matrices have the same sizes.
Matrix< int > And (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise AND operator. Returns 1 or 0 for each element.
Matrix< int > Or (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise OR operator. Returns 1 or 0 for each element.
Matrix< int > Lt (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise < (less than) operator. Returns 1 or 0 for each element.
Matrix< int > Gt (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise > (greater than) operator. Returns 1 or 0 for each element.
Matrix< int > Le (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise <= (less than or equal) operator. Returns 1 or 0 for each element.
Matrix< int > Ge (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise >= (greater than or equal) operator. Returns 1 or 0 for each element.
Matrix< int > Eq (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise == operator. Returns 1 or 0 for each element.
Matrix< int > Ne (Matrix< T > &m1, Matrix< T > &m2)
 Elementwise != (not equal) operator. Returns 1 or 0 for each element.
Matrix< int > And (Matrix< T > &m, T v)
 AND operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Or (Matrix< T > &m, T v)
 OR operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Lt (Matrix< T > &m, T v)
 < (Less than) operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Gt (Matrix< T > &m, T v)
 > (Greater than) operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Le (Matrix< T > &m, T v)
 <= (Less than or equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Ge (Matrix< T > &m, T v)
 <= (Greater than or equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Eq (Matrix< T > &m, T v)
 == operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< int > Ne (Matrix< T > &m, T v)
 != (Not equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.
Matrix< T > Add (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > Subtract (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > Multiply (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > Divide (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > Add (Matrix< T > &m1, T v2)
Matrix< T > Subtract (Matrix< T > &m1, T v2)
Matrix< T > Subtract (T v2, Matrix< T > &m1)
Matrix< T > Multiply (Matrix< T > &m1, T v2)
Matrix< T > Divide (Matrix< T > &m1, T v2)
Matrix< T > Divide (T v2, Matrix< T > &m1)

Protected Attributes

T * data
int ndims
int length
int xDim
int yDim
Cleaner< T > * clean
Vector< T > * columns

Friends

class Array<T>
class Vector<T>
class SubMatrix<T>
Matrix< T > operator, (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator, (Matrix< T > &m1, Vector< T > &m2)
Matrix< T > operator, (Vector< T > &m1, Matrix< T > &m2)
Matrix< T > operator| (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator| (Matrix< T > &m1, Vector< T > &m2)
Matrix< T > operator| (Vector< T > &m1, Matrix< T > &m2)
ostream & operator<< (ostream &output, Matrix< T > &m)
Matrix< T > operator & (Matrix< T > &m1, Matrix< T > &m2)
 Matrix to Matrix multiplication.
Matrix< T > operator & (Matrix< T > &m1, Vector< T > &m2)
 Matrix to column Vector multiplication.
Matrix< T > operator & (Vector< T > &m1, Matrix< T > &m2)
 Row Vector to Matrix multiplication.
Matrix< int > operator && (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator|| (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator< (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator> (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator<= (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator>= (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator== (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator!= (Matrix< T > &m1, Matrix< T > &m2)
Matrix< int > operator && (Matrix< T > &m, T v)
Matrix< int > operator && (T v, Matrix< T > &m)
Matrix< int > operator|| (Matrix< T > &m, T v)
Matrix< int > operator|| (T v, Matrix< T > &m)
Matrix< int > operator< (Matrix< T > &m, T v)
Matrix< int > operator< (T v, Matrix< T > &m)
Matrix< int > operator> (Matrix< T > &m, T v)
Matrix< int > operator> (T v, Matrix< T > &m)
Matrix< int > operator<= (Matrix< T > &m, T v)
Matrix< int > operator<= (T v, Matrix< T > &m)
Matrix< int > operator>= (Matrix< T > &m, T v)
Matrix< int > operator>= (T v, Matrix< T > &m)
Matrix< int > operator== (Matrix< T > &m, T v)
Matrix< int > operator== (T v, Matrix< T > &m)
Matrix< int > operator!= (Matrix< T > &m, T v)
Matrix< int > operator!= (T v, Matrix< T > &m)
Matrix< T > operator+ (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator- (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator * (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator/ (Matrix< T > &m1, Matrix< T > &m2)
Matrix< T > operator+ (Matrix< T > &m, T v)
Matrix< T > operator+ (T v, Matrix< T > &m)
Matrix< T > operator- (Matrix< T > &m, T v)
Matrix< T > operator- (T v, Matrix< T > &m)
Matrix< T > operator * (Matrix< T > &m, T v)
Matrix< T > operator * (T v, Matrix< T > &m)
Matrix< T > operator/ (Matrix< T > &m, T v)
Matrix< T > operator/ (T v, Matrix< T > &m)


Detailed Description

template<class T>
class CIMPL::Matrix< T >

2-D Matrix class.

Definition at line 114 of file Matrix.h.


Constructor & Destructor Documentation

template<class T>
CIMPL::Matrix< T >::Matrix  ) 
 

Definition at line 67 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix const int  rows,
const int  columns
 

Definition at line 80 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix const int  rows,
const int  columns,
init
 

Definition at line 108 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix string  str  ) 
 

Definition at line 144 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix Matrix< T > &  m  ) 
 

Definition at line 205 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::~Matrix  ) 
 

Definition at line 223 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix Array< T > &  m  ) 
 

Definition at line 1948 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix Vector< T > &  m  ) 
 

Definition at line 1995 of file Matrix.inl.

template<class T>
CIMPL::Matrix< T >::Matrix SubMatrix< T > &  m  ) 
 

Definition at line 2014 of file Matrix.inl.


Member Function Documentation

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Add v  ) 
 

Definition at line 1434 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Add Matrix< T > &  m  ) 
 

Definition at line 1354 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Add Matrix< T > &  m1,
v2
[static]
 

Definition at line 1268 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Add Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 1181 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::And Matrix< T > &  m,
v
[static]
 

AND operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1056 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::And Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise AND operator. Returns 1 or 0 for each element.

Definition at line 895 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Cat int  dimension,
Vector< T > &  m1,
Vector< T > &  m2
[static]
 

Definition at line 685 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Cat int  dimension,
Vector< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 679 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Cat int  dimension,
Matrix< T > &  m1,
Vector< T > &  m2
[static]
 

Definition at line 673 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Cat int  dimension,
Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 635 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::Clean  ) 
 

Definition at line 234 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Clone  )  const
 

Definition at line 288 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::Columns  )  const [inline]
 

Definition at line 473 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::Coor const int  x,
const int  y
[inline]
 

Matrix element access using coordinates (x,y). Bounds are checked.

Definition at line 1696 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::CoorNC const int  x,
const int  y
[inline]
 

Matrix element access using coordinates (x,y). Bounds are not checked.

Definition at line 1711 of file Matrix.inl.

template<class T>
T * CIMPL::Matrix< T >::Data  )  [inline]
 

Definition at line 281 of file Matrix.inl.

template<class T>
const T * CIMPL::Matrix< T >::DataPtr  )  [inline]
 

Definition at line 275 of file Matrix.inl.

template<class T>
const int* CIMPL::Matrix< T >::Dims  )  const
 

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Divide v  ) 
 

Definition at line 1464 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Divide Matrix< T > &  m  ) 
 

Definition at line 1405 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Divide v2,
Matrix< T > &  m1
[static]
 

Definition at line 1330 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Divide Matrix< T > &  m1,
v2
[static]
 

Definition at line 1313 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Divide Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 1236 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::Elem const int  i  )  [inline]
 

Matrix element access (sequential: column scan). Bounds are checked.

Definition at line 1652 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::Elem const int  _row,
const int  _col
[inline]
 

Matrix element access (row,col). Bounds are checked.

Definition at line 1672 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::ElemNC const int  i  )  [inline]
 

Matrix element access (sequential: column scan). Bounds are not checked.

Definition at line 1664 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::ElemNC const int  _row,
const int  _col
[inline]
 

Matrix element access (row,col). Bounds are not checked.

Definition at line 1687 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Eq Matrix< T > &  m,
v
[static]
 

== operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1140 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Eq Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise == operator. Returns 1 or 0 for each element.

Definition at line 1010 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Ge Matrix< T > &  m,
v
[static]
 

<= (Greater than or equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1126 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Ge Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise >= (greater than or equal) operator. Returns 1 or 0 for each element.

Definition at line 991 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Gt Matrix< T > &  m,
v
[static]
 

> (Greater than) operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1098 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Gt Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise > (greater than) operator. Returns 1 or 0 for each element.

Definition at line 953 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::Init const T  init  )  [inline]
 

Definition at line 519 of file Matrix.inl.

template<class T>
bool CIMPL::Matrix< T >::IsCompatible Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Check if two matrices have the same sizes.

Definition at line 875 of file Matrix.inl.

template<class T>
bool CIMPL::Matrix< T >::IsM2MCompatible Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

are these matrices (and in this order) are compatible for matrix multiplication

Definition at line 746 of file Matrix.inl.

template<class T>
bool CIMPL::Matrix< T >::IsSquare Matrix< T > &  m  )  [static]
 

Definition at line 728 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Le Matrix< T > &  m,
v
[static]
 

<= (Less than or equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1112 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Le Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise <= (less than or equal) operator. Returns 1 or 0 for each element.

Definition at line 972 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::Length  )  const [inline]
 

Definition at line 501 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Lt Matrix< T > &  m,
v
[static]
 

< (Less than) operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1084 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Lt Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise < (less than) operator. Returns 1 or 0 for each element.

Definition at line 934 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::MMultiply Vector< T > &  m1,
Matrix< T > &  m2
[static]
 

Vector to Matrix multiplication. Vector is taken as a row vector.

Definition at line 811 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::MMultiply Matrix< T > &  m1,
Vector< T > &  m2
[static]
 

Matrix to Vector multiplication. Vector is taken as a column vector.

Definition at line 788 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::MMultiply Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Matrix multiplication. Also used to overload & operator.

Definition at line 761 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Multiply v  ) 
 

Definition at line 1454 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Multiply Matrix< T > &  m  ) 
 

Definition at line 1388 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Multiply Matrix< T > &  m1,
v2
[static]
 

Definition at line 1302 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Multiply Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 1218 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::NDims  )  const [inline]
 

Definition at line 513 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Ne Matrix< T > &  m,
v
[static]
 

!= (Not equal) operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1154 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Ne Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise != (not equal) operator. Returns 1 or 0 for each element.

Definition at line 1029 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::Numel  )  const [inline]
 

Definition at line 507 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Ones int  rows,
int  cols
[static]
 

Definition at line 700 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Ones int  side  )  [static]
 

Definition at line 692 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator *= v  ) 
 

Definition at line 1933 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator *= Matrix< T > &  m  ) 
 

Definition at line 1908 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::operator!  )  [inline]
 

Definition at line 1621 of file Matrix.inl.

template<class T>
Vector< T > CIMPL::Matrix< T >::operator() string  str  ) 
 

Definition at line 1885 of file Matrix.inl.

template<class T>
SubMatrix< T > CIMPL::Matrix< T >::operator() string  str1,
string  str2
 

returns a new Matrix using the slice rectangle.

Definition at line 1841 of file Matrix.inl.

template<class T>
SubMatrix< T > CIMPL::Matrix< T >::operator() const int  row1,
const int  row2,
const int  col1,
const int  col2
[inline]
 

Takes a rectangular slice of a matrix, makes a copy and returns the slice as a new Matrix.

Definition at line 1797 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::operator() const int  i,
const int  j
[inline]
 

Matrix element access (row,col). Bounds are checked (See ElemNC() for element access with no bounds check).

Definition at line 1735 of file Matrix.inl.

template<class T>
T & CIMPL::Matrix< T >::operator() const int  i  )  [inline]
 

Matrix element access (sequential: column scan). Bounds are checked (See ElemNC() for element access with no bounds check).

Definition at line 1723 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::operator+  )  [inline]
 

Unary +. Does not have any effect. Returns the same matrix.

Definition at line 1600 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator+= v  ) 
 

Definition at line 1921 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator+= Matrix< T > &  m  ) 
 

Definition at line 1896 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::operator-  )  [inline]
 

Unary -.

Definition at line 1608 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator-= v  ) 
 

Definition at line 1927 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator-= Matrix< T > &  m  ) 
 

Definition at line 1902 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator/= v  ) 
 

Definition at line 1939 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator/= Matrix< T > &  m  ) 
 

Definition at line 1914 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator= string  str  ) 
 

Definition at line 1586 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator= SubMatrix< T > &  m  ) 
 

Definition at line 1565 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator= Vector< T > &  m  ) 
 

Definition at line 1557 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator= Array< T > &  m  ) 
 

Definition at line 1509 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::operator= Matrix< T > &  m  ) 
 

Definition at line 1490 of file Matrix.inl.

template<class T>
Vector< T > & CIMPL::Matrix< T >::operator[] const int  i  )  [inline]
 

Returns a pointer to the beginning of a column.

Definition at line 1750 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::operator~  )  [inline]
 

Transpose ~.

Definition at line 1641 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Or Matrix< T > &  m,
v
[static]
 

OR operator between Matrix elements and a value. Returns 1 or 0 for each element.

Definition at line 1070 of file Matrix.inl.

template<class T>
Matrix< int > CIMPL::Matrix< T >::Or Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Elementwise OR operator. Returns 1 or 0 for each element.

Definition at line 915 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Rand const int  rows,
const int  cols,
const double  max
[static]
 

Definition at line 572 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Rand const double  max  )  [inline]
 

Definition at line 542 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::ReadFromMatrix const Matrix< T > &  m,
const int  rowStart,
const int  colStart
 

Definition at line 608 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::ReadFromMatrix const Matrix< T > &  m  ) 
 

Definition at line 589 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::Rows  )  const [inline]
 

Definition at line 479 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::Set const int  rows,
const int  columns,
T *  _data
 

Make sure enough memory is already allocated. Memory is from now on handled by the matrix... Don't free it manually.

Definition at line 247 of file Matrix.inl.

template<class T>
Vector< T > CIMPL::Matrix< T >::Slice string  str  ) 
 

Definition at line 462 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Slice string  str1,
string  str2
 

Definition at line 417 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Slice int  row1,
int  row2,
int  col1,
int  col2
 

Definition at line 334 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Subtract v  ) 
 

Definition at line 1444 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Subtract Matrix< T > &  m  ) 
 

Definition at line 1371 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Subtract v2,
Matrix< T > &  m1
[static]
 

Definition at line 1290 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Subtract Matrix< T > &  m1,
v2
[static]
 

Definition at line 1279 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Subtract Matrix< T > &  m1,
Matrix< T > &  m2
[static]
 

Definition at line 1200 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::SwitchColumns int  i,
int  j
 

Definition at line 299 of file Matrix.inl.

template<class T>
void CIMPL::Matrix< T >::SyncData2Columns  ) 
 

reorganizes data array such that matrix elements are ordered in column major ordering. Calling this function will allocate new memory with correct ordering of elements and old memory is freed.

If you created external (manual) pointers to matrix data, you might experience memory/pointer errors after the data is rearranged.

Definition at line 308 of file Matrix.inl.

template<class T>
Matrix< T > & CIMPL::Matrix< T >::Transpose  ) 
 

Transpose of a matrix. Does not allocate a new Matrix. Creates transpose inline.

Definition at line 851 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Transpose Matrix< T > &  m  )  [static]
 

Transpose of a matrix. Allocates a new Matrix.

Definition at line 835 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::XDim  )  const [inline]
 

Definition at line 486 of file Matrix.inl.

template<class T>
const int CIMPL::Matrix< T >::YDim  )  const [inline]
 

Definition at line 492 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Zeros int  rows,
int  cols
[static]
 

Definition at line 715 of file Matrix.inl.

template<class T>
Matrix< T > CIMPL::Matrix< T >::Zeros int  side  )  [static]
 

Definition at line 707 of file Matrix.inl.


Friends And Related Function Documentation

template<class T>
friend class Array<T> [friend]
 

Definition at line 117 of file Matrix.h.

template<class T>
Matrix<T> operator & Vector< T > &  m1,
Matrix< T > &  m2
[friend]
 

Row Vector to Matrix multiplication.

Definition at line 424 of file Matrix.h.

template<class T>
Matrix<T> operator & Matrix< T > &  m1,
Vector< T > &  m2
[friend]
 

Matrix to column Vector multiplication.

Definition at line 418 of file Matrix.h.

template<class T>
Matrix<T> operator & Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Matrix to Matrix multiplication.

Definition at line 412 of file Matrix.h.

template<class T>
Matrix<int> operator && v,
Matrix< T > &  m
[friend]
 

Definition at line 477 of file Matrix.h.

template<class T>
Matrix<int> operator && Matrix< T > &  m,
v
[friend]
 

Definition at line 473 of file Matrix.h.

template<class T>
Matrix<int> operator && Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 431 of file Matrix.h.

template<class T>
Matrix<T> operator * v,
Matrix< T > &  m
[friend]
 

Definition at line 600 of file Matrix.h.

template<class T>
Matrix<T> operator * Matrix< T > &  m,
v
[friend]
 

Definition at line 595 of file Matrix.h.

template<class T>
Matrix<T> operator * Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 563 of file Matrix.h.

template<class T>
Matrix<int> operator!= v,
Matrix< T > &  m
[friend]
 

Definition at line 540 of file Matrix.h.

template<class T>
Matrix<int> operator!= Matrix< T > &  m,
v
[friend]
 

Definition at line 536 of file Matrix.h.

template<class T>
Matrix<int> operator!= Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 466 of file Matrix.h.

template<class T>
Matrix<T> operator+ v,
Matrix< T > &  m
[friend]
 

Definition at line 580 of file Matrix.h.

template<class T>
Matrix<T> operator+ Matrix< T > &  m,
v
[friend]
 

Definition at line 575 of file Matrix.h.

template<class T>
Matrix<T> operator+ Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 553 of file Matrix.h.

template<class T>
Matrix<T> operator, Vector< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 285 of file Matrix.h.

template<class T>
Matrix<T> operator, Matrix< T > &  m1,
Vector< T > &  m2
[friend]
 

Definition at line 280 of file Matrix.h.

template<class T>
Matrix<T> operator, Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 275 of file Matrix.h.

template<class T>
Matrix<T> operator- v,
Matrix< T > &  m
[friend]
 

Definition at line 590 of file Matrix.h.

template<class T>
Matrix<T> operator- Matrix< T > &  m,
v
[friend]
 

Definition at line 585 of file Matrix.h.

template<class T>
Matrix<T> operator- Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 558 of file Matrix.h.

template<class T>
Matrix<T> operator/ v,
Matrix< T > &  m
[friend]
 

Definition at line 610 of file Matrix.h.

template<class T>
Matrix<T> operator/ Matrix< T > &  m,
v
[friend]
 

Definition at line 605 of file Matrix.h.

template<class T>
Matrix<T> operator/ Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 568 of file Matrix.h.

template<class T>
Matrix<int> operator< v,
Matrix< T > &  m
[friend]
 

Definition at line 495 of file Matrix.h.

template<class T>
Matrix<int> operator< Matrix< T > &  m,
v
[friend]
 

Definition at line 491 of file Matrix.h.

template<class T>
Matrix<int> operator< Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 441 of file Matrix.h.

template<class T>
ostream& operator<< ostream &  output,
Matrix< T > &  m
[friend]
 

Definition at line 311 of file Matrix.h.

template<class T>
Matrix<int> operator<= v,
Matrix< T > &  m
[friend]
 

Definition at line 513 of file Matrix.h.

template<class T>
Matrix<int> operator<= Matrix< T > &  m,
v
[friend]
 

Definition at line 509 of file Matrix.h.

template<class T>
Matrix<int> operator<= Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 451 of file Matrix.h.

template<class T>
Matrix<int> operator== v,
Matrix< T > &  m
[friend]
 

Definition at line 531 of file Matrix.h.

template<class T>
Matrix<int> operator== Matrix< T > &  m,
v
[friend]
 

Definition at line 527 of file Matrix.h.

template<class T>
Matrix<int> operator== Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 461 of file Matrix.h.

template<class T>
Matrix<int> operator> v,
Matrix< T > &  m
[friend]
 

Definition at line 504 of file Matrix.h.

template<class T>
Matrix<int> operator> Matrix< T > &  m,
v
[friend]
 

Definition at line 500 of file Matrix.h.

template<class T>
Matrix<int> operator> Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 446 of file Matrix.h.

template<class T>
Matrix<int> operator>= v,
Matrix< T > &  m
[friend]
 

Definition at line 522 of file Matrix.h.

template<class T>
Matrix<int> operator>= Matrix< T > &  m,
v
[friend]
 

Definition at line 518 of file Matrix.h.

template<class T>
Matrix<int> operator>= Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 456 of file Matrix.h.

template<class T>
Matrix<T> operator| Vector< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 301 of file Matrix.h.

template<class T>
Matrix<T> operator| Matrix< T > &  m1,
Vector< T > &  m2
[friend]
 

Definition at line 296 of file Matrix.h.

template<class T>
Matrix<T> operator| Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 291 of file Matrix.h.

template<class T>
Matrix<int> operator|| v,
Matrix< T > &  m
[friend]
 

Definition at line 486 of file Matrix.h.

template<class T>
Matrix<int> operator|| Matrix< T > &  m,
v
[friend]
 

Definition at line 482 of file Matrix.h.

template<class T>
Matrix<int> operator|| Matrix< T > &  m1,
Matrix< T > &  m2
[friend]
 

Definition at line 436 of file Matrix.h.

template<class T>
friend class SubMatrix<T> [friend]
 

Definition at line 119 of file Matrix.h.

template<class T>
friend class Vector<T> [friend]
 

Definition at line 118 of file Matrix.h.


Member Data Documentation

template<class T>
Cleaner<T>* CIMPL::Matrix< T >::clean [protected]
 

Definition at line 128 of file Matrix.h.

template<class T>
Vector<T>* CIMPL::Matrix< T >::columns [protected]
 

Definition at line 130 of file Matrix.h.

template<class T>
T* CIMPL::Matrix< T >::data [protected]
 

Definition at line 123 of file Matrix.h.

template<class T>
int CIMPL::Matrix< T >::length [protected]
 

Definition at line 125 of file Matrix.h.

template<class T>
int CIMPL::Matrix< T >::ndims [protected]
 

Definition at line 124 of file Matrix.h.

template<class T>
int CIMPL::Matrix< T >::xDim [protected]
 

Definition at line 126 of file Matrix.h.

template<class T>
int CIMPL::Matrix< T >::yDim [protected]
 

Definition at line 127 of file Matrix.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 20 08:43:51 2005 for CIMPL by  doxygen 1.3.9.1