COPASI API
4.16.103
|
#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 () |
![]() | |
bool | applyPivot (const CVector< size_t > &pivot) |
virtual C_FLOAT64 * | array () |
virtual const C_FLOAT64 * | array () const |
CMatrix (size_t rows=0, size_t cols=0) | |
CMatrix (const CMatrix< C_FLOAT64 > &src) | |
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 CMatrix< C_FLOAT64 > &rhs) |
virtual CMatrix< C_FLOAT64 > & | operator= (const C_FLOAT64 &value) |
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 | |
![]() | |
typedef C_FLOAT64 | elementType |
![]() | |
C_FLOAT64 * | mArray |
size_t | mCols |
size_t | mRows |
Definition at line 15 of file CLinkMatrix.h.
CLinkMatrix::CLinkMatrix | ( | ) |
CLinkMatrix::CLinkMatrix | ( | const CLinkMatrix & | src | ) |
|
virtual |
|
private |
Internal method performing apply and undo of column pivoting.
CMatrix< | C_FLOAT64 > & matrix |
const | C_INT & incr |
Definition at line 562 of file CLinkMatrix.cpp.
References CVectorCore< CType >::array(), CMatrix< CType >::array(), C_INT, dlaswp_(), mRowPivots, mSwapVector, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), and CVectorCore< CType >::size().
Referenced by doColumnPivot(), and undoColumnPivot().
|
inline |
Apply the row pivot
CVectorCore< | class CType > & vector |
Definition at line 115 of file CLinkMatrix.h.
References mRowPivots, and CVectorCore< CType >::size().
Referenced by CModel::buildRedStoi(), doRowPivot(), and undoRowPivot().
|
private |
Internal method performing apply and undo of row pivoting.
CMatrix< | C_FLOAT64 > & matrix |
const | CVector< size_t > & pivots |
Definition at line 506 of file CLinkMatrix.cpp.
References CMatrix< CType >::array(), C_FLOAT64, CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), and CVectorCore< CType >::size().
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
Definition at line 44 of file CLinkMatrix.cpp.
References CVectorCore< CType >::array(), CMatrix< C_FLOAT64 >::array(), CMatrix< 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
Definition at line 384 of file CLinkMatrix.cpp.
References CVectorCore< CType >::array(), completePivotInformation(), mRowPivots, and CVectorCore< CType >::size().
Referenced by CModel::compile().
|
private |
Complete the pivot information.
Definition at line 340 of file CLinkMatrix.cpp.
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 |
Definition at line 552 of file CLinkMatrix.cpp.
References applyColumnPivot().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Do the row pivot
CMatrix< | C_FLOAT64 > & matrix |
Definition at line 496 of file CLinkMatrix.cpp.
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
Definition at line 491 of file CLinkMatrix.cpp.
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
Definition at line 486 of file CLinkMatrix.cpp.
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
Definition at line 39 of file CLinkMatrix.cpp.
References mRowPivots.
Left multiply the given matrix M with L, i.e., P = L * M
const | CMatrix< C_FLOAT64> & M |
CMatrix< | C_FLOAT64> & P |
Definition at line 445 of file CLinkMatrix.cpp.
References CMatrix< CType >::array(), CMatrix< C_FLOAT64 >::array(), C_FLOAT64, C_INT, dgemm_(), getNumDependent(), K, mRowPivots, CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), CMatrix< CType >::resize(), CVectorCore< CType >::size(), and CMatrix< 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 |
Definition at line 398 of file CLinkMatrix.cpp.
References CMatrix< CType >::array(), CMatrix< C_FLOAT64 >::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(), CVectorCore< CType >::size(), and CMatrix< CType >::size().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Undo the column pivot
CMatrix< | C_FLOAT64 > & matrix |
Definition at line 557 of file CLinkMatrix.cpp.
References applyColumnPivot().
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
Undo the row pivot
CMatrix< | C_FLOAT64 > & matrix |
Definition at line 501 of file CLinkMatrix.cpp.
References applyRowPivot(), and mPivotInverse.
Referenced by CMCAMethod::calculateUnscaledConcentrationCC().
|
private |
The number of linear independent rows.
Definition at line 200 of file CLinkMatrix.h.
Referenced by build(), and getNumIndependent().
|
private |
The pivot vector used for undoing row swapping
Definition at line 190 of file CLinkMatrix.h.
Referenced by completePivotInformation(), and undoRowPivot().
|
private |
The row pivoting performed to create the link matrix
Definition at line 185 of file CLinkMatrix.h.
Referenced by applyColumnPivot(), applyRowPivot(), build(), clearPivoting(), completePivotInformation(), doRowPivot(), getRowPivots(), leftMultiply(), and rightMultiply().
The swap vector used for column swapping
Definition at line 195 of file CLinkMatrix.h.
Referenced by applyColumnPivot(), and completePivotInformation().