Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CMatrix< X, Y, TType > Class Template Reference

#include <CMatrix.h>

List of all members.

Public Member Functions

 CMatrix ()
 CMatrix (TType *pfData)
 CMatrix (TType **pfData)
void zero (void)
void output (std::ostream &out=std::cout) const
void eye (void)
TType get (const int iX, const int iY) const
void set (const int iX, const int iY, const TType &fParam)
TType normInfty (void)
TType normOne (void)
CMatrix< Y, X, TType > transpose (void) const
template<int Z>
CMatrix< X, Z, TType > operator * (const CMatrix< Y, Z, TType > &param) const
CMatrix< X, Y, TType > operator * (const float f)
int getMaxEntryColumn (int iColumn, int iRow=1)
void exchangeRows (int iRow1, int iRow2)
void exchangeColumns (int iColumn1, int iColumn2)
CMatrix< X, X, TType > inverse (void) const
template<class VectorTType>
Vector3DT< VectorTType > operator * (const Vector3DT< VectorTType > &V) const
template<class VectorTType>
Vector3DT< VectorTType > affMult (const Vector3DT< VectorTType > &V) const
CMatrix< X, Y, TType > & operator= (const CMatrix< X, Y, TType > &param)
bool operator== (const CMatrix< X, Y, TType > &param)
template<class TVectorType>
CMatrix< X, Y, TType > & operator= (const Vector3DT< TVectorType > &V)
 operator float * (void)
 operator const float * (void) const

Static Public Member Functions

template<class TVecType>
static CMatrix< 4, 4, TType > getTranslate (const Vector3DT< TVecType > &V)
static CMatrix< 4, 4, TType > getRotateX (float fAngle)
static CMatrix< 4, 4, TType > getRotateY (float fAngle)
static CMatrix< 4, 4, TType > getRotateZ (float fAngle)

Public Attributes

TType m_pfElem [X][Y]


Detailed Description

template<int X, int Y, class TType>
class CMatrix< X, Y, TType >

a template class for matrices

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 39 of file CMatrix.h.


Constructor & Destructor Documentation

template<int X, int Y, class TType>
CMatrix< X, Y, TType >::CMatrix  )  [inline]
 

constructor : nothing to do here yet

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 47 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix< X, Y, TType >::CMatrix TType *  pfData  )  [inline]
 

constructor : copy elements from a one dimensional field one row after another

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 57 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix< X, Y, TType >::CMatrix TType **  pfData  )  [inline]
 

constructor: copy elements from a two dimensional field

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 73 of file CMatrix.h.


Member Function Documentation

template<int X, int Y, class TType>
template<class VectorTType>
Vector3DT<VectorTType> CMatrix< X, Y, TType >::affMult const Vector3DT< VectorTType > &  V  )  const [inline]
 

4x4 matrix multiplication with a vector interpreted as ( v, 1)

possible exceptions

Parameters:
V vector
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 489 of file CMatrix.h.

Referenced by CInt1VRenderer::calculate().

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::exchangeColumns int  iColumn1,
int  iColumn2
[inline]
 

exchange 2 Columns

Parameters:
iColumn1 first Column
iColumn2 second Column
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 361 of file CMatrix.h.

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::exchangeRows int  iRow1,
int  iRow2
[inline]
 

exchange 2 rows

Parameters:
iRow1 first row
iRow2 second row
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 343 of file CMatrix.h.

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::eye void   )  [inline]
 

setting all entries to zero and the main diagonal to 1.

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 127 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate(), CMatrix< 4, 4, float >::getRotateX(), CMatrix< 4, 4, float >::getRotateY(), CMatrix< 4, 4, float >::getRotateZ(), CMatrix< 4, 4, float >::getTranslate(), and CMatrix< 4, 4, float >::inverse().

template<int X, int Y, class TType>
TType CMatrix< X, Y, TType >::get const int  iX,
const int  iY
const [inline]
 

get an entry of the matrix. note that the indices are 1..X and 1..Y respectively, not like 0..X-1 like in C fields

possible exceptions

Parameters:
iX row
iY column
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 155 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate(), and CMatrix< 4, 4, float >::output().

template<int X, int Y, class TType>
int CMatrix< X, Y, TType >::getMaxEntryColumn int  iColumn,
int  iRow = 1
[inline]
 

returns the maximal entry inside a column starting at iRow

Parameters:
iColumn column to search in
iRow row to start at
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 316 of file CMatrix.h.

template<int X, int Y, class TType>
static CMatrix<4,4,TType> CMatrix< X, Y, TType >::getRotateX float  fAngle  )  [inline, static]
 

Returns:
a 4x4 rotation matrix
Parameters:
fAngle angle around x axis ( in DEG )
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 590 of file CMatrix.h.

template<int X, int Y, class TType>
static CMatrix<4,4,TType> CMatrix< X, Y, TType >::getRotateY float  fAngle  )  [inline, static]
 

Returns:
a 4x4 rotation matrix
Parameters:
fAngle angle around y axis ( in DEG )
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 614 of file CMatrix.h.

template<int X, int Y, class TType>
static CMatrix<4,4,TType> CMatrix< X, Y, TType >::getRotateZ float  fAngle  )  [inline, static]
 

Returns:
a 4x4 rotation matrix
Parameters:
fAngle angle around z axis ( in DEG )
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 638 of file CMatrix.h.

template<int X, int Y, class TType>
template<class TVecType>
static CMatrix<4,4,TType> CMatrix< X, Y, TType >::getTranslate const Vector3DT< TVecType > &  V  )  [inline, static]
 

returns a 4x4 translation matrix for a given vector

Parameters:
V 3 dimensional vector
Returns:
4x4 translation matrix
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 570 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate().

template<int X, int Y, class TType>
CMatrix<X,X,TType> CMatrix< X, Y, TType >::inverse void   )  const [inline]
 

calculates the inverse of a matrix using the GaussJordan-Algorithm

possible exceptions

Definition at line 377 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate().

template<int X, int Y, class TType>
TType CMatrix< X, Y, TType >::normInfty void   )  [inline]
 

infinity norm - maximum row-sum

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 197 of file CMatrix.h.

template<int X, int Y, class TType>
TType CMatrix< X, Y, TType >::normOne void   )  [inline]
 

one norm - maximum column-sum

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 219 of file CMatrix.h.

template<int X, int Y, class TType>
template<class VectorTType>
Vector3DT<VectorTType> CMatrix< X, Y, TType >::operator * const Vector3DT< VectorTType > &  V  )  const [inline]
 

matrix multiplication with a vector

Parameters:
V vector
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 451 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix<X,Y,TType> CMatrix< X, Y, TType >::operator * const float  f  )  [inline]
 

scalar multiplication with a matrix

Parameters:
f factor
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 295 of file CMatrix.h.

template<int X, int Y, class TType>
template<int Z>
CMatrix<X,Z,TType> CMatrix< X, Y, TType >::operator * const CMatrix< Y, Z, TType > &  param  )  const [inline]
 

matrix multiplication with another matrix

Parameters:
param 2nd factor
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 263 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix< X, Y, TType >::operator const float * void   )  const [inline]
 

Returns:
a const pointer to the begin of this matrix's data
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 670 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix< X, Y, TType >::operator float * void   )  [inline]
 

Returns:
a pointer to the begin of this matrix's data
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 660 of file CMatrix.h.

template<int X, int Y, class TType>
template<class TVectorType>
CMatrix<X,Y,TType>& CMatrix< X, Y, TType >::operator= const Vector3DT< TVectorType > &  V  )  [inline]
 

copies a vector to a 4x1 matrix, setting the fourth component to 1

Parameters:
V 3 dimensional vector
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 548 of file CMatrix.h.

template<int X, int Y, class TType>
CMatrix<X,Y,TType>& CMatrix< X, Y, TType >::operator= const CMatrix< X, Y, TType > &  param  )  [inline]
 

copies the matrix

Parameters:
param matrix
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 524 of file CMatrix.h.

template<int X, int Y, class TType>
bool CMatrix< X, Y, TType >::operator== const CMatrix< X, Y, TType > &  param  )  [inline]
 

checks if 2 matrices are identical

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 536 of file CMatrix.h.

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::output std::ostream &  out = std::cout  )  const [inline]
 

outputs this matrix to out with std::endl at the end of each row

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 108 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate().

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::set const int  iX,
const int  iY,
const TType &  fParam
[inline]
 

sets an entry of the matrix. note that the indices are 1..X and 1..Y respectively, not like 0..X-1 like in C fields

possible exceptions

Parameters:
iX row
iY column
fParam Value
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 180 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate(), and CTexture1VRenderer::drawScene().

template<int X, int Y, class TType>
CMatrix<Y,X,TType> CMatrix< X, Y, TType >::transpose void   )  const [inline]
 

returns the transposed matrix

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 241 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate().

template<int X, int Y, class TType>
void CMatrix< X, Y, TType >::zero void   )  [inline]
 

setting all entries to zero.

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 98 of file CMatrix.h.

Referenced by CShearWarp2VRenderer::calculate(), CTexture1VRenderer::drawScene(), and CVRendererSceneConfig::zero().


Member Data Documentation

template<int X, int Y, class TType>
TType CMatrix< X, Y, TType >::m_pfElem[X][Y]
 

data - this isnt protected or private, since the same class with other template arguments wouldnt be able to access these.

Todo:
check for template arguments of friend

Definition at line 680 of file CMatrix.h.

Referenced by CMatrix< 4, 4, float >::affMult(), CMatrix< 4, 4, float >::CMatrix(), CMatrix< 4, 4, float >::exchangeColumns(), CMatrix< 4, 4, float >::exchangeRows(), CMatrix< 4, 4, float >::eye(), CMatrix< 4, 4, float >::get(), CMatrix< 4, 4, float >::getMaxEntryColumn(), CMatrix< 4, 4, float >::getRotateX(), CMatrix< 4, 4, float >::getRotateY(), CMatrix< 4, 4, float >::getRotateZ(), CMatrix< 4, 4, float >::getTranslate(), CMatrix< 4, 4, float >::inverse(), CMatrix< 4, 4, float >::normInfty(), CMatrix< 4, 4, float >::normOne(), CMatrix< 4, 4, float >::operator *(), CMatrix< 4, 4, float >::operator const float *(), CMatrix< 4, 4, float >::operator float *(), CMatrix< 4, 4, float >::operator=(), CMatrix< 4, 4, float >::operator==(), CMatrix< 4, 4, float >::set(), CMatrix< 4, 4, float >::transpose(), and CMatrix< 4, 4, float >::zero().


The documentation for this class was generated from the following file:
Generated on Sat Sep 24 15:47:02 2005 for vvis by  doxygen 1.4.3-20050530