#include <rtcLinearSystem.h>
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 |
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.
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.
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.
rtc::LinearSystem< T, M >::~LinearSystem | ( | ) | [inline] |
Dtor deletes memory if it was allocated
Definition at line 94 of file rtcLinearSystem.h.
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.
Definition at line 171 of file rtcLinearSystem.h.
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.
decomp | specifies which decomposition to call: 1: LU, 2: Cholesky. |
Definition at line 114 of file rtcLinearSystem.h.
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.
b | the rhs |
sol | the output solution |
Definition at line 202 of file rtcLinearSystem.h.
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.
Definition at line 140 of file rtcLinearSystem.h.
SMat<T,M>& rtc::LinearSystem< T, M >::a [protected] |
Definition at line 49 of file rtcLinearSystem.h.
SMat<T,M>* rtc::LinearSystem< T, M >::d [protected] |
Definition at line 50 of file rtcLinearSystem.h.
int rtc::LinearSystem< T, M >::haveDecomp [protected] |
Definition at line 52 of file rtcLinearSystem.h.
Vec<int,M> rtc::LinearSystem< T, M >::indx [protected] |
Definition at line 51 of file rtcLinearSystem.h.
bool rtc::LinearSystem< T, M >::overwrite [protected] |
Definition at line 53 of file rtcLinearSystem.h.