roadrunner
2.6.0
Fast simulator for SBML models
|
The routine computes the singular value decomposition (SVD) of a real m-by-n matrix. More...
#include <SVD.h>
Public Member Functions | |
SVD (ls::DoubleMatrix &matrix) | |
constructor for SVD More... | |
const ls::DoubleMatrix & | getSingularValues () const |
returns the singular values computed for input matrix | |
const ls::DoubleMatrix & | getLeftSingularVectors () const |
returns left singular vectors where columns are the left vectors | |
const ls::DoubleMatrix & | getRightSingularVectors () const |
returns right singular vectors where rows are the right vectors | |
int | rank (double tol=1e-15) const |
estimates the rank of the matrix by counting non 0 singular values. More... | |
bool | isSingular () |
return true when the input matrix is singular. More... | |
The routine computes the singular value decomposition (SVD) of a real m-by-n matrix.
Often when computing the steady state of a system the jacobian matrix is singular. SVD is a way of computing the rank of a matrix, which in turn can be used to determine whether a rank is singular:
|
explicit |
constructor for SVD
matrix | a ls::Matrix<double> |
SVG is conducted on instantiation
The lapack rountine at the core of this class seems to expect the transpose of our input matrix so we do that here in the constructor. transpose should be done after collecting the initial dimensions Moreover, the output matrices left and right require transposing back before we give them to user
bool rr::SVD::isSingular | ( | ) |
return true when the input matrix is singular.
this is determined by testing whether than rank of the matrix is less than the smaller of the number of rows or number of columns.
int rr::SVD::rank | ( | double | tol = 1e-15 | ) | const |
estimates the rank of the matrix by counting non 0 singular values.
the rank of a matrix is equal to the number of non-zero singular values!
tol | tolerance by which we consider close enough to zero to be called zero |