Public Member Functions
rtc::VarSMat< T > Class Template Reference

#include <rtcVarSMat.h>

Inheritance diagram for rtc::VarSMat< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void choleskyDecomp ()
void choleskyDecomp (VarSMat< T > &r)
void choleskySolve (VarVec< T > &b)
det () const
VarVec< T > getDiag ()
int invert ()
VarSMat< T > inverted () const
void luDecomp (VarVec< int > &indx, T *d=NULL)
void luSolve (const VarVec< int > &indx, VarVec< T > &b)
VarSMat< T > minorMat (const int ip, const int jp) const
void setDiag (const T a)
void setDiag (const VarVec< T > &diagVec)
void setIdentity ()
void setSize (int size)
int size () const
trace () const
void transpose ()
 VarSMat ()
 VarSMat (int size)
 VarSMat (int size, const T *d)
 VarSMat (int size, const T diagVal)
 VarSMat (int size, const VarVec< T > &diagVec)
 VarSMat (const Array2< T > &m)
template<class U >
 VarSMat (const VarMat< U > &m)

Detailed Description

template<class T>
class rtc::VarSMat< T >

A square matrix. A specialization of a general matrix that provides operations only possible on square matrices like guassian elimination and Cholesky decomposition.

Definition at line 43 of file rtcVarSMat.h.


Constructor & Destructor Documentation

template<class T >
rtc::VarSMat< T >::VarSMat ( ) [inline]

default Ctor

Definition at line 104 of file rtcVarSMat.h.

template<class T >
rtc::VarSMat< T >::VarSMat ( int  size) [inline]

Ctor that doesn't initialize anything.

Definition at line 109 of file rtcVarSMat.h.

template<class T >
rtc::VarSMat< T >::VarSMat ( int  size,
const T *  d 
) [inline]

Ctor that initializes from an array.

Parameters:
sizeis the number of rows/columns
dthe (row major) data array of length r*r

Definition at line 116 of file rtcVarSMat.h.

template<class T >
rtc::VarSMat< T >::VarSMat ( int  size,
const T  diagVal 
) [inline]

Ctor that makes a multiple of the identity matrix.

Parameters:
sizeis the number of rows/columns
diagValthe value to which all diagonal entries will be set

Definition at line 123 of file rtcVarSMat.h.

template<class T >
rtc::VarSMat< T >::VarSMat ( int  size,
const VarVec< T > &  diagVec 
) [inline]

Ctor that makes a (mostly) zero matrix with diagonal entries from vec.

Parameters:
sizeis the number of rows/columns
diagVecthe vector of values that should appear on the diagonal

Definition at line 133 of file rtcVarSMat.h.

template<class T >
rtc::VarSMat< T >::VarSMat ( const Array2< T > &  m) [inline]

Ctor that initializes from a Mat<T,r,r>

Definition at line 141 of file rtcVarSMat.h.

template<class T >
template<class U >
rtc::VarSMat< T >::VarSMat ( const VarMat< U > &  m) [inline]

Casting Ctor that initializes from a Mat<U,r,r>

Definition at line 148 of file rtcVarSMat.h.


Member Function Documentation

template<class T >
void rtc::VarSMat< T >::choleskyDecomp ( ) [inline]

Perform the Cholesky Decomposition in place. Only the upper triangle (including the diagonal) is used as source data. The result is stored in the lower triangle (including the diagonal).

Returns:
1 on failure (matrix not positive definite), 0 on success

Definition at line 426 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::choleskyDecomp ( VarSMat< T > &  _r) [inline]

Perform the Cholesky Decomposition and stores the result in r.

Returns:
1 on failure (matrix not positive definite), 0 on success

Definition at line 454 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::choleskySolve ( VarVec< T > &  b) [inline]

Perform a Cholesky Decomposition backsolve with given RHS. Precondtion: choleskyDecomp() has already been called

Parameters:
bthe RHS vector in the equation A*x = b
Returns:
b is also the solution, overwriting the passed RHS

Definition at line 470 of file rtcVarSMat.h.

template<class T >
T rtc::VarSMat< T >::det ( ) const [inline]

Return the determinant of this matrix. This uses the LU decomposition. Matrices of size 3 and under have specialized implementations.

Definition at line 264 of file rtcVarSMat.h.

template<class T >
VarVec< T > rtc::VarSMat< T >::getDiag ( ) [inline]

Get the diagonal entries of the matrix.

Returns:
vector of the diagonal entries.

Definition at line 203 of file rtcVarSMat.h.

template<class T >
int rtc::VarSMat< T >::invert ( ) [inline]

Return the inverse of this matrix This uses the LU decomposition

Definition at line 298 of file rtcVarSMat.h.

template<class T >
VarSMat< T > rtc::VarSMat< T >::inverted ( ) const [inline]

Return the inverse of this matrix This uses the LU decomposition

Definition at line 275 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::luDecomp ( VarVec< int > &  indx,
T *  d = NULL 
) [inline]

Perform the LU Decomposition in place

Returns:
indx output vector that records the row permutation effected by the partial pivoting
d (optional) is +/- 1 depending on if there were an even (+) or odd (-) number of row-interchanges (used to compute determinant).
1 on failure (matrix singular), 0 on success

Definition at line 326 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::luSolve ( const VarVec< int > &  indx,
VarVec< T > &  b 
) [inline]

Perform a LU Decomposition backsolve with given RHS. Precondtion: luDecomp(indx,d) has already been called

Parameters:
indxthe row-swap vector returned from luDecomp()
bthe RHS vector in the equation A*x = b
Returns:
b is also the solution, overwriting the passed RHS

Definition at line 395 of file rtcVarSMat.h.

template<class T >
VarSMat< T > rtc::VarSMat< T >::minorMat ( const int  ip,
const int  jp 
) const [inline]

Return the minor of this matrix about element (ip,jp)

Definition at line 238 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::setDiag ( const T  diagVal) [inline]

Sets matrix to a multiple of the identity matrix.

Parameters:
diagValthe value to which all diagonal entries will be set

Definition at line 173 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::setDiag ( const VarVec< T > &  diagVec) [inline]

Sets the diagonal entries of matrix from a vector. without changing other entries.

Parameters:
diagVecthe vector of values that should appear on the diagonal

Definition at line 183 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::setIdentity ( ) [inline]

Sets matrix to an identiy matrix, where the diagonal elements are equal to 1 and every other element equals 0.

Definition at line 164 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::setSize ( int  size) [inline]

Sets matrix to specific size

Parameters:
sizeis the number of rows/columns

Definition at line 156 of file rtcVarSMat.h.

template<class T >
int rtc::VarSMat< T >::size ( ) const [inline]
Returns:
the size of the matrix

Reimplemented from rtc::Array< T, 2 >.

Definition at line 213 of file rtcVarSMat.h.

template<class T >
T rtc::VarSMat< T >::trace ( ) const [inline]

Return the trace of the matrix

Definition at line 222 of file rtcVarSMat.h.

template<class T >
void rtc::VarSMat< T >::transpose ( ) [inline]

Transposes this matrix in place, overwriting old data

Definition at line 231 of file rtcVarSMat.h.


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


rtc
Author(s): Benjamin Pitzer
autogenerated on Thu Jan 2 2014 11:04:54