#include <IpCompoundMatrix.hpp>
This matrix is a matrix that consists of zero, one or more Matrices's which are arranged like this: . 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 Matrix > | GetComp (Index irow, Index jcol) const |
Method for retrieving one block from the compound matrix as a const Matrix. | |
SmartPtr< Matrix > | GetCompNonConst (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). |
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.
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().
Method to set a non-const Matrix entry.
References DBG_ASSERT, CompoundMatrixSpace::GetCompSpace(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), and TaggedObject::ObjectChanged().
Referenced by CompoundMatrix::CreateBlockFromSpace(), and CompoundMatrixSpace::MakeNewCompoundMatrix().
Method to create a new matrix from the space for this block.
References DBG_ASSERT, CompoundMatrixSpace::GetCompSpace(), Ipopt::IsValid(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), and CompoundMatrix::SetCompNonConst().
Method for retrieving one block from the compound matrix as a const Matrix.
Referenced by LimMemQuasiNewtonUpdater::UpdateHessian().
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] |
Number of block rows of this compound matrix.
References CompoundMatrixSpace::NComps_Rows().
Referenced by CompoundMatrix::AddMSinvZImpl(), CompoundMatrix::CompoundMatrix(), CompoundMatrix::CreateBlockFromSpace(), CompoundMatrix::HasValidNumbersImpl(), CompoundMatrix::MultVectorImpl(), CompoundMatrix::PrintImpl(), CompoundMatrix::SetComp(), CompoundMatrix::SetCompNonConst(), CompoundMatrix::SinvBlrmZMTdBrImpl(), and CompoundMatrix::TransMultVectorImpl().
Index NComps_Cols | ( | ) | const [inline] |
Number of block colmuns of this compound matrix.
References CompoundMatrixSpace::NComps_Cols().
Referenced by CompoundMatrix::AddMSinvZImpl(), CompoundMatrix::CompoundMatrix(), CompoundMatrix::CreateBlockFromSpace(), CompoundMatrix::HasValidNumbersImpl(), CompoundMatrix::MultVectorImpl(), CompoundMatrix::PrintImpl(), CompoundMatrix::SetComp(), CompoundMatrix::SetCompNonConst(), CompoundMatrix::SinvBlrmZMTdBrImpl(), and CompoundMatrix::TransMultVectorImpl().
void MultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, virtual] |
X = beta*X + alpha*(Matrix S^{-1} Z).
Specialized implementation.
Implements Matrix.
References DBG_ASSERT, CompoundMatrixSpace::Diagonal(), CompoundVector::GetComp(), CompoundVector::GetCompNonConst(), Ipopt::IsValid(), Matrix::MultVector(), CompoundVector::NComps(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), Vector::Scal(), and Vector::Set().
void TransMultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, virtual] |
X = beta*X + alpha*(Matrix S^{-1} Z).
Specialized implementation.
Implements Matrix.
References DBG_ASSERT, CompoundMatrixSpace::Diagonal(), CompoundVector::GetComp(), CompoundVector::GetCompNonConst(), Ipopt::IsValid(), CompoundVector::NComps(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), Vector::Scal(), Vector::Set(), and Matrix::TransMultVector().
void AddMSinvZImpl | ( | Number | alpha, | |
const Vector & | S, | |||
const Vector & | Z, | |||
Vector & | X | |||
) | const [protected, virtual] |
X = beta*X + alpha*(Matrix S^{-1} Z).
Specialized implementation.
Reimplemented from Matrix.
References Matrix::AddMSinvZ(), DBG_ASSERT, CompoundMatrixSpace::Diagonal(), CompoundVector::GetComp(), CompoundVector::GetCompNonConst(), Ipopt::IsValid(), CompoundVector::NComps(), CompoundMatrix::NComps_Cols(), and CompoundMatrix::NComps_Rows().
void SinvBlrmZMTdBrImpl | ( | Number | alpha, | |
const Vector & | S, | |||
const Vector & | R, | |||
const Vector & | Z, | |||
const Vector & | D, | |||
Vector & | X | |||
) | const [protected, virtual] |
X = S^{-1} (r + alpha*Z*M^Td).
Specialized implementation.
Reimplemented from Matrix.
References DBG_ASSERT, CompoundMatrixSpace::Diagonal(), CompoundVector::GetComp(), CompoundVector::GetCompNonConst(), Ipopt::IsValid(), CompoundVector::NComps(), CompoundMatrix::NComps_Cols(), CompoundMatrix::NComps_Rows(), Matrix::SinvBlrmZMTdBr(), and Matrix::SinvBlrmZMTdBrImpl().
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().