Public Member Functions | Protected Attributes
rtc::LinearSystem< T, M > Class Template Reference

#include <rtcLinearSystem.h>

List of all members.

Public Member Functions

int cholesky (const Vec< T, M > &b, Vec< T, M > &sol)
int forceRefresh (int decomp=0)
int gaussianElim (const Vec< T, M > &b, Vec< T, M > &sol)
 LinearSystem (SMat< T, M > &a_, bool overwrite_=true)
int lu (const Vec< T, M > &b, Vec< T, M > &sol)
 ~LinearSystem ()

Protected Attributes

SMat< T, M > & a
SMat< T, M > * d
int haveDecomp
Vec< int, M > indx
bool overwrite

Detailed Description

template<class T, int M>
class rtc::LinearSystem< T, M >

A General Linear System A*x = b, a composition of SMat<T,M> and Vec<T,M>

Definition at line 36 of file rtcLinearSystem.h.


Constructor & Destructor Documentation

template<class T , int M>
rtc::LinearSystem< T, M >::LinearSystem ( SMat< T, M > &  a_,
bool  overwrite_ = true 
) [inline]

Ctor that accepts a system matrix and a flag indicating whether it is ok to overwrite the system matrix.

Parameters:
a_is the A matrix of a General Linear System A*x = b
overwrite_has a default value of true, meaning that it is ok by default to overwrite the main system matrix when decomposing the problem. If overwrite is set to false then space is allocated internally to store the decomposition.

Definition at line 79 of file rtcLinearSystem.h.

template<class T , int M>
rtc::LinearSystem< T, M >::~LinearSystem ( ) [inline]

Dtor deletes memory if it was allocated

Definition at line 94 of file rtcLinearSystem.h.


Member Function Documentation

template<class T , int M>
int rtc::LinearSystem< T, M >::cholesky ( const Vec< T, M > &  b,
Vec< T, M > &  sol 
) [inline]

Perform the Cholesky Decomposition and Back-Solve. automatically checks if decomposition is needed.

Returns:
1 on failure, 0 on success

Definition at line 171 of file rtcLinearSystem.h.

template<class T , int M>
int rtc::LinearSystem< T, M >::forceRefresh ( int  decomp = 0) [inline]

Force refresh of given decomposition, or whichever is active. This usually only makes sense when overwrite = false, since normally the original matrix has been destroyed in the process of computing the decomposition. However, since this is a force function, it is allowed to call it no matter what, unless, of course, no decomposition is active _and_ none is specified as an argument.

Parameters:
decompspecifies which decomposition to call: 1: LU, 2: Cholesky.

Definition at line 114 of file rtcLinearSystem.h.

template<class T , int M>
int rtc::LinearSystem< T, M >::gaussianElim ( const Vec< T, M > &  b,
Vec< T, M > &  sol 
) [inline]

Perform gaussian elimination to solve system A*x=b.

Todo:
goto is often considered "bad style", consider rewriting
Parameters:
bthe rhs
solthe output solution

Definition at line 202 of file rtcLinearSystem.h.

template<class T , int M>
int rtc::LinearSystem< T, M >::lu ( const Vec< T, M > &  b,
Vec< T, M > &  sol 
) [inline]

Perform the LU Decomposition and Back-Solve. automatically checks if decomposition is needed.

Returns:
1 on failure, 0 on success

Definition at line 140 of file rtcLinearSystem.h.


Member Data Documentation

template<class T , int M>
SMat<T,M>& rtc::LinearSystem< T, M >::a [protected]

Definition at line 49 of file rtcLinearSystem.h.

template<class T , int M>
SMat<T,M>* rtc::LinearSystem< T, M >::d [protected]

Definition at line 50 of file rtcLinearSystem.h.

template<class T , int M>
int rtc::LinearSystem< T, M >::haveDecomp [protected]

Definition at line 52 of file rtcLinearSystem.h.

template<class T , int M>
Vec<int,M> rtc::LinearSystem< T, M >::indx [protected]

Definition at line 51 of file rtcLinearSystem.h.

template<class T , int M>
bool rtc::LinearSystem< T, M >::overwrite [protected]

Definition at line 53 of file rtcLinearSystem.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