COPASI API
4.40.278
|
#include <CLinkMatrix.h>
Public Member Functions | |
template<class CType > | |
bool | applyRowPivot (CVectorCore< CType > &vector) const |
bool | build (const CMatrix< C_FLOAT64 > &matrix, size_t maxRank=C_INVALID_INDEX) |
void | clearPivoting () |
CLinkMatrix () | |
CLinkMatrix (const CLinkMatrix &src) | |
bool | doColumnPivot (CMatrix< C_FLOAT64 > &matrix) const |
bool | doRowPivot (CMatrix< C_FLOAT64 > &matrix) const |
size_t | getNumDependent () const |
const size_t & | getNumIndependent () const |
const CVector< size_t > & | getRowPivots () const |
bool | leftMultiply (const CMatrix< C_FLOAT64 > &M, CMatrix< C_FLOAT64 > &P) const |
bool | rightMultiply (const C_FLOAT64 &alpha, const CMatrix< C_FLOAT64 > &M, CMatrix< C_FLOAT64 > &P) const |
bool | undoColumnPivot (CMatrix< C_FLOAT64 > &matrix) const |
bool | undoRowPivot (CMatrix< C_FLOAT64 > &matrix) const |
virtual | ~CLinkMatrix () |
Public Member Functions inherited from CMatrix< C_FLOAT64 > | |
bool | applyPivot (const CVector< size_t > &pivot) |
virtual C_FLOAT64 * | array () |
virtual const C_FLOAT64 * | array () const |
CMatrix (const CMatrix< C_FLOAT64 > &src) | |
CMatrix (size_t rows=0, size_t cols=0) | |
virtual size_t | numCols () const |
virtual size_t | numRows () const |
virtual elementType & | operator() (const size_t &row, const size_t &col) |
virtual const elementType & | operator() (const size_t &row, const size_t &col) const |
virtual CMatrix< C_FLOAT64 > & | operator= (const C_FLOAT64 &value) |
virtual CMatrix< C_FLOAT64 > & | operator= (const CMatrix< C_FLOAT64 > &rhs) |
virtual C_FLOAT64 * | operator[] (size_t row) |
virtual const C_FLOAT64 * | operator[] (size_t row) const |
virtual void | resize (size_t rows, size_t cols, const bool ©=false) |
virtual size_t | size () const |
virtual | ~CMatrix () |
Private Member Functions | |
bool | applyColumnPivot (CMatrix< C_FLOAT64 > &matrix, const C_INT &incr) const |
bool | applyRowPivot (CMatrix< C_FLOAT64 > &matrix, const CVector< size_t > &pivots) const |
void | completePivotInformation () |
Private Attributes | |
size_t | mIndependent |
CVector< size_t > | mPivotInverse |
CVector< size_t > | mRowPivots |
CVector< C_INT > | mSwapVector |
Additional Inherited Members | |
Public Types inherited from CMatrix< C_FLOAT64 > | |
typedef C_FLOAT64 | elementType |
Protected Attributes inherited from CMatrix< C_FLOAT64 > | |
size_t | mCols |
C_FLOAT64 * | mpBuffer |
size_t | mRows |
CLinkMatrix::CLinkMatrix | ( | ) |
Default constructor
CLinkMatrix::CLinkMatrix | ( | const CLinkMatrix & | src | ) |
Copy constructor
|
virtual |
Destructor
|
private |
Internal method performing apply and undo of column pivoting.
CMatrix< | C_FLOAT64 > & matrix |
const | C_INT & incr |
References CMatrix< CType >::array(), CVectorCore< CType >::array(), C_INT, dlaswp_(), mRowPivots, mSwapVector, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), and CVectorCore< CType >::size().
Referenced by doColumnPivot(), and undoColumnPivot().
|
private |
Internal method performing apply and undo of row pivoting.
CMatrix< | C_FLOAT64 > & matrix |
const | CVector< size_t > & pivots |
References CVectorCore< CType >::array(), C_FLOAT64, CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), and CVectorCore< CType >::size().
|
inline |
Apply the row pivot
CVectorCore< | class CType > & vector |
References mRowPivots, and CVectorCore< CType >::size().
Referenced by CModel::buildRedStoi(), doRowPivot(), and undoRowPivot().
bool CLinkMatrix::build | ( | const CMatrix< C_FLOAT64 > & | matrix, |
size_t | maxRank = C_INVALID_INDEX |
||
) |
Build the link matrix for the given matrix
const | CMatrix< C_FLOAT64 > & matrix |
size_t | maxRank (default: C_INVALID_INDEX) |
Determine the rank of the matrix This code is copied from dgelsy.f
References CMatrix< C_FLOAT64 >::array(), CMatrix< CType >::array(), CVectorCore< CType >::array(), C_FLOAT64, C_INT, C_INT32, completePivotInformation(), dgeqp3_(), dlaic1_(), dtrtri_(), fatalError, max, min, mIndependent, mRowPivots, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), CMatrix< C_FLOAT64 >::resize(), CVector< CType >::resize(), and TAU.
Referenced by CModel::buildLinkZero(), and CMCAMethod::createLinkMatrix().
void CLinkMatrix::clearPivoting | ( | ) |
Clear the pivot and swap vectors
References CVectorCore< CType >::array(), completePivotInformation(), mRowPivots, and CVectorCore< CType >::size().
Referenced by CModel::compile().
|
private |
Complete the pivot information.
References CVectorCore< CType >::array(), C_INT, mPivotInverse, mRowPivots, mSwapVector, CVector< CType >::resize(), and CVectorCore< CType >::size().
Referenced by build(), and clearPivoting().
Do the column pivot
CMatrix< | C_FLOAT64 > & matrix |
References applyColumnPivot().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Do the row pivot
CMatrix< | C_FLOAT64 > & matrix |
References applyRowPivot(), and mRowPivots.
Referenced by CModel::buildLinkZero(), and CMCAMethod::createLinkMatrix().
size_t CLinkMatrix::getNumDependent | ( | ) | const |
Retrieve the number of linear dependent rows of the input matrix
References CMatrix< C_FLOAT64 >::numRows().
Referenced by leftMultiply().
const size_t & CLinkMatrix::getNumIndependent | ( | ) | const |
Retrieve the number of linear independent rows of the input matrix
References mIndependent.
Referenced by CModel::buildLinkZero(), CMCAMethod::createLinkMatrix(), and rightMultiply().
const CVector< size_t > & CLinkMatrix::getRowPivots | ( | ) | const |
Retrieve the pivot vector used to create the link matrix
References mRowPivots.
Left multiply the given matrix M with L, i.e., P = L * M
const | CMatrix< C_FLOAT64> & M |
CMatrix< | C_FLOAT64> & P |
References CMatrix< C_FLOAT64 >::array(), CMatrix< CType >::array(), C_FLOAT64, C_INT, dgemm_(), getNumDependent(), K, mRowPivots, CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), CMatrix< CType >::resize(), CMatrix< CType >::size(), and CVectorCore< CType >::size().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
bool CLinkMatrix::rightMultiply | ( | const C_FLOAT64 & | alpha, |
const CMatrix< C_FLOAT64 > & | M, | ||
CMatrix< C_FLOAT64 > & | P | ||
) | const |
Right multiply the given matrix M with L, i.e., P = alpha M * L. Note the columns of M must be in the same order as L.
const | C_FLOAT64 & alpha |
const | CMatrix< C_FLOAT64> & M |
CMatrix< | C_FLOAT64> & P |
References CMatrix< C_FLOAT64 >::array(), CMatrix< CType >::array(), C_FLOAT64, C_INT, dgemm_(), getNumIndependent(), K, mRowPivots, CMatrix< CType >::numCols(), CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numRows(), CMatrix< C_FLOAT64 >::numRows(), CMatrix< CType >::resize(), CMatrix< CType >::size(), and CVectorCore< CType >::size().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Undo the column pivot
CMatrix< | C_FLOAT64 > & matrix |
References applyColumnPivot().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Undo the row pivot
CMatrix< | C_FLOAT64 > & matrix |
References applyRowPivot(), and mPivotInverse.
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
|
private |
The number of linear independent rows.
Referenced by build(), and getNumIndependent().
|
private |
The pivot vector used for undoing row swapping
Referenced by completePivotInformation(), and undoRowPivot().
|
private |
The row pivoting performed to create the link matrix
Referenced by applyColumnPivot(), applyRowPivot(), build(), clearPivoting(), completePivotInformation(), doRowPivot(), getRowPivots(), leftMultiply(), and rightMultiply().
The swap vector used for column swapping
Referenced by applyColumnPivot(), and completePivotInformation().