#include <iso_math_matrix.h>
Inherited by iso::math::Matrix3< Type >, iso::math::Matrix4< Type >, and iso::math::MatrixH< Type >.
Inheritance diagram for iso::math::Matrix< Type >:
Public Member Functions | |
Matrix () | |
create default zero matrix | |
Matrix (unsigned int pRowCount, unsigned int pColCount) | |
create zero matrix | |
Matrix (const Vector2< unsigned int > &pDim) | |
create zero matrix | |
Matrix (unsigned int pRowCount, unsigned int pColCount, Type pValue) | |
create matrix containing identical values | |
Matrix (const Vector2< unsigned int > &pDim, Type pValue) | |
create matrix containing identical values | |
Matrix (unsigned int pRowCount, unsigned int pColCount, Type *pValues) | |
create matrix | |
template<class Type2> | |
Matrix (unsigned int pRowCount, unsigned int pColCount, Type2 *pValues) | |
create matrix | |
Matrix (const Vector2< unsigned int > &pDim, Type *pValues) | |
create matrix | |
template<class Type2> | |
Matrix (const Vector2< unsigned int > &pDim, Type2 *pValues) | |
create matrix | |
Matrix (const Matrix< Type > &pMatrix) | |
copy constructor | |
template<class Type2> | |
Matrix (const Matrix< Type2 > &pMatrix) | |
copy constructor | |
virtual | ~Matrix () |
destructor | |
const Vector2< unsigned int > & | dim () const |
return matrix dimension | |
unsigned int | count () const |
return element count | |
Type * | values () |
return matrix values | |
Vector< Type > | row (unsigned int pRow) const throw (MathException) |
return row vector | |
Vector< Type > | column (unsigned int pColumn) const throw (MathException) |
return column vector | |
Matrix< Type > | minor (unsigned int pRow, unsigned int pColumn) const throw (MathException) |
calculate submatrix lacking row pRow and column pColumn | |
Type & | operator() (unsigned int pRow, unsigned int pColumn) throw (MathException) |
return matrix element | |
const Type & | operator() (unsigned int pRow, unsigned int pColumn) const throw (MathException) |
return matrix element | |
Type | trace () const throw (MathException) |
return trace of matrix | |
Type | determinant () const throw (MathException) |
calculate determinant of matrix | |
Matrix< Type > | transpose () const |
return transposed matrix | |
void | transpose (Matrix< Type > &pMatrix) const throw (MathException) |
calculate transposed matrix | |
Matrix< Type > | adjoint () const throw (MathException) |
return adjoint of matrix | |
void | adjoint (Matrix< Type > &pMatrix) const throw (MathException) |
calculate adjoint of matrix | |
virtual Matrix< Type > | inverse () const throw (MathException) |
get inverse of matrix | |
virtual void | inverse (Matrix< Type > &pMatrix) const throw (MathException) |
calculate inverse of a matrix | |
void | set (Type pValue, unsigned int pRow, unsigned int pColumn) throw (MathException) |
set matrix value | |
void | set (Type pValue) |
set matrix values | |
void | set (Type *pValues) |
set matrix values | |
template<class Type2> | |
void | set (Type2 *pValues) |
set matrix values | |
void | set (const Matrix< Type > &pMatrix) throw (MathException) |
set matrix values | |
template<class Type2> | |
void | set (const Matrix< Type2 > &pMatrix) throw (MathException) |
set matrix values | |
void | setRow (unsigned int pRow, Type pValue) throw (MathException) |
set row values | |
void | setRow (unsigned int pRow, Type *pValues) throw (MathException) |
set row values | |
template<class Type2> | |
void | setRow (unsigned int pRow, Type2 *pValues) throw (MathException) |
set row values | |
void | setRow (unsigned int pRow, const Vector< Type > &pVector) throw (MathException) |
set row values | |
template<class Type2> | |
void | setRow (unsigned int pRow, const Vector< Type2 > &pVector) throw (MathException) |
set row values | |
void | setColumn (unsigned int pColumn, Type pValue) throw (MathException) |
set column values | |
void | setColumn (unsigned int pColumn, Type *pValues) throw (MathException) |
set column values | |
template<class Type2> | |
void | setColumn (unsigned int pColumn, Type2 *pValues) throw (MathException) |
set column values | |
void | setColumn (unsigned int pColumn, const Vector< Type > &pVector) throw (MathException) |
set column values | |
template<class Type2> | |
void | setColumn (unsigned int pColumn, const Vector< Type2 > &pVector) throw (MathException) |
set column values | |
const Matrix< Type > & | operator= (Type pValue) |
set matrix values | |
const Matrix< Type > & | operator= (Type *pValues) |
set matrix values | |
template<class Type2> | |
const Matrix< Type > & | operator= (Type2 *pValues) |
set matrix values | |
const Matrix< Type > & | operator= (const Matrix< Type > &pMatrix) throw (MathException) |
set matrix values | |
template<class Type2> | |
const Matrix< Type > & | operator= (const Matrix< Type2 > &pMatrix) throw (MathException) |
set matrix values | |
const Matrix< Type > & | operator+= (Type pValue) |
matrix += scalar | |
const Matrix< Type > & | operator-= (Type pValue) |
matrix -= scalar | |
const Matrix< Type > & | operator *= (Type pValue) |
matrix *= scalar | |
const Matrix< Type > & | operator/= (Type pValue) |
matrix /= scalar | |
Matrix< Type > | operator+ (Type pValue) const |
matrix + scalar | |
Matrix< Type > | operator- (Type pValue) const |
matrix - scalar | |
Matrix< Type > | operator * (Type pValue) const |
matrix * scalar | |
Matrix< Type > | operator/ (Type pValue) const |
matrix / scalar | |
const Matrix< Type > & | operator+= (const Matrix< Type > &pMatrix) throw (MathException) |
matrix += matrix | |
template<class Type2> | |
const Matrix< Type > & | operator+= (const Matrix< Type2 > &pMatrix) throw (MathException) |
matrix += matrix | |
const Matrix< Type > & | operator-= (const Matrix< Type > &pMatrix) throw (MathException) |
matrix -= matrix | |
template<class Type2> | |
const Matrix< Type > & | operator-= (const Matrix< Type2 > &pMatrix) throw (MathException) |
matrix -= matrix | |
const Matrix< Type > & | operator *= (const Matrix< Type > &pMatrix) throw (MathException) |
matrix *= matrix | |
template<class Type2> | |
const Matrix< Type > & | operator *= (const Matrix< Type2 > &pMatrix) throw (MathException) |
matrix *= matrix | |
Matrix< Type > | operator+ (const Matrix< Type > &pMatrix) const throw (MathException) |
matrix + matrix | |
template<class Type2> | |
Matrix< Type > | operator+ (const Matrix< Type2 > &pMatrix) const throw (MathException) |
matrix + matrix | |
Matrix< Type > | operator- (const Matrix< Type > &pMatrix) const throw (MathException) |
matrix - matrix | |
template<class Type2> | |
Matrix< Type > | operator- (const Matrix< Type2 > &pMatrix) const throw (MathException) |
matrix - matrix | |
Matrix< Type > | operator * (const Matrix< Type > &pMatrix) const throw (MathException) |
matrix * matrix | |
template<class Type2> | |
Matrix< Type > | operator * (const Matrix< Type2 > &pMatrix) const throw (MathException) |
matrix * matrix | |
Vector< Type > | operator * (const Vector< Type > &pVector) const throw (MathException) |
matrix * vector | |
template<class Type2> | |
Vector< Type > | operator * (const Vector< Type2 > &pVector) const throw (MathException) |
matrix * vector | |
void | reset () |
reset matrix elements to zero | |
base::String | info () const |
print matrix information | |
Public Attributes | |
Type * | m |
matrix array | |
Protected Attributes | |
Vector2< unsigned int > | mDim |
matrix size | |
unsigned int | mCount |
matrix element count | |
Static Protected Attributes | |
static Vector2< unsigned int > | sDim |
default matrix size | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const Matrix< Type > &pMatrix) |
print matrix information |
mxn matrix
| e00 e01 e02 e03 ... e0m | | e10 e11 e12 e13 ... e1m | ... | en0 ne1 en2 en3 ... enm |
elements stored in row major format
Created by Daniel Bisig on 7/16/06. Copyright 2006 Daniel Bisig All rights reserved.
iso::math::Matrix< Type >::Matrix | ( | ) |
create default zero matrix
iso::math::Matrix< Type >::Matrix | ( | unsigned int | pRowCount, | |
unsigned int | pColCount | |||
) |
create zero matrix
pRowCount | number of rows | |
pColCount | number of columns |
iso::math::Matrix< Type >::Matrix | ( | const Vector2< unsigned int > & | pDim | ) |
create zero matrix
pDim | size of matrix (dim.x: rowCount, dim.y: colCount) |
iso::math::Matrix< Type >::Matrix | ( | unsigned int | pRowCount, | |
unsigned int | pColCount, | |||
Type | pValue | |||
) |
create matrix containing identical values
pRowCount | number of rows | |
pColCount | number of columns | |
pValue | value |
iso::math::Matrix< Type >::Matrix | ( | const Vector2< unsigned int > & | pDim, | |
Type | pValue | |||
) |
create matrix containing identical values
pDim | size of matrix (dim.x: rowCount, dim.y: colCount) | |
pValue | value |
iso::math::Matrix< Type >::Matrix | ( | unsigned int | pRowCount, | |
unsigned int | pColCount, | |||
Type * | pValues | |||
) |
create matrix
pRowCount | number of rows | |
pColCount | number of columns | |
pValues | values (must be of correct size!) |
iso::math::Matrix< Type >::Matrix | ( | unsigned int | pRowCount, | |
unsigned int | pColCount, | |||
Type2 * | pValues | |||
) |
create matrix
pRowCount | number of rows | |
pColCount | number of columns | |
pValues | values (must be of correct size!) |
iso::math::Matrix< Type >::Matrix | ( | const Vector2< unsigned int > & | pDim, | |
Type * | pValues | |||
) |
create matrix
pDim | size of matrix (dim.x: rowCount, dim.y: colCount) | |
pValues | values (must be of correct size!) |
iso::math::Matrix< Type >::Matrix | ( | const Vector2< unsigned int > & | pDim, | |
Type2 * | pValues | |||
) |
create matrix
pDim | size of matrix (dim.x: rowCount, dim.y: colCount) | |
pValues | values (must be of correct size!) |
iso::math::Matrix< Type >::Matrix | ( | const Matrix< Type > & | pMatrix | ) |
copy constructor
pMatrix | matrix |
iso::math::Matrix< Type >::Matrix | ( | const Matrix< Type2 > & | pMatrix | ) |
copy constructor
pMatrix | matrix |
iso::math::Matrix< Type >::~Matrix | ( | ) | [virtual] |
destructor
const Vector2< unsigned int > & iso::math::Matrix< Type >::dim | ( | ) | const |
return matrix dimension
unsigned int iso::math::Matrix< Type >::count | ( | ) | const |
return element count
Type * iso::math::Matrix< Type >::values | ( | ) |
return matrix values
Vector< Type > iso::math::Matrix< Type >::row | ( | unsigned int | pRow | ) | const throw (MathException) |
return row vector
pRow | row |
MathException | row out of bounds |
Vector< Type > iso::math::Matrix< Type >::column | ( | unsigned int | pColumn | ) | const throw (MathException) |
return column vector
pColumn | column |
MathException | column out of bounds |
Matrix< Type > iso::math::Matrix< Type >::minor | ( | unsigned int | pRow, | |
unsigned int | pColumn | |||
) | const throw (MathException) |
calculate submatrix lacking row pRow and column pColumn
pRow | row to remove | |
pColumn | column to remove |
MathException | column and / or row out of bounds |
Type & iso::math::Matrix< Type >::operator() | ( | unsigned int | pRow, | |
unsigned int | pColumn | |||
) | throw (MathException) [inline] |
return matrix element
pRow | row | |
pColumn | column |
MathException | column and / or row out of bounds |
const Type & iso::math::Matrix< Type >::operator() | ( | unsigned int | pRow, | |
unsigned int | pColumn | |||
) | const throw (MathException) [inline] |
return matrix element
pRow | row | |
pColumn | column |
MathException | column and / or row out of bounds |
Type iso::math::Matrix< Type >::trace | ( | ) | const throw (MathException) |
Type iso::math::Matrix< Type >::determinant | ( | ) | const throw (MathException) |
Matrix< Type > iso::math::Matrix< Type >::transpose | ( | ) | const |
return transposed matrix
void iso::math::Matrix< Type >::transpose | ( | Matrix< Type > & | pMatrix | ) | const throw (MathException) |
calculate transposed matrix
pMatrix | matrix that will contain transposed matrix |
MathException | matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::adjoint | ( | ) | const throw (MathException) |
void iso::math::Matrix< Type >::adjoint | ( | Matrix< Type > & | pMatrix | ) | const throw (MathException) |
calculate adjoint of matrix
pMatrix | adjoint matrix |
MathException | matrix not square or matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::inverse | ( | ) | const throw (MathException) [virtual] |
get inverse of matrix
MathException | matrix not square or matrix not invertible |
void iso::math::Matrix< Type >::inverse | ( | Matrix< Type > & | pMatrix | ) | const throw (MathException) [virtual] |
calculate inverse of a matrix
pMatrix | inverse matrix |
MathException | matrix not square or matrix dimension mismatch or matrix not invertible |
void iso::math::Matrix< Type >::set | ( | Type | pValue, | |
unsigned int | pRow, | |||
unsigned int | pColumn | |||
) | throw (MathException) |
set matrix value
pValue | value | |
pRow | row index | |
pColumn | column index |
MathException | column and / or row out of bounds |
void iso::math::Matrix< Type >::set | ( | Type | pValue | ) |
set matrix values
pValue | value |
void iso::math::Matrix< Type >::set | ( | Type * | pValues | ) |
set matrix values
pValues | values |
set matrix values
pValues | values |
void iso::math::Matrix< Type >::set | ( | const Matrix< Type > & | pMatrix | ) | throw (MathException) |
void iso::math::Matrix< Type >::set | ( | const Matrix< Type2 > & | pMatrix | ) | throw (MathException) |
void iso::math::Matrix< Type >::setRow | ( | unsigned int | pRow, | |
Type | pValue | |||
) | throw (MathException) |
void iso::math::Matrix< Type >::setRow | ( | unsigned int | pRow, | |
Type * | pValues | |||
) | throw (MathException) |
set row values
pRow | row index | |
pValues | values |
MathException | row out of bounds |
void iso::math::Matrix< Type >::setRow | ( | unsigned int | pRow, | |
Type2 * | pValues | |||
) | throw (MathException) |
set row values
pRow | row index | |
pValues | values |
MathException | row out of bounds |
void iso::math::Matrix< Type >::setRow | ( | unsigned int | pRow, | |
const Vector< Type > & | pVector | |||
) | throw (MathException) |
set row values
pRow | row index | |
pVector | row vector |
MathException | row out of bounds or vector dimension mismatch |
void iso::math::Matrix< Type >::setRow | ( | unsigned int | pRow, | |
const Vector< Type2 > & | pVector | |||
) | throw (MathException) |
set row values
pRow | row index | |
pVector | row vector |
MathException | row out of bounds or vector dimension mismatch |
void iso::math::Matrix< Type >::setColumn | ( | unsigned int | pColumn, | |
Type | pValue | |||
) | throw (MathException) |
set column values
pColumn | column index | |
pValue | value |
MathException | column out of bounds |
void iso::math::Matrix< Type >::setColumn | ( | unsigned int | pColumn, | |
Type * | pValues | |||
) | throw (MathException) |
set column values
pColumn | column index | |
pValues | values |
MathException | column out of bounds |
void iso::math::Matrix< Type >::setColumn | ( | unsigned int | pColumn, | |
Type2 * | pValues | |||
) | throw (MathException) |
set column values
pColumn | column index | |
pValues | values |
MathException | column out of bounds |
void iso::math::Matrix< Type >::setColumn | ( | unsigned int | pColumn, | |
const Vector< Type > & | pVector | |||
) | throw (MathException) |
set column values
pColumn | column index | |
pVector | column vector |
MathException | column out of bounds or vector dimension mismatch |
void iso::math::Matrix< Type >::setColumn | ( | unsigned int | pColumn, | |
const Vector< Type2 > & | pVector | |||
) | throw (MathException) |
set column values
pColumn | column index | |
pVector | column vector |
MathException | column out of bounds or vector dimension mismatch |
const Matrix< Type > & iso::math::Matrix< Type >::operator= | ( | Type | pValue | ) |
set matrix values
pValue | value |
const Matrix< Type > & iso::math::Matrix< Type >::operator= | ( | Type * | pValues | ) |
set matrix values
pValues | values |
const Matrix< Type > & iso::math::Matrix< Type >::operator= | ( | Type2 * | pValues | ) |
set matrix values
pValues | values |
const Matrix< Type > & iso::math::Matrix< Type >::operator= | ( | const Matrix< Type > & | pMatrix | ) | throw (MathException) |
const Matrix< Type > & iso::math::Matrix< Type >::operator= | ( | const Matrix< Type2 > & | pMatrix | ) | throw (MathException) |
const Matrix< Type > & iso::math::Matrix< Type >::operator+= | ( | Type | pValue | ) |
matrix += scalar
pValue | value |
const Matrix< Type > & iso::math::Matrix< Type >::operator-= | ( | Type | pValue | ) |
matrix -= scalar
pValue | value |
const Matrix< Type > & iso::math::Matrix< Type >::operator *= | ( | Type | pValue | ) |
matrix *= scalar
pValue | value |
const Matrix< Type > & iso::math::Matrix< Type >::operator/= | ( | Type | pValue | ) |
matrix /= scalar
pValue | value |
Matrix< Type > iso::math::Matrix< Type >::operator+ | ( | Type | pValue | ) | const |
matrix + scalar
pValue | value |
Matrix< Type > iso::math::Matrix< Type >::operator- | ( | Type | pValue | ) | const |
matrix - scalar
pValue | value |
Matrix< Type > iso::math::Matrix< Type >::operator * | ( | Type | pValue | ) | const |
matrix * scalar
pValue | value |
Matrix< Type > iso::math::Matrix< Type >::operator/ | ( | Type | pValue | ) | const |
matrix / scalar
pValue | value |
const Matrix< Type > & iso::math::Matrix< Type >::operator+= | ( | const Matrix< Type > & | pMatrix | ) | throw (MathException) |
matrix += matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
const Matrix< Type > & iso::math::Matrix< Type >::operator+= | ( | const Matrix< Type2 > & | pMatrix | ) | throw (MathException) |
matrix += matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
const Matrix< Type > & iso::math::Matrix< Type >::operator-= | ( | const Matrix< Type > & | pMatrix | ) | throw (MathException) |
matrix -= matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
const Matrix< Type > & iso::math::Matrix< Type >::operator-= | ( | const Matrix< Type2 > & | pMatrix | ) | throw (MathException) |
matrix -= matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
const Matrix< Type > & iso::math::Matrix< Type >::operator *= | ( | const Matrix< Type > & | pMatrix | ) | throw (MathException) |
matrix *= matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch or matrix not square |
const Matrix< Type > & iso::math::Matrix< Type >::operator *= | ( | const Matrix< Type2 > & | pMatrix | ) | throw (MathException) |
matrix *= matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch or matrix not square |
Matrix< Type > iso::math::Matrix< Type >::operator+ | ( | const Matrix< Type > & | pMatrix | ) | const throw (MathException) |
matrix + matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::operator+ | ( | const Matrix< Type2 > & | pMatrix | ) | const throw (MathException) |
matrix + matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::operator- | ( | const Matrix< Type > & | pMatrix | ) | const throw (MathException) |
matrix - matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::operator- | ( | const Matrix< Type2 > & | pMatrix | ) | const throw (MathException) |
matrix - matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::operator * | ( | const Matrix< Type > & | pMatrix | ) | const throw (MathException) |
matrix * matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Matrix< Type > iso::math::Matrix< Type >::operator * | ( | const Matrix< Type2 > & | pMatrix | ) | const throw (MathException) |
matrix * matrix
pMatrix | matrix |
MathException | Matrix dimension mismatch |
Vector< Type > iso::math::Matrix< Type >::operator * | ( | const Vector< Type > & | pVector | ) | const throw (MathException) |
Vector< Type > iso::math::Matrix< Type >::operator * | ( | const Vector< Type2 > & | pVector | ) | const throw (MathException) |
void iso::math::Matrix< Type >::reset | ( | ) |
reset matrix elements to zero
base::String iso::math::Matrix< Type >::info | ( | ) | const |
print matrix information
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Matrix< Type > & | pMatrix | |||
) | [friend] |
print matrix information
pOstream | output stream | |
pMatrix | matrix |
Type* iso::math::Matrix< Type >::m |
matrix array
Vector2< unsigned int > iso::math::Matrix< Type >::sDim [static, protected] |
default matrix size
Vector2<unsigned int> iso::math::Matrix< Type >::mDim [protected] |
matrix size
mDim.x : row count mDim.y : column count
unsigned int iso::math::Matrix< Type >::mCount [protected] |
matrix element count