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

#include <CMatrix.h>

Public Types

typedef Matrix::elementType elementType
 

Public Member Functions

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

Private Attributes

const Matrix & mA
 
elementType mUnit
 
elementType mZero
 

Friends

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

Detailed Description

template<class Matrix>
class CUnitUpperTriangularView< Matrix >

Definition at line 50 of file CMatrix.h.

Member Typedef Documentation

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

Definition at line 605 of file CMatrix.h.

Constructor & Destructor Documentation

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

Definition at line 613 of file CMatrix.h.

615  :
616  mA(A),
617  mZero(zero),
618  mUnit(unit)
619  {}
const Matrix & mA
Definition: CMatrix.h:608
template<class Matrix>
CUnitUpperTriangularView< Matrix >::~CUnitUpperTriangularView ( )
inline

Definition at line 621 of file CMatrix.h.

621 {}

Member Function Documentation

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

The number of columns of the matrix

Returns
size_t cols

Definition at line 633 of file CMatrix.h.

References CUnitUpperTriangularView< Matrix >::mA.

Referenced by operator<<().

633 {return mA.numCols();}
const Matrix & mA
Definition: CMatrix.h:608
template<class Matrix>
size_t CUnitUpperTriangularView< Matrix >::numRows ( ) const
inline

The number of rows of the matrix.

Returns
size_t rows

Definition at line 627 of file CMatrix.h.

References CUnitUpperTriangularView< Matrix >::mA.

Referenced by operator<<().

627 {return mA.numRows();}
const Matrix & mA
Definition: CMatrix.h:608
template<class Matrix>
elementType CUnitUpperTriangularView< 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 641 of file CMatrix.h.

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

643  {
644  if (row < col)
645  return mA(row, col);
646  else if (row > col)
647  return mZero;
648  else
649  return mUnit;
650  }
const Matrix & mA
Definition: CMatrix.h:608

Friends And Related Function Documentation

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

Output stream operator

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

Definition at line 866 of file CMatrix.h.

868 {
869  size_t i, imax = A.numRows();
870  size_t j, jmax = A.numCols();
871  os << "Matrix(" << imax << "x" << jmax << ")" << std::endl;
872 
873  for (i = 0; i < imax; i++)
874  {
875  for (j = 0; j < jmax; j++)
876  os << "\t" << A(i, j);
877 
878  os << std::endl;
879  }
880 
881  return os;
882 }
size_t numCols() const
Definition: CMatrix.h:633
size_t numRows() const
Definition: CMatrix.h:627

Member Data Documentation

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

Definition at line 610 of file CMatrix.h.

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

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

Definition at line 609 of file CMatrix.h.

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


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