roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | List of all members
rr::SVD Class Reference

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...
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ SVD()

rr::SVD::SVD ( ls::DoubleMatrix &  matrix)
explicit

constructor for SVD

Parameters
matrixa ls::Matrix<double>

SVG is conducted on instantiation

See also
SVD::getSingularValues
SVD::getLeftSingularVectors
SVD::getRightSingularVectors

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

Member Function Documentation

◆ isSingular()

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.

◆ rank()

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!

Parameters
toltolerance by which we consider close enough to zero to be called zero

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