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

#include <CMatrix.h>

Public Types

typedef Matrix::elementType elementType
 

Public Member Functions

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

Private Attributes

const Matrix & mA
 
elementType mUnit
 
elementType mZero
 

Friends

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

Detailed Description

template<class Matrix>
class CUnitLowerTriangularView< Matrix >

Definition at line 55 of file CMatrix.h.

Member Typedef Documentation

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

Definition at line 679 of file CMatrix.h.

Constructor & Destructor Documentation

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

Definition at line 687 of file CMatrix.h.

689  :
690  mA(A),
691  mZero(zero),
692  mUnit(unit)
693  {}
const Matrix & mA
Definition: CMatrix.h:682
template<class Matrix>
CUnitLowerTriangularView< Matrix >::~CUnitLowerTriangularView ( )
inline

Definition at line 695 of file CMatrix.h.

695 {}

Member Function Documentation

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

The number of columns of the matrix

Returns
size_t cols

Definition at line 707 of file CMatrix.h.

References CUnitLowerTriangularView< Matrix >::mA.

Referenced by operator<<().

707 {return mA.numCols();}
const Matrix & mA
Definition: CMatrix.h:682
template<class Matrix>
size_t CUnitLowerTriangularView< Matrix >::numRows ( ) const
inline

The number of rows of the matrix.

Returns
size_t rows

Definition at line 701 of file CMatrix.h.

References CUnitLowerTriangularView< Matrix >::mA.

Referenced by operator<<().

701 {return mA.numRows();}
const Matrix & mA
Definition: CMatrix.h:682
template<class Matrix>
elementType CUnitLowerTriangularView< 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 715 of file CMatrix.h.

References CUnitLowerTriangularView< Matrix >::mA, CUnitLowerTriangularView< Matrix >::mUnit, and CUnitLowerTriangularView< Matrix >::mZero.

717  {
718  if (row > col)
719  return mA(row, col);
720  else if (row < col)
721  return mZero;
722  else
723  return mUnit;
724  }
const Matrix & mA
Definition: CMatrix.h:682

Friends And Related Function Documentation

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

Output stream operator

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

Definition at line 885 of file CMatrix.h.

887 {
888  size_t i, imax = A.numRows();
889  size_t j, jmax = A.numCols();
890  os << "Matrix(" << imax << "x" << jmax << ")" << std::endl;
891 
892  for (i = 0; i < imax; i++)
893  {
894  for (j = 0; j < jmax; j++)
895  os << "\t" << A(i, j);
896 
897  os << std::endl;
898  }
899 
900  return os;
901 }
size_t numCols() const
Definition: CMatrix.h:707
size_t numRows() const
Definition: CMatrix.h:701

Member Data Documentation

template<class Matrix>
const Matrix& CUnitLowerTriangularView< Matrix >::mA
private
template<class Matrix>
elementType CUnitLowerTriangularView< Matrix >::mUnit
private

Definition at line 684 of file CMatrix.h.

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

template<class Matrix>
elementType CUnitLowerTriangularView< Matrix >::mZero
private

Definition at line 683 of file CMatrix.h.

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


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