COPASI API  4.40.278
CSparseMatrix Class Reference

#include <CSparseMatrix.h>

Public Member Functions

 CSparseMatrix (const CCompressedColumnFormat &ccf)
 
 CSparseMatrix (const size_t &rows=0, const size_t &cols=0)
 
std::vector< std::vector< CSparseMatrixElement * > > & getColumns ()
 
const std::vector< std::vector< CSparseMatrixElement * > > & getColumns () const
 
std::vector< std::vector< CSparseMatrixElement * > > & getRows ()
 
const std::vector< std::vector< CSparseMatrixElement * > > & getRows () const
 
const C_FLOAT64getTreshold () const
 
bool insert (const size_t &row, const size_t &col, const C_FLOAT64 &value)
 
const size_t & numCols () const
 
size_t numNonZeros () const
 
const size_t & numRows () const
 
 operator const CMatrix< C_FLOAT64 > () const
 
CSparseMatrixElementoperator() (const size_t &row, const size_t &col)
 
const CSparseMatrixElementoperator() (const size_t &row, const size_t &col) const
 
CSparseMatrixoperator= (const CCompressedColumnFormat &ccf)
 
CSparseMatrixoperator= (const CMatrix< C_FLOAT64 > &matrix)
 
bool remove (const size_t &row, const size_t &col)
 
bool resize (const size_t &rows, const size_t &columns)
 
bool setTreshold (const C_FLOAT64 &threshold)
 
 ~CSparseMatrix ()
 

Private Member Functions

void cleanup ()
 

Private Attributes

std::vector< size_t > mColIndex
 
std::vector< std::vector< CSparseMatrixElement * > > mCols
 
CSparseMatrixElement mElement
 
size_t mNumCols
 
size_t mNumRows
 
std::vector< size_t > mRowIndex
 
std::vector< std::vector< CSparseMatrixElement * > > mRows
 
size_t mSearchCol
 
size_t mSearchRow
 
C_FLOAT64 mThreshold
 

Friends

std::ostream & operator<< (std::ostream &os, const CSparseMatrix &A)
 

Constructor & Destructor Documentation

◆ CSparseMatrix() [1/2]

CSparseMatrix::CSparseMatrix ( const size_t &  rows = 0,
const size_t &  cols = 0 
)

References resize().

◆ CSparseMatrix() [2/2]

CSparseMatrix::CSparseMatrix ( const CCompressedColumnFormat ccf)

◆ ~CSparseMatrix()

CSparseMatrix::~CSparseMatrix ( )

References cleanup().

Member Function Documentation

◆ cleanup()

void CSparseMatrix::cleanup ( )
private

References mRows.

Referenced by ~CSparseMatrix().

◆ getColumns() [1/2]

std::vector< std::vector< CSparseMatrixElement * > > & CSparseMatrix::getColumns ( )

References mCols.

◆ getColumns() [2/2]

const std::vector< std::vector< CSparseMatrixElement * > > & CSparseMatrix::getColumns ( ) const

References mCols.

Referenced by CCompressedColumnFormat::operator=().

◆ getRows() [1/2]

std::vector< std::vector< CSparseMatrixElement * > > & CSparseMatrix::getRows ( )

References mRows.

◆ getRows() [2/2]

const std::vector< std::vector< CSparseMatrixElement * > > & CSparseMatrix::getRows ( ) const

References mRows.

◆ getTreshold()

const C_FLOAT64 & CSparseMatrix::getTreshold ( ) const

References mThreshold.

Referenced by CSparseMatrixElement::operator=().

◆ insert()

bool CSparseMatrix::insert ( const size_t &  row,
const size_t &  col,
const C_FLOAT64 value 
)

◆ numCols()

const size_t & CSparseMatrix::numCols ( ) const

References mNumCols.

Referenced by CCompressedColumnFormat::operator=().

◆ numNonZeros()

size_t CSparseMatrix::numNonZeros ( ) const

References mRows.

Referenced by CCompressedColumnFormat::operator=().

◆ numRows()

const size_t & CSparseMatrix::numRows ( ) const

References mNumRows.

Referenced by CCompressedColumnFormat::operator=().

◆ operator const CMatrix< C_FLOAT64 >()

CSparseMatrix::operator const CMatrix< C_FLOAT64 > ( ) const

◆ operator()() [1/2]

CSparseMatrixElement & CSparseMatrix::operator() ( const size_t &  row,
const size_t &  col 
)

◆ operator()() [2/2]

const CSparseMatrixElement & CSparseMatrix::operator() ( const size_t &  row,
const size_t &  col 
) const

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ remove()

bool CSparseMatrix::remove ( const size_t &  row,
const size_t &  col 
)

◆ resize()

bool CSparseMatrix::resize ( const size_t &  rows,
const size_t &  columns 
)

References mColIndex, mCols, mNumCols, mNumRows, mRowIndex, and mRows.

Referenced by CSparseMatrix(), and operator=().

◆ setTreshold()

bool CSparseMatrix::setTreshold ( const C_FLOAT64 threshold)

References mRows, mThreshold, and remove().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CSparseMatrix A 
)
friend

Member Data Documentation

◆ mColIndex

std::vector< size_t> CSparseMatrix::mColIndex
private

Referenced by insert(), operator=(), and resize().

◆ mCols

std::vector< std::vector< CSparseMatrixElement *> > CSparseMatrix::mCols
private

◆ mElement

CSparseMatrixElement CSparseMatrix::mElement
private

Referenced by insert(), operator()(), and remove().

◆ mNumCols

size_t CSparseMatrix::mNumCols
private

Referenced by numCols(), operator=(), and resize().

◆ mNumRows

size_t CSparseMatrix::mNumRows
private

Referenced by numRows(), operator=(), and resize().

◆ mRowIndex

std::vector< size_t > CSparseMatrix::mRowIndex
private

Referenced by insert(), operator=(), and resize().

◆ mRows

std::vector< std::vector< CSparseMatrixElement *> > CSparseMatrix::mRows
private

◆ mSearchCol

size_t CSparseMatrix::mSearchCol
private

Referenced by insert(), operator()(), and remove().

◆ mSearchRow

size_t CSparseMatrix::mSearchRow
private

Referenced by insert(), operator()(), and remove().

◆ mThreshold

C_FLOAT64 CSparseMatrix::mThreshold
private

Referenced by getTreshold(), operator=(), and setTreshold().


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