Generated on Mon Jun 23 16:25:45 2008 for BIU-1.7.0 by doxygen 1.5.1

biu::SquareMatrix< T, matrixDim > Class Template Reference

#include <SquareMatrix.hh>

Inheritance diagram for biu::SquareMatrix< T, matrixDim >:

Inheritance graph
[legend]

Detailed Description

template<class T, size_t matrixDim>
class biu::SquareMatrix< T, matrixDim >

Generic square matrix with several matrix operations.

Author:
Martin Mann <mmann@informatik.uni-freiburg.de>

Definition at line 14 of file SquareMatrix.hh.

Public Member Functions

at (const size_t r, const size_t c)
std::vector< T > columnVec (const size_t col) const
size_t numColumns () const
size_t numRows () const
std::vector< T > operator * (const std::vector< T > &vec) const
Matrix< T > operator * (const T &c) const
Matrix< T > operator * (const Matrix< T > &mat) const
Matrix< T > & operator *= (const T &c)
Matrix< T > & operator *= (const Matrix< T > &mat)
bool operator!= (const T &val) const
bool operator!= (const Matrix< T > &mat) const
Matrix< T > operator+ (const T &c)
Matrix< T > operator+ (const Matrix< T > &mat)
Matrix< T > operator- (const T &c)
Matrix< T > operator- (const Matrix< T > &mat)
bool operator== (const T &val) const
bool operator== (const Matrix< T > &mat) const
const T *const operator[] (const size_t row) const
T *const operator[] (const size_t row)
void resize (const size_t row, const size_t col, const T &defVal)
void resize (const size_t row, const size_t col)
 SquareMatrix (const T m[matrixDim][matrixDim])
 SquareMatrix (const Matrix< T > &m)
 SquareMatrix (const SquareMatrix &m)
 SquareMatrix ()
 ~SquareMatrix ()

Static Public Member Functions

static SquareMatrix< T, matrixDim > createSquareMatrix (const T data[matrixDim][matrixDim])

Protected Attributes

size_t cols
size_t rows
T ** v


Constructor & Destructor Documentation

template<class T, size_t matrixDim>
biu::SquareMatrix< T, matrixDim >::SquareMatrix (  )  [inline]

constructs an empty matrix of size 0

Definition at line 39 of file SquareMatrix.hh.

template<class T, size_t matrixDim>
biu::SquareMatrix< T, matrixDim >::SquareMatrix ( const SquareMatrix< T, matrixDim > &  m  )  [inline]

copy constructor

Definition at line 53 of file SquareMatrix.hh.

template<class T, size_t matrixDim>
biu::SquareMatrix< T, matrixDim >::SquareMatrix ( const Matrix< T > &  m  )  [inline]

copy construction including resizing

Definition at line 59 of file SquareMatrix.hh.

template<class T, size_t matrixDim>
biu::SquareMatrix< T, matrixDim >::SquareMatrix ( const T  m[matrixDim][matrixDim]  )  [inline]

construction from array

Definition at line 46 of file SquareMatrix.hh.

template<class T, size_t matrixDim>
biu::SquareMatrix< T, matrixDim >::~SquareMatrix (  )  [inline]

Definition at line 70 of file SquareMatrix.hh.


Member Function Documentation

template<class T>
T biu::Matrix< T >::at ( const size_t  r,
const size_t  c 
) [inline, inherited]

access to element (r,c)

Parameters:
r the row to access
c the column to access
Returns:
the matrix element at position (r,c)

template<class T>
std::vector<T> biu::Matrix< T >::columnVec ( const size_t  col  )  const [inherited]

access to a matrix column

Parameters:
col the column to access
Returns:
the column vector

template<class T, size_t matrixDim>
SquareMatrix< T, matrixDim > biu::SquareMatrix< T, matrixDim >::createSquareMatrix ( const T  data[matrixDim][matrixDim]  )  [inline, static]

Definition at line 78 of file SquareMatrix.hh.

template<class T>
size_t biu::Matrix< T >::numColumns (  )  const [inline, inherited]

number of columns

Returns:
column number

template<class T>
size_t biu::Matrix< T >::numRows (  )  const [inline, inherited]

number of rows

Returns:
row number

template<class T>
std::vector<T> biu::Matrix< T >::operator * ( const std::vector< T > &  vec  )  const [inherited]

special case of * column number has to equal vec size

Parameters:
vec the column vector to multiply with
Returns:
a new column vector representing (this * vec)

template<class T>
Matrix<T> biu::Matrix< T >::operator * ( const T &  c  )  const [inherited]

matrix * constant

Parameters:
c the constant to multiply all elements with
Returns:
a new matrix representing (this * c)

template<class T>
Matrix<T> biu::Matrix< T >::operator * ( const Matrix< T > &  mat  )  const [inherited]

matrix * matrix row number have to equal column number and vice versa

Parameters:
mat the matrix to multiply with
Returns:
a new matrix representing (this * mat)

template<class T>
Matrix<T>& biu::Matrix< T >::operator *= ( const T &  c  )  [inherited]

matrix *= constant

Parameters:
c the constant to multiply all elements with
Returns:
*this

template<class T>
Matrix<T>& biu::Matrix< T >::operator *= ( const Matrix< T > &  mat  )  [inherited]

matrix *= matrix row number have to equal column number and vice versa

Parameters:
mat the matrix to multiply with
Returns:
*this

template<class T>
bool biu::Matrix< T >::operator!= ( const T &  val  )  const [inline, inherited]

test if at least one element doesnt equal val

Parameters:
val the value to compare with
Returns:
true if at least one element are is not equal, false otherwise

template<class T>
bool biu::Matrix< T >::operator!= ( const Matrix< T > &  mat  )  const [inline, inherited]

test for inequality

Parameters:
mat the matrix to compare with
Returns:
true if dimensions or at least one element are is not equal, false otherwise

template<class T>
Matrix<T> biu::Matrix< T >::operator+ ( const T &  c  )  [inherited]

matrix + constant

Parameters:
c the constant to add to all elements
Returns:
a new matrix representing (this + c)

template<class T>
Matrix<T> biu::Matrix< T >::operator+ ( const Matrix< T > &  mat  )  [inherited]

matrix + matrix row and column number have to be equal

Parameters:
mat the matrix to add
Returns:
a new matrix representing (this + mat)

template<class T>
Matrix<T> biu::Matrix< T >::operator- ( const T &  c  )  [inherited]

matrix - constant

Parameters:
c the constant to substract from all elements
Returns:
a new matrix representing (this - c)

template<class T>
Matrix<T> biu::Matrix< T >::operator- ( const Matrix< T > &  mat  )  [inherited]

matrix - matrix row and column number have to be equal

Parameters:
mat the matrix to substract
Returns:
a new matrix representing (this - mat)

template<class T>
bool biu::Matrix< T >::operator== ( const T &  val  )  const [inline, inherited]

test if all elements == val

Parameters:
val the value to compare with
Returns:
true if all elements are equal, false otherwise

template<class T>
bool biu::Matrix< T >::operator== ( const Matrix< T > &  mat  )  const [inline, inherited]

test for equality

Parameters:
mat the matrix to compare with
Returns:
true if dimensions and all elements are equal, false otherwise

template<class T>
const T* const biu::Matrix< T >::operator[] ( const size_t  row  )  const [inline, inherited]

constant access to row i

Parameters:
row the row to access
Returns:
constant array access to the row

template<class T>
T* const biu::Matrix< T >::operator[] ( const size_t  row  )  [inline, inherited]

access to row

Parameters:
row the row to access
Returns:
array access to the row

template<class T>
void biu::Matrix< T >::resize ( const size_t  row,
const size_t  col,
const T &  defVal 
) [inherited]

Resizes the matrix. If the the dimensions are increased, the new fields are filled with the given default value

Parameters:
row the new row number
col the new column number
defVal the default value for new matrix elements

template<class T>
void biu::Matrix< T >::resize ( const size_t  row,
const size_t  col 
) [inherited]

Resizes the matrix. If the the dimensions are increased, the new fields are not initialised.

Parameters:
row the new row number
col the new column number


Field Documentation

template<class T>
size_t biu::Matrix< T >::cols [protected, inherited]

matrix dimensions = number of columns

Definition at line 20 of file Matrix.hh.

template<class T>
size_t biu::Matrix< T >::rows [protected, inherited]

matrix dimensions = number of rows

Definition at line 18 of file Matrix.hh.

template<class T>
T** biu::Matrix< T >::v [protected, inherited]

the data store

Definition at line 22 of file Matrix.hh.


The documentation for this class was generated from the following file: