COPASI API  4.40.278
CLinkMatrix Class Reference

#include <CLinkMatrix.h>

Inheritance diagram for CLinkMatrix:
[legend]

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_FLOAT64array ()
 
virtual const C_FLOAT64array () 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 elementTypeoperator() (const size_t &row, const size_t &col)
 
virtual const elementTypeoperator() (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_FLOAT64operator[] (size_t row)
 
virtual const C_FLOAT64operator[] (size_t row) const
 
virtual void resize (size_t rows, size_t cols, const bool &copy=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_INTmSwapVector
 

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_FLOAT64mpBuffer
 
size_t mRows
 

Constructor & Destructor Documentation

◆ CLinkMatrix() [1/2]

CLinkMatrix::CLinkMatrix ( )

Default constructor

◆ CLinkMatrix() [2/2]

CLinkMatrix::CLinkMatrix ( const CLinkMatrix src)

Copy constructor

◆ ~CLinkMatrix()

CLinkMatrix::~CLinkMatrix ( )
virtual

Destructor

Member Function Documentation

◆ applyColumnPivot()

bool CLinkMatrix::applyColumnPivot ( CMatrix< C_FLOAT64 > &  matrix,
const C_INT incr 
) const
private

Internal method performing apply and undo of column pivoting.

Parameters
CMatrix<C_FLOAT64 > & matrix
constC_INT & incr
Returns
bool success

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

◆ applyRowPivot() [1/2]

bool CLinkMatrix::applyRowPivot ( CMatrix< C_FLOAT64 > &  matrix,
const CVector< size_t > &  pivots 
) const
private

Internal method performing apply and undo of row pivoting.

Parameters
CMatrix<C_FLOAT64 > & matrix
constCVector< size_t > & pivots
Returns
bool success

References CVectorCore< CType >::array(), C_FLOAT64, CMatrix< C_FLOAT64 >::numCols(), CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), and CVectorCore< CType >::size().

◆ applyRowPivot() [2/2]

template<class CType >
bool CLinkMatrix::applyRowPivot ( CVectorCore< CType > &  vector) const
inline

Apply the row pivot

Parameters
CVectorCore<class CType > & vector
Returns
bool success

References mRowPivots, and CVectorCore< CType >::size().

Referenced by CModel::buildRedStoi(), doRowPivot(), and undoRowPivot().

◆ build()

bool CLinkMatrix::build ( const CMatrix< C_FLOAT64 > &  matrix,
size_t  maxRank = C_INVALID_INDEX 
)

Build the link matrix for the given matrix

Parameters
constCMatrix< C_FLOAT64 > & matrix
size_tmaxRank (default: C_INVALID_INDEX)
Returns
bool success

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

◆ clearPivoting()

void CLinkMatrix::clearPivoting ( )

◆ completePivotInformation()

void CLinkMatrix::completePivotInformation ( )
private

◆ doColumnPivot()

bool CLinkMatrix::doColumnPivot ( CMatrix< C_FLOAT64 > &  matrix) const

Do the column pivot

Parameters
CMatrix<C_FLOAT64 > & matrix
Returns
bool success

References applyColumnPivot().

Referenced by CMCAMethod::calculateUnscaledConcentrationCC().

◆ doRowPivot()

bool CLinkMatrix::doRowPivot ( CMatrix< C_FLOAT64 > &  matrix) const

Do the row pivot

Parameters
CMatrix<C_FLOAT64 > & matrix
Returns
bool success

References applyRowPivot(), and mRowPivots.

Referenced by CModel::buildLinkZero(), and CMCAMethod::createLinkMatrix().

◆ getNumDependent()

size_t CLinkMatrix::getNumDependent ( ) const

Retrieve the number of linear dependent rows of the input matrix

Returns
size_t numDependent

References CMatrix< C_FLOAT64 >::numRows().

Referenced by leftMultiply().

◆ getNumIndependent()

const size_t & CLinkMatrix::getNumIndependent ( ) const

Retrieve the number of linear independent rows of the input matrix

Returns
const size_t & numIndependent

References mIndependent.

Referenced by CModel::buildLinkZero(), CMCAMethod::createLinkMatrix(), and rightMultiply().

◆ getRowPivots()

const CVector< size_t > & CLinkMatrix::getRowPivots ( ) const

Retrieve the pivot vector used to create the link matrix

Returns
const CVector< size_t > & rowPivots

References mRowPivots.

◆ leftMultiply()

bool CLinkMatrix::leftMultiply ( const CMatrix< C_FLOAT64 > &  M,
CMatrix< C_FLOAT64 > &  P 
) const

◆ rightMultiply()

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.

Parameters
constC_FLOAT64 & alpha
constCMatrix< C_FLOAT64> & M
CMatrix<C_FLOAT64> & P
Returns
bool success;

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

◆ undoColumnPivot()

bool CLinkMatrix::undoColumnPivot ( CMatrix< C_FLOAT64 > &  matrix) const

Undo the column pivot

Parameters
CMatrix<C_FLOAT64 > & matrix
Returns
bool success

References applyColumnPivot().

Referenced by CMCAMethod::calculateUnscaledConcentrationCC().

◆ undoRowPivot()

bool CLinkMatrix::undoRowPivot ( CMatrix< C_FLOAT64 > &  matrix) const

Undo the row pivot

Parameters
CMatrix<C_FLOAT64 > & matrix
Returns
bool success

References applyRowPivot(), and mPivotInverse.

Referenced by CMCAMethod::calculateUnscaledConcentrationCC().

Member Data Documentation

◆ mIndependent

size_t CLinkMatrix::mIndependent
private

The number of linear independent rows.

Referenced by build(), and getNumIndependent().

◆ mPivotInverse

CVector< size_t > CLinkMatrix::mPivotInverse
private

The pivot vector used for undoing row swapping

Referenced by completePivotInformation(), and undoRowPivot().

◆ mRowPivots

CVector< size_t > CLinkMatrix::mRowPivots
private

◆ mSwapVector

CVector< C_INT > CLinkMatrix::mSwapVector
private

The swap vector used for column swapping

Referenced by applyColumnPivot(), and completePivotInformation().


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