COPASI API  4.40.278
CMatrix< CType > Class Template Reference

#include <CMatrix.h>

Inheritance diagram for CMatrix< CType >:
[legend]

Public Types

typedef CType elementType
 

Public Member Functions

bool applyPivot (const CVector< size_t > &pivot)
 
virtual CType * array ()
 
virtual const CType * array () const
 
 CMatrix (const CMatrix< CType > &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< CType > & operator= (const CMatrix< CType > &rhs)
 
virtual CMatrix< CType > & operator= (const CType &value)
 
virtual CType * operator[] (size_t row)
 
virtual const CType * operator[] (size_t row) const
 
virtual void resize (size_t rows, size_t cols, const bool &copy=false)
 
virtual size_t size () const
 
virtual ~CMatrix ()
 

Protected Attributes

size_t mCols
 
CType * mpBuffer
 
size_t mRows
 

Friends

std::ostream & operator<< (std::ostream &os, const CMatrix< CType > &A)
 

Detailed Description

template<class CType>
class CMatrix< CType >

Template class CMatrix < class CType > This template class is a simple matrix class allowing standard C-style and fortran style access to the elements. It also supplies an ostream operator.

Member Typedef Documentation

◆ elementType

template<class CType >
typedef CType CMatrix< CType >::elementType

Constructor & Destructor Documentation

◆ CMatrix() [1/2]

template<class CType >
CMatrix< CType >::CMatrix ( size_t  rows = 0,
size_t  cols = 0 
)
inline

Default constructor

Parameters
size_trows (default = 0)
size_tcols (default = 0)

References CMatrix< CType >::resize().

◆ CMatrix() [2/2]

template<class CType >
CMatrix< CType >::CMatrix ( const CMatrix< CType > &  src)
inline

Copy constructor

Parameters
constCMatrix <CType> & src

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, CMatrix< CType >::mRows, and CMatrix< CType >::resize().

◆ ~CMatrix()

template<class CType >
virtual CMatrix< CType >::~CMatrix ( )
inlinevirtual

Destructor.

References CMatrix< CType >::mpBuffer.

Member Function Documentation

◆ applyPivot()

template<class CType >
bool CMatrix< CType >::applyPivot ( const CVector< size_t > &  pivot)
inline

Reorder the rows according to the provided pivots

Parameters
constCVector<size_t> & pivot
Returns
bool success

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, CMatrix< CType >::mRows, pdeletev, and CVectorCore< CType >::size().

Referenced by CExperiment::read().

◆ array() [1/2]

template<class CType >
virtual CType* CMatrix< CType >::array ( )
inlinevirtual

Retrieve the array of the matrix elements. This is suitable for interfacing with clapack routines.

Returns
CType * array

References CMatrix< CType >::mpBuffer.

Referenced by CLinkMatrix::applyColumnPivot(), CLinkMatrix::build(), CBitPatternMethod::buildFluxModes(), CBitPatternTreeMethod::buildFluxModes(), CBitPatternMethod::buildKernelMatrix(), CBitPatternTreeMethod::buildKernelMatrix(), CSSAMethod::buildKineticMatrix(), CModel::buildMoieties(), CStochasticRungeKuttaRI5::buildStage1(), CStochasticRungeKuttaRI5::buildStage2(), CModel::buildStoi(), CSSAMethod::buildStoichiometry(), CFitProblem::calcCov(), CFitProblem::calcEigen(), CEigen::calcEigenValues(), CFitProblem::calculate(), CTimeSensMethod::calculate_dAssignments_dPar(), CTimeSensMethod::calculate_dAssignments_dState(), CTimeSensMethod::calculate_dInitialState_dPar(), CTimeSensMethod::calculate_dRate_dPar(), CLNAMethod::calculateCovarianceMatrixFull(), CLNAMethod::calculateCovarianceMatrixReduced(), CFitProblem::calculateCrossValidation(), CMathContainer::calculateJacobian(), CBitPatternMethod::CalculateKernel(), CBitPatternTreeMethod::CalculateKernel(), CMathContainer::calculateRootJacobian(), CStochasticRungeKuttaRI5::calculateStateVariables(), CExperiment::calculateStatistics(), CFitProblem::calculateStatistics(), CMCAMethod::calculateUnscaledConcentrationCC(), CMCAMethod::calculateUnscaledElasticities(), CMCAMethod::calculateUnscaledFluxCC(), CMCAMethod::checkSummationTheorems(), CFitProblem::createParameterSets(), CStepMatrix::CStepMatrix(), CSSAMethod::decomposeJacobian(), CSSAMethod::diag(), dgemm::eval(), CLyapWolfMethod::evalF(), CTimeSensLsodaMethod::evalF(), CStochasticRungeKuttaRI5::generateRandomNumbers(), CExperiment::getErrorMeanSD(), CExperiment::getErrorSum(), COptMethodSteepestDescent::gradient(), CModel::handleUnusedMetabolites(), COptMethodLevenbergMarquardt::hessian(), CExperiment::initializeScalingMatrix(), CEFMMethod::isValidProblem(), CLinkMatrix::leftMultiply(), CSparseMatrix::operator const CMatrix< C_FLOAT64 >(), CSparseMatrix::operator=(), COptMethodLevenbergMarquardt::optimise(), CBitPatternMethod::performRankTest(), CSteadyStateTask::process(), CFitProblem::restore(), CLinkMatrix::rightMultiply(), CMCAMethod::scaleMCA(), COptMethodTruncatedNewton::sFun(), CCSPMethod::sminverse(), CLeastSquareSolution::solve(), and CFitProblem::updateContainer().

◆ array() [2/2]

template<class CType >
virtual const CType* CMatrix< CType >::array ( ) const
inlinevirtual

Retrieve the array of the matrix elements. This is suitable for interfacing with clapack routines.

Returns
const CType * array

References CMatrix< CType >::mpBuffer.

◆ numCols()

template<class CType >
virtual size_t CMatrix< CType >::numCols ( ) const
inlinevirtual

The number of columns of the matrix

Returns
size_t cols

References CMatrix< CType >::mCols.

Referenced by CLinkMatrix::applyColumnPivot(), CLinkMatrix::applyRowPivot(), CLinkMatrix::build(), CBitPatternMethod::buildFluxModeMatrix(), CBitPatternMethod::buildFluxModes(), CBitPatternTreeMethod::buildFluxModes(), CBitPatternMethod::buildKernelMatrix(), CBitPatternTreeMethod::buildKernelMatrix(), CModel::buildRedStoi(), CEigen::calcEigenValues(), CFitProblem::calcFIM(), CFitProblem::calcPartialFIM(), CFitProblem::calculate(), CLNAMethod::calculateCovarianceMatrixReduced(), CFitProblem::calculateCrossValidation(), CBitPatternMethod::CalculateKernel(), CBitPatternTreeMethod::CalculateKernel(), CMathContainer::calculateRootDerivatives(), CExperiment::calculateStatistics(), CMCAMethod::calculateUnscaledConcentrationCC(), CMCAMethod::checkSummationTheorems(), CBitPatternMethod::combine(), CExperiment::compile(), CModel::createEventsForTimeseries(), CMCAMethod::createLinkMatrix(), CStepMatrix::CStepMatrix(), CSSAMethod::decomposeJacobian(), CNewtonMethod::doNewtonStep(), dgemm::eval(), CExperiment::getErrorMeanSD(), CExperiment::getErrorSum(), CExperiment::getTotalValueCount(), CModel::handleUnusedMetabolites(), COptMethodLevenbergMarquardt::hessian(), CBitPatternMethod::initialize(), CBitPatternTreeMethod::initialize(), CExperiment::initializeScalingMatrix(), CEFMMethod::isValidProblem(), CLinkMatrix::leftMultiply(), LUfactor(), CLinkMatrixView::numCols(), CSparseMatrix::operator=(), CBitPatternMethod::performRankTest(), CExperiment::printResult(), CMCAMethod::resizeAllMatrices(), CLinkMatrix::rightMultiply(), CMCAMethod::scaleMCA(), CLeastSquareSolution::solve(), CExperiment::storeExtendedTimeSeriesData(), CExperiment::sumOfSquares(), CExperiment::sumOfSquaresStore(), CExperiment::updateFittedPointValues(), and CExperiment::updateFittedPointValuesFromExtendedTimeSeries().

◆ numRows()

◆ operator()() [1/2]

template<class CType >
virtual elementType& CMatrix< CType >::operator() ( const size_t &  row,
const size_t &  col 
)
inlinevirtual

Retrieve a matrix element using c-style indexing.

Parameters
constsize_t & row
constsize_t & col
Returns
const elementType & element

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, and CMatrix< CType >::mRows.

◆ operator()() [2/2]

template<class CType >
virtual const elementType& CMatrix< CType >::operator() ( const size_t &  row,
const size_t &  col 
) const
inlinevirtual

Retrieve a matrix element using c-style indexing.

Parameters
constsize_t & row
constsize_t & col
Returns
const elementType & element

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, and CMatrix< CType >::mRows.

◆ operator=() [1/2]

template<class CType >
virtual CMatrix<CType>& CMatrix< CType >::operator= ( const CMatrix< CType > &  rhs)
inlinevirtual

Assignment operator

Parameters
constCMatrix <CType> & rhs
Returns
CMatrix <CType> & lhs

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, CMatrix< CType >::mRows, and CMatrix< CType >::resize().

◆ operator=() [2/2]

template<class CType >
virtual CMatrix<CType>& CMatrix< CType >::operator= ( const CType &  value)
inlinevirtual

Assignment operator

Parameters
constCType & value
Returns
CMatrix <CType> & lhs

References CMatrix< CType >::mCols, CMatrix< CType >::mpBuffer, and CMatrix< CType >::mRows.

◆ operator[]() [1/2]

template<class CType >
virtual CType* CMatrix< CType >::operator[] ( size_t  row)
inlinevirtual

Retrieve a row of the matrix using c-style indexing

Parameters
size_trow
Returns
CType * row

References CMatrix< CType >::mCols, and CMatrix< CType >::mpBuffer.

◆ operator[]() [2/2]

template<class CType >
virtual const CType* CMatrix< CType >::operator[] ( size_t  row) const
inlinevirtual

Retrieve a row of the matrix using c-style indexing

Parameters
size_trow
Returns
const CType * row

References CMatrix< CType >::mCols, and CMatrix< CType >::mpBuffer.

◆ resize()

template<class CType >
virtual void CMatrix< CType >::resize ( size_t  rows,
size_t  cols,
const bool &  copy = false 
)
inlinevirtual

Resize the matrix. The previous content is lost

Parameters
size_trows
size_tcols

References C_FLOAT64, CCopasiMessage::EXCEPTION, max, CMatrix< CType >::mCols, MCopasiBase, min, CMatrix< CType >::mpBuffer, and CMatrix< CType >::mRows.

Referenced by CBitPatternMethod::buildKernelMatrix(), CBitPatternTreeMethod::buildKernelMatrix(), CSSAMethod::buildKineticMatrix(), CModel::buildRedStoi(), CModel::buildStoi(), CSSAMethod::buildStoichiometry(), CFitProblem::calcEigen(), CEigen::calcEigenValues(), CFitProblem::calcFIM(), CFitProblem::calcPartialFIM(), CTimeSensMethod::calculate_dAssignments_dPar(), CTimeSensMethod::calculate_dAssignments_dState(), CTimeSensMethod::calculate_dInitialState_dPar(), CTimeSensMethod::calculate_dRate_dPar(), CLNAMethod::calculateCovarianceMatrixFull(), CLNAMethod::calculateCovarianceMatrixReduced(), CMathContainer::calculateElasticityDependencies(), CMathContainer::calculateJacobian(), CMathContainer::calculateJacobianDependencies(), CBitPatternMethod::CalculateKernel(), CBitPatternTreeMethod::CalculateKernel(), CMathContainer::calculateRootJacobian(), CFitProblem::calculateStatistics(), CMCAMethod::calculateUnscaledConcentrationCC(), CTimeSeries::clear(), CMatrix< CType >::CMatrix(), CTimeSeries::compile(), CMCAMethod::createLinkMatrix(), CCSPMethod::CSPImportanceIndex(), CCSPMethod::CSPParticipationIndex(), CCSPMethod::CSPradicalPointer(), CCSPMethod::cspstep(), CSSAMethod::decomposeJacobian(), CSSAMethod::diag(), dgemm::eval(), CTimeSeries::increaseAllocation(), COptMethodLevenbergMarquardt::initialize(), COptMethodNelderMead::initialize(), COptMethodNL2SOL::initialize(), COptMethodPS::initialize(), CFitProblem::initialize(), CCSPMethod::initializeOutput(), CExperiment::initializeScalingMatrix(), CLinkMatrix::leftMultiply(), CTSSAMethod::mat_anal_fast_space(), CTSSAMethod::mat_anal_mod(), CTSSAMethod::mat_anal_mod_space(), CILDMMethod::newton(), CILDMModifiedMethod::newton_new(), CSparseMatrix::operator const CMatrix< C_FLOAT64 >(), CMatrix< CType >::operator=(), CExperiment::read(), CLNAMethod::resizeAllMatrices(), CMCAMethod::resizeAllMatrices(), CLinkMatrix::rightMultiply(), CCSPMethod::setAnnotationM(), CILDMMethod::setAnnotationM(), CILDMModifiedMethod::setAnnotationM(), CLyapWolfMethod::start(), CTimeSensLsodaMethod::start(), CStochasticRungeKuttaRI5::start(), CCSPMethod::start(), CILDMMethod::start(), CILDMModifiedMethod::start(), CCSPMethod::step(), CILDMMethod::step(), CILDMModifiedMethod::step(), CTSSAMethod::sylvester(), CSteadyStateTask::updateMatrices(), and CCSPMethod::yCorrection().

◆ size()

Friends And Related Function Documentation

◆ operator<<

template<class CType >
std::ostream& operator<< ( std::ostream &  os,
const CMatrix< CType > &  A 
)
friend

Output stream operator

Parameters
ostream& os
constCMatrix< CType > & A
Returns
ostream & os

Member Data Documentation

◆ mCols

◆ mpBuffer

◆ mRows


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