CompoundMatrix Class Reference

#include <IpCompoundMatrix.hpp>

Inheritance diagram for CompoundMatrix:

Matrix TaggedObject ReferencedObject Subject

List of all members.


Detailed Description

Class for Matrices consisting of other matrices.

This matrix is a matrix that consists of zero, one or more Matrices's which are arranged like this: $ M_{\rm compound} = \left(\begin{array}{cccc}M_{00} & M_{01} & \ldots & M_{0,{\rm ncomp\_cols}-1} \\ \dots &&&\dots \\ M_{{\rm ncomp\_rows}-1,0} & M_{{\rm ncomp\_rows}-1,1} & \dots & M_{{\rm ncomp\_rows}-1,{\rm ncomp\_cols}-1}\end{array}\right)$. The individual components can be associated to different MatrixSpaces. The individual components can also be const and non-const Matrices. If a component is not set (i.e., it's pointer is NULL), then this components is treated like a zero-matrix of appropriate dimensions.

Public Member Functions

void SetComp (Index irow, Index jcol, const Matrix &matrix)
 Method for setting an individual component at position (irow, icol) in the compound matrix.
void SetCompNonConst (Index irow, Index jcol, Matrix &matrix)
 Method to set a non-const Matrix entry.
void CreateBlockFromSpace (Index irow, Index jcol)
 Method to create a new matrix from the space for this block.
SmartPtr< const MatrixGetComp (Index irow, Index jcol) const
 Method for retrieving one block from the compound matrix as a const Matrix.
SmartPtr< MatrixGetCompNonConst (Index irow, Index jcol)
 Method for retrieving one block from the compound matrix as a non-const Matrix.
Index NComps_Rows () const
 Number of block rows of this compound matrix.
Index NComps_Cols () const
 Number of block colmuns of this compound matrix.
Constructors / Destructors
 CompoundMatrix (const CompoundMatrixSpace *owner_space)
 Constructor, taking the owner_space.
 ~CompoundMatrix ()
 Destructor.

Protected Member Functions

Methods overloaded from Matrix
virtual void MultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const
 X = beta*X + alpha*(Matrix S^{-1} Z).
virtual void TransMultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const
 X = beta*X + alpha*(Matrix S^{-1} Z).
virtual void AddMSinvZImpl (Number alpha, const Vector &S, const Vector &Z, Vector &X) const
 X = beta*X + alpha*(Matrix S^{-1} Z).
virtual void SinvBlrmZMTdBrImpl (Number alpha, const Vector &S, const Vector &R, const Vector &Z, const Vector &D, Vector &X) const
 X = S^{-1} (r + alpha*Z*M^Td).
virtual bool HasValidNumbersImpl () const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void PrintImpl (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
 X = beta*X + alpha*(Matrix S^{-1} Z).


Constructor & Destructor Documentation

CompoundMatrix ( const CompoundMatrixSpace owner_space  ) 

Constructor, taking the owner_space.

The owner_space has to be defined, so that at each block row and column contain at least one non-NULL component. The individual components can be set afterwards with the SeteComp and SetCompNonConst methods.

References CompoundMatrix::NComps_Cols(), and CompoundMatrix::NComps_Rows().

~CompoundMatrix (  ) 

Destructor.


Member Function Documentation

void SetComp ( Index  irow,
Index  jcol,
const Matrix matrix 
)

Method for setting an individual component at position (irow, icol) in the compound matrix.

The counting of indices starts at 0.

References DBG_ASSERT, CompoundMatrixSpace::GetCompSpace(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), and TaggedObject::ObjectChanged().

void SetCompNonConst ( Index  irow,
Index  jcol,
Matrix matrix 
)

void CreateBlockFromSpace ( Index  irow,
Index  jcol 
)

SmartPtr<const Matrix> GetComp ( Index  irow,
Index  jcol 
) const [inline]

Method for retrieving one block from the compound matrix as a const Matrix.

Referenced by LimMemQuasiNewtonUpdater::UpdateHessian().

SmartPtr<Matrix> GetCompNonConst ( Index  irow,
Index  jcol 
) [inline]

Method for retrieving one block from the compound matrix as a non-const Matrix.

Note that calling this method with mark the CompoundMatrix as changed. Therefore, only use this method if you are intending to change the Matrix that you receive.

References TaggedObject::ObjectChanged().

Index NComps_Rows (  )  const [inline]

Index NComps_Cols (  )  const [inline]

void MultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const [protected, virtual]

void TransMultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const [protected, virtual]

void AddMSinvZImpl ( Number  alpha,
const Vector S,
const Vector Z,
Vector X 
) const [protected, virtual]

void SinvBlrmZMTdBrImpl ( Number  alpha,
const Vector S,
const Vector R,
const Vector Z,
const Vector D,
Vector X 
) const [protected, virtual]

bool HasValidNumbersImpl (  )  const [protected, virtual]

Method for determining if all stored numbers are valid (i.e., no Inf or Nan).

Reimplemented from Matrix.

References DBG_ASSERT, CompoundMatrixSpace::Diagonal(), Matrix::HasValidNumbers(), CompoundMatrix::NComps_Cols(), and CompoundMatrix::NComps_Rows().

void PrintImpl ( const Journalist jnlst,
EJournalLevel  level,
EJournalCategory  category,
const std::string &  name,
Index  indent,
const std::string &  prefix 
) const [protected, virtual]

X = beta*X + alpha*(Matrix S^{-1} Z).

Specialized implementation.

Implements Matrix.

References DBG_ASSERT, CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), Matrix::Print(), Journalist::Printf(), and Journalist::PrintfIndented().


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

Generated on Fri Sep 26 07:44:25 2008 for SimTKcore by  doxygen 1.5.6