COPASI API  4.16.103
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
CLowerTriangularView< Matrix > Class Template Reference

#include <CMatrix.h>

Public Types

typedef Matrix::elementType elementType
 

Public Member Functions

 CLowerTriangularView (const Matrix &A, const elementType zero)
 
size_t numCols () const
 
size_t numRows () const
 
elementType operator() (const size_t &row, const size_t &col) const
 
 ~CLowerTriangularView ()
 

Private Attributes

const Matrix & mA
 
elementType mZero
 

Friends

std::ostream & operator<< (std::ostream &os, const CLowerTriangularView< Matrix > &A)
 

Detailed Description

template<class Matrix>
class CLowerTriangularView< Matrix >

Definition at line 40 of file CMatrix.h.

Member Typedef Documentation

template<class Matrix>
typedef Matrix::elementType CLowerTriangularView< Matrix >::elementType

Definition at line 537 of file CMatrix.h.

Constructor & Destructor Documentation

template<class Matrix>
CLowerTriangularView< Matrix >::CLowerTriangularView ( const Matrix &  A,
const elementType  zero 
)
inline

Definition at line 544 of file CMatrix.h.

544  :
545  mA(A),
546  mZero(zero)
547  {}
const Matrix & mA
Definition: CMatrix.h:540
elementType mZero
Definition: CMatrix.h:541
template<class Matrix>
CLowerTriangularView< Matrix >::~CLowerTriangularView ( )
inline

Definition at line 549 of file CMatrix.h.

549 {}

Member Function Documentation

template<class Matrix>
size_t CLowerTriangularView< Matrix >::numCols ( ) const
inline

The number of columns of the matrix

Returns
size_t cols

Definition at line 561 of file CMatrix.h.

References CLowerTriangularView< Matrix >::mA.

Referenced by operator<<().

561 {return mA.numCols();}
const Matrix & mA
Definition: CMatrix.h:540
template<class Matrix>
size_t CLowerTriangularView< Matrix >::numRows ( ) const
inline

The number of rows of the matrix.

Returns
size_t rows

Definition at line 555 of file CMatrix.h.

References CLowerTriangularView< Matrix >::mA.

Referenced by operator<<().

555 {return mA.numRows();}
const Matrix & mA
Definition: CMatrix.h:540
template<class Matrix>
elementType CLowerTriangularView< Matrix >::operator() ( const size_t &  row,
const size_t &  col 
) const
inline

Retrieve a matrix element using the indexing style of the matrix.

Parameters
constsize_t & row
constsize_t & col
Returns
elementType element

Definition at line 569 of file CMatrix.h.

References CLowerTriangularView< Matrix >::mA, and CLowerTriangularView< Matrix >::mZero.

571  {
572  if (row < col)
573  return mZero;
574  else
575  return mA(row, col);
576  }
const Matrix & mA
Definition: CMatrix.h:540
elementType mZero
Definition: CMatrix.h:541

Friends And Related Function Documentation

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

Output stream operator

Parameters
ostream& os
constCLowerTriangularView< Matrix > & A
Returns
ostream & os

Definition at line 847 of file CMatrix.h.

849 {
850  size_t i, imax = A.numRows();
851  size_t j, jmax = A.numCols();
852  os << "Matrix(" << imax << "x" << jmax << ")" << std::endl;
853 
854  for (i = 0; i < imax; i++)
855  {
856  for (j = 0; j < jmax; j++)
857  os << "\t" << A(i, j);
858 
859  os << std::endl;
860  }
861 
862  return os;
863 }
size_t numRows() const
Definition: CMatrix.h:555
size_t numCols() const
Definition: CMatrix.h:561

Member Data Documentation

template<class Matrix>
const Matrix& CLowerTriangularView< Matrix >::mA
private
template<class Matrix>
elementType CLowerTriangularView< Matrix >::mZero
private

Definition at line 541 of file CMatrix.h.

Referenced by CLowerTriangularView< Matrix >::operator()().


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