LibreOffice Module basegfx (master) 1
|
Go to the source code of this file.
Functions | |
template<class Matrix , typename BaseType > | |
bool | eliminate (Matrix &matrix, int rows, int cols, const BaseType &minPivot) |
This method eliminates elements below main diagonal in the given matrix by gaussian elimination. More... | |
template<class Matrix , class Vector , typename BaseType > | |
bool | substitute (const Matrix &matrix, int rows, int cols, Vector &result) |
Retrieve solution vector of linear system by substituting backwards. More... | |
template<class Matrix , class Vector , typename BaseType > | |
bool | solve (Matrix &matrix, int rows, int cols, Vector &result, BaseType minPivot) |
This method determines solution of given linear system, if any. More... | |
bool eliminate | ( | Matrix & | matrix, |
int | rows, | ||
int | cols, | ||
const BaseType & | minPivot | ||
) |
This method eliminates elements below main diagonal in the given matrix by gaussian elimination.
matrix | The matrix to operate on. Last column is the result vector (right hand side of the linear equation). After successful termination, the matrix is upper triangular. The matrix is expected to be in row major order. |
rows | Number of rows in matrix |
cols | Number of columns in matrix |
minPivot | If the pivot element gets lesser than minPivot, this method fails, otherwise, elimination succeeds and true is returned. |
bool solve | ( | Matrix & | matrix, |
int | rows, | ||
int | cols, | ||
Vector & | result, | ||
BaseType | minPivot | ||
) |
This method determines solution of given linear system, if any.
This is a wrapper for eliminate and substitute, given matrix must contain right side of equation as the last column.
matrix | The matrix to operate on. Last column is the result vector (right hand side of the linear equation). After successful termination, the matrix is upper triangular. The matrix is expected to be in row major order. |
rows | Number of rows in matrix |
cols | Number of columns in matrix |
minPivot | If the pivot element gets lesser than minPivot, this method fails, otherwise, elimination succeeds and true is returned. |
Definition at line 151 of file gauss.hxx.
References result.
Referenced by Impl_calcFocus().
bool substitute | ( | const Matrix & | matrix, |
int | rows, | ||
int | cols, | ||
Vector & | result | ||
) |
Retrieve solution vector of linear system by substituting backwards.
This operation relies on the previous successful application of eliminate()!
matrix | Matrix in upper diagonal form, as e.g. generated by eliminate() |
rows | Number of rows in matrix |
cols | Number of columns in matrix |
result | Result vector. Given matrix must have space for one column (rows entries). |
Definition at line 102 of file gauss.hxx.
References result.