COPASI API  4.16.103
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CSparseMatrixElement Class Reference

#include <CSparseMatrix.h>

Collaboration diagram for CSparseMatrixElement:
Collaboration graph
[legend]

Public Member Functions

const size_t & col () const
 
 CSparseMatrixElement (CSparseMatrix &matrix, const size_t &rowIndex, const size_t &colIndex, const C_FLOAT64 &value)
 
 operator const C_FLOAT64 & () const
 
const C_FLOAT64operator= (const C_FLOAT64 &value)
 
const size_t & row () const
 
 ~CSparseMatrixElement ()
 

Static Public Member Functions

static bool compareCol (const CSparseMatrixElement *pLhs, const CSparseMatrixElement *pRhs)
 
static bool compareRow (const CSparseMatrixElement *pLhs, const CSparseMatrixElement *pRhs)
 

Private Member Functions

 CSparseMatrixElement ()
 

Private Attributes

const size_t & mCol
 
CSparseMatrixmMatrix
 
const size_t & mRow
 
C_FLOAT64 mValue
 

Detailed Description

Definition at line 34 of file CSparseMatrix.h.

Constructor & Destructor Documentation

CSparseMatrixElement::CSparseMatrixElement ( )
private
CSparseMatrixElement::CSparseMatrixElement ( CSparseMatrix matrix,
const size_t &  rowIndex,
const size_t &  colIndex,
const C_FLOAT64 value 
)

Definition at line 43 of file CSparseMatrix.cpp.

46  :
47  mMatrix(matrix),
48  mRow(row),
49  mCol(col),
50  mValue(value)
51 {}
const size_t & col() const
CSparseMatrix & mMatrix
Definition: CSparseMatrix.h:61
const size_t & mRow
Definition: CSparseMatrix.h:62
const size_t & row() const
const size_t & mCol
Definition: CSparseMatrix.h:63
CSparseMatrixElement::~CSparseMatrixElement ( )

Definition at line 53 of file CSparseMatrix.cpp.

54 {}

Member Function Documentation

const size_t & CSparseMatrixElement::col ( ) const

Definition at line 74 of file CSparseMatrix.cpp.

References mCol.

74 {return mCol;}
const size_t & mCol
Definition: CSparseMatrix.h:63
bool CSparseMatrixElement::compareCol ( const CSparseMatrixElement pLhs,
const CSparseMatrixElement pRhs 
)
static

Definition at line 39 of file CSparseMatrix.cpp.

References mCol.

Referenced by CSparseMatrix::insert(), CSparseMatrix::operator=(), and CSparseMatrix::remove().

41 {return pLhs->mCol < pRhs->mCol;}
const size_t & mCol
Definition: CSparseMatrix.h:63
bool CSparseMatrixElement::compareRow ( const CSparseMatrixElement pLhs,
const CSparseMatrixElement pRhs 
)
static

Definition at line 35 of file CSparseMatrix.cpp.

References mRow.

Referenced by CSparseMatrix::insert(), CSparseMatrix::operator()(), CSparseMatrix::operator=(), and CSparseMatrix::remove().

37 {return pLhs->mRow < pRhs->mRow;}
const size_t & mRow
Definition: CSparseMatrix.h:62
CSparseMatrixElement::operator const C_FLOAT64 & ( ) const

Definition at line 70 of file CSparseMatrix.cpp.

71 {return mValue;}
const C_FLOAT64 & CSparseMatrixElement::operator= ( const C_FLOAT64 value)

Definition at line 56 of file CSparseMatrix.cpp.

References CSparseMatrix::getTreshold(), CSparseMatrix::insert(), mCol, mMatrix, mRow, mValue, and CSparseMatrix::remove().

57 {
58  if (fabs(value) < mMatrix.getTreshold() &&
59  fabs(mValue) >= mMatrix.getTreshold())
61  else if (fabs(value) >= mMatrix.getTreshold() &&
62  fabs(mValue) < mMatrix.getTreshold())
63  mMatrix.insert(mRow, mCol, value);
64  else
65  mValue = value;
66 
67  return value;
68 }
const C_FLOAT64 & getTreshold() const
CSparseMatrix & mMatrix
Definition: CSparseMatrix.h:61
const size_t & mRow
Definition: CSparseMatrix.h:62
bool remove(const size_t &row, const size_t &col)
bool insert(const size_t &row, const size_t &col, const C_FLOAT64 &value)
const size_t & mCol
Definition: CSparseMatrix.h:63
const size_t & CSparseMatrixElement::row ( ) const

Definition at line 73 of file CSparseMatrix.cpp.

References mRow.

73 {return mRow;}
const size_t & mRow
Definition: CSparseMatrix.h:62

Member Data Documentation

const size_t& CSparseMatrixElement::mCol
private

Definition at line 63 of file CSparseMatrix.h.

Referenced by col(), compareCol(), and operator=().

CSparseMatrix& CSparseMatrixElement::mMatrix
private

Definition at line 61 of file CSparseMatrix.h.

Referenced by operator=().

const size_t& CSparseMatrixElement::mRow
private

Definition at line 62 of file CSparseMatrix.h.

Referenced by compareRow(), operator=(), and row().

C_FLOAT64 CSparseMatrixElement::mValue
private

Definition at line 64 of file CSparseMatrix.h.

Referenced by operator=().


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