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.
Matrix_nxn< T, N > | invert2 ()
| 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.
T | det () const
| Returns determinant of this matrix.
## Static Public Member Functions
Matrix_nxn< T, N > | identity ()
| 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 44 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 56 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 74 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 91 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 105 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 118 of file Matrix_nxn.h. References Matrix_nxn< T, N >::content.

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 131 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 145 of file Matrix_nxn.h. References Vector_n< T, N >::copyTo().

Here is the call graph for this function:

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 159 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 171 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 182 of file Matrix_nxn.h. References Matrix_nxn< T, N >::content.

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 195 of file Matrix_nxn.h. References Matrix_nxn< T, N >::content.

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 208 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 220 of file Matrix_nxn.h.

template<class T, size_t N>
Matrix_nxn<T, N> Matrix_nxn< T, N >::transpose | ( |  | ) | `[inline]`

| Transposes this matrix. Definition at line 229 of file Matrix_nxn.h. Referenced by Matrix_nxn< T, N >::invert2().

template<class T, size_t N>
Matrix_nxn<T, N> Matrix_nxn< T, N >::invert | ( |  | ) | `[inline]`

| Inverts this matrix. Matrix must not be singular Returns: Inverted matrix Definition at line 243 of file Matrix_nxn.h. References Matrix_nxn< T, N >::identity(), MVTools::isNearInf(), MVTools::isNearNegZero(), MVTools::isNearPosInf(), and MVTools::isNearZero(). Referenced by operator/().

Here is the call graph for this function:

template<class T, size_t N>
Matrix_nxn<T, N> Matrix_nxn< T, N >::invert2 | ( |  | ) | `[inline]`

| Inverts this matrix. Matrix must not be singular Returns: Inverted matrix Definition at line 363 of file Matrix_nxn.h. References e, Matrix_nxn< T, N >::solve(), and Matrix_nxn< T, N >::transpose().

Here is the call graph for this function:

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 383 of file Matrix_nxn.h. References MVTools::isNearInf(), MVTools::isNearNegZero(), MVTools::isNearPosInf(), and MVTools::isNearZero(). Referenced by VLCBallSpecialist::createBallPerceptLevenbergMarquardt(), GT2005BallSpecialist::createBallPerceptLevenbergMarquardt(), and Matrix_nxn< T, N >::invert2().

Here is the call graph for this function:

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 538 of file Matrix_nxn.h. References MVTools::isNearInf(), MVTools::isNearPosInf(), and MVTools::isNearZero().

Here is the call graph for this function:

template<class T, size_t N>
Matrix_nxn<T, N> Matrix_nxn< T, N >::identity | ( |  | ) | `[inline, static]`

| Returns the identity matrix with same dimensions like this matrix. Returns: nxn identity matrix Definition at line 648 of file Matrix_nxn.h. Referenced by Matrix_nxn< T, N >::invert().

## 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 659 of file Matrix_nxn.h. Referenced by Matrix_nxn< T, N >::operator+=(), Matrix_nxn< T, N >::operator-=(), and Matrix_nxn< T, N >::operator=().

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

- Tools/Math/Matrix_nxn.h