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

#include <CMatrix.h>

Public Types

typedef Matrix::elementType elementType
 

Public Member Functions

 CUpperTriangularView (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
 
 ~CUpperTriangularView ()
 

Private Attributes

const Matrix & mA
 
elementType mZero
 

Friends

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

Detailed Description

template<class Matrix>
class CUpperTriangularView< Matrix >

Definition at line 45 of file CMatrix.h.

Member Typedef Documentation

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

Definition at line 469 of file CMatrix.h.

Constructor & Destructor Documentation

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

Definition at line 476 of file CMatrix.h.

476  :
477  mA(A),
478  mZero(zero)
479  {}
elementType mZero
Definition: CMatrix.h:473
const Matrix & mA
Definition: CMatrix.h:472
template<class Matrix>
CUpperTriangularView< Matrix >::~CUpperTriangularView ( )
inline

Definition at line 481 of file CMatrix.h.

481 {}

Member Function Documentation

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

The number of columns of the matrix

Returns
size_t cols

Definition at line 493 of file CMatrix.h.

References CUpperTriangularView< Matrix >::mA.

Referenced by operator<<().

493 {return mA.numCols();}
const Matrix & mA
Definition: CMatrix.h:472
template<class Matrix>
size_t CUpperTriangularView< Matrix >::numRows ( ) const
inline

The number of rows of the matrix.

Returns
size_t rows

Definition at line 487 of file CMatrix.h.

References CUpperTriangularView< Matrix >::mA.

Referenced by operator<<().

487 {return mA.numRows();}
const Matrix & mA
Definition: CMatrix.h:472
template<class Matrix>
elementType CUpperTriangularView< 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 501 of file CMatrix.h.

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

503  {
504  if (row > col)
505  return mZero;
506  else
507  return mA(row, col);
508  }
elementType mZero
Definition: CMatrix.h:473
const Matrix & mA
Definition: CMatrix.h:472

Friends And Related Function Documentation

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

Output stream operator

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

Definition at line 828 of file CMatrix.h.

830 {
831  size_t i, imax = A.numRows();
832  size_t j, jmax = A.numCols();
833  os << "Matrix(" << imax << "x" << jmax << ")" << std::endl;
834 
835  for (i = 0; i < imax; i++)
836  {
837  for (j = 0; j < jmax; j++)
838  os << "\t" << A(i, j);
839 
840  os << std::endl;
841  }
842 
843  return os;
844 }
size_t numCols() const
Definition: CMatrix.h:493
size_t numRows() const
Definition: CMatrix.h:487

Member Data Documentation

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

Definition at line 473 of file CMatrix.h.

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


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