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

Matrix_nxn< T, N > Class Template Reference

Represents a nxn matrix of type T. More...

#include <Matrix_nxn.h>

List of all members.

Public Member Functions

 Matrix_nxn ()
 Standard constructor.

 Matrix_nxn (const T *v)
 Constructor that initializes the matrix with the values in the passed array.

 Matrix_nxn (const Matrix_nxn< T, N > &m)
 Copy constructor.

 ~Matrix_nxn ()
 Destructor.

Matrix_nxn< T, N > & operator= (const Matrix_nxn< T, N > &m)
 Copy operator.

Matrix_nxn< T, N > & operator= (const T *m)
 Copy operator.

void copyTo (T *m) const
 Copies contents of matrix to passed array.

const Vector_n< T, N > & operator[] (size_t i) const
 Constant row vector access operator.

Vector_n< T, N > & operator[] (size_t i)
 Row vector access operator.

Matrix_nxn< T, N > & operator+= (const Matrix_nxn< T, N > &m)
 Operator +=.

Matrix_nxn< T, N > & operator-= (const Matrix_nxn< T, N > &m)
 Operator -=.

Matrix_nxn< T, N > & operator *= (const Matrix_nxn< T, N > &m)
 Operator *=.

Matrix_nxn< T, N > & operator/= (const Matrix_nxn< T, N > &m)
 Operator /=.

Matrix_nxn< T, N > & transpose ()
 Transposes this matrix.

Matrix_nxn< T, N > & invert ()
 Inverts this matrix.

Vector_n< T, N > solve (Vector_n< T, N > b) const
 Solves the system A*x=b where A is the actual matrix.

det () const
 Returns determinant of this matrix.


Static Public Member Functions

Matrix_nxn< T, N > eye ()
 Returns the identity matrix with same dimensions like this matrix.


Private Attributes

Vector_n< T, N > * content
 The vectors holding the contents of the matrix.


Detailed Description

template<class T, size_t N>
class Matrix_nxn< T, N >

Represents a nxn matrix of type T.

Matrix_nxn represents a nxn matrix of type T. The class supplies standard arithmetic operations.

Definition at line 40 of file Matrix_nxn.h.


Constructor & Destructor Documentation

template<class T, size_t N>
Matrix_nxn< T, N >::Matrix_nxn  )  [inline]
 

Standard constructor.

Initializes the matrix with values supplied by the standard constructor of T.

Complexity: n^2

Definition at line 52 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn< T, N >::Matrix_nxn const T *  v  )  [inline]
 

Constructor that initializes the matrix with the values in the passed array.

Parameters:
v Array with initialization values
Complexity: n^2

Definition at line 70 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn< T, N >::Matrix_nxn const Matrix_nxn< T, N > &  m  )  [inline]
 

Copy constructor.

Parameters:
m Matrix to copy
Complexity: n^2

Definition at line 87 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn< T, N >::~Matrix_nxn  )  [inline]
 

Destructor.

Complexity: n^2

Definition at line 101 of file Matrix_nxn.h.


Member Function Documentation

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator= const Matrix_nxn< T, N > &  m  )  [inline]
 

Copy operator.

Parameters:
m Matrix to copy
Complexity: n^2

Definition at line 114 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator= const T *  m  )  [inline]
 

Copy operator.

Parameters:
m Array with values to assign to this matrix
Complexity: n^2

Definition at line 127 of file Matrix_nxn.h.

template<class T, size_t N>
void Matrix_nxn< T, N >::copyTo T *  m  )  const [inline]
 

Copies contents of matrix to passed array.

Parameters:
m Array the values are stored to
Complexity: n^2

Definition at line 141 of file Matrix_nxn.h.

template<class T, size_t N>
const Vector_n<T, N>& Matrix_nxn< T, N >::operator[] size_t  i  )  const [inline]
 

Constant row vector access operator.

Parameters:
i Index of row vector to access (first row vector has index 0)
Returns:
Constant reference to row vector
Complexity: 1

Definition at line 155 of file Matrix_nxn.h.

template<class T, size_t N>
Vector_n<T, N>& Matrix_nxn< T, N >::operator[] size_t  i  )  [inline]
 

Row vector access operator.

Parameters:
i Index of row vector to access (first row vector has index 0)
Returns:
Reference to row vector
Complexity: 1

Definition at line 167 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator+= const Matrix_nxn< T, N > &  m  )  [inline]
 

Operator +=.

Parameters:
m Matrix to add
Complexity: n^2

Definition at line 178 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator-= const Matrix_nxn< T, N > &  m  )  [inline]
 

Operator -=.

Parameters:
m Matrix to subtract
Complexity: n^2

Definition at line 191 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator *= const Matrix_nxn< T, N > &  m  )  [inline]
 

Operator *=.

Parameters:
m Matrix this matrix is to multiplied with
Complexity: n^3

Definition at line 204 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::operator/= const Matrix_nxn< T, N > &  m  )  [inline]
 

Operator /=.

Parameters:
m Matrix this matrix is to divided by
Complexity: n^3

Definition at line 216 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::transpose  )  [inline]
 

Transposes this matrix.

Complexity: n^2

Definition at line 227 of file Matrix_nxn.h.

Referenced by Matrix_nxn< double, 2 >::transpose().

template<class T, size_t N>
Matrix_nxn<T, N>& Matrix_nxn< T, N >::invert  )  [inline]
 

Inverts this matrix.

Complexity: n^3

Definition at line 238 of file Matrix_nxn.h.

Referenced by Matrix_nxn< double, 2 >::invert().

template<class T, size_t N>
Vector_n<T, N> Matrix_nxn< T, N >::solve Vector_n< T, N >  b  )  const [inline]
 

Solves the system A*x=b where A is the actual matrix.

Parameters:
b Vector b
Returns:
Solution x
Complexity: n^3

Definition at line 252 of file Matrix_nxn.h.

Referenced by KalmanConstantSpeedModel::calculateVarianceAdaptionPolynom(), GT2004BallSpecialist::createBallPerceptLevenbergMarquardt(), and invert2().

template<class T, size_t N>
T Matrix_nxn< T, N >::det  )  const [inline]
 

Returns determinant of this matrix.

Returns:
determinant
Complexity: n^3

Definition at line 407 of file Matrix_nxn.h.

Referenced by det().

template<class T, size_t N>
Matrix_nxn<T, N> Matrix_nxn< T, N >::eye  )  [inline, static]
 

Returns the identity matrix with same dimensions like this matrix.

Returns:
nxn identity matrix
Complexity: n^2

Definition at line 519 of file Matrix_nxn.h.


Member Data Documentation

template<class T, size_t N>
Vector_n<T, N>* Matrix_nxn< T, N >::content [private]
 

The vectors holding the contents of the matrix.

Definition at line 530 of file Matrix_nxn.h.

Referenced by Matrix_nxn< double, 2 >::operator+=(), Matrix_nxn< double, 2 >::operator-=(), and Matrix_nxn< double, 2 >::operator=().


The documentation for this class was generated from the following file:
Generated on Thu Sep 23 20:09:31 2004 for GT2004 by doxygen 1.3.6