#include <IpMatrix.hpp>
This is the base class for all derived matrix types. All Matrices, such as Jacobian and Hessian matrices, as well as possibly the iteration matrices needed for the step computation, are of this type.
Deriving from Matrix: Overload the protected XXX_Impl method.
Public Member Functions | |
bool | HasValidNumbers () const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
SmartPtr< const MatrixSpace > | OwnerSpace () const |
Return the owner MatrixSpace. | |
Constructor/Destructor | |
Matrix (const MatrixSpace *owner_space) | |
Constructor. | |
virtual | ~Matrix () |
Destructor. | |
Operations of the Matrix on a Vector | |
void | MultVector (Number alpha, const Vector &x, Number beta, Vector &y) const |
Matrix-vector multiply. | |
void | TransMultVector (Number alpha, const Vector &x, Number beta, Vector &y) const |
Matrix(transpose) vector multiply. | |
Methods for specialized operations. A prototype | |
implementation is provided, but for efficient implementation those should be specially implemented. | |
void | AddMSinvZ (Number alpha, const Vector &S, const Vector &Z, Vector &X) const |
X = X + alpha*(Matrix S^{-1} Z). | |
void | SinvBlrmZMTdBr (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). | |
Index | NRows () const |
Number of rows. | |
Index | NCols () const |
Number of columns. | |
virtual void | Print (SmartPtr< const Journalist > jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const |
Print detailed information about the matrix. | |
virtual void | Print (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const |
Print detailed information about the matrix. | |
Protected Member Functions | |
implementation methods (derived classes MUST | |
overload these pure virtual protected methods. | |
virtual void | MultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const =0 |
Matrix-vector multiply. | |
virtual void | TransMultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const =0 |
Matrix(transpose) vector multiply. | |
virtual void | AddMSinvZImpl (Number alpha, const Vector &S, const Vector &Z, Vector &X) const |
X = 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 =0 |
Print detailed information about the matrix. |
Matrix | ( | const MatrixSpace * | owner_space | ) | [inline] |
Constructor.
It has to be given a pointer to the corresponding MatrixSpace.
~Matrix | ( | ) | [inline, virtual] |
Destructor.
Matrix-vector multiply.
Computes y = alpha * Matrix * x + beta * y. Do not overload. Overload MultVectorImpl instead.
References Matrix::MultVectorImpl().
Referenced by ScaledMatrix::AddMSinvZImpl(), Matrix::AddMSinvZImpl(), MultiVectorMatrix::AddRightMultMatrix(), NLPScalingObject::apply_vector_scaling_d_LU_NonConst(), NLPScalingObject::apply_vector_scaling_x_LU_NonConst(), CompoundSymMatrix::MultVectorImpl(), CompoundMatrix::MultVectorImpl(), DefaultIterateInitializer::push_variables(), SymMatrix::TransMultVectorImpl(), and NLPScalingObject::unapply_vector_scaling_d_LU_NonConst().
Matrix(transpose) vector multiply.
Computes y = alpha * Matrix^T * x + beta * y. Do not overload. Overload TransMultVectorImpl instead.
References Matrix::TransMultVectorImpl().
Referenced by NLPScalingObject::apply_vector_scaling_d_LU_NonConst(), NLPScalingObject::apply_vector_scaling_x_LU_NonConst(), CompoundSymMatrix::MultVectorImpl(), DefaultIterateInitializer::push_variables(), ScaledMatrix::SinvBlrmZMTdBrImpl(), Matrix::SinvBlrmZMTdBrImpl(), CompoundMatrix::TransMultVectorImpl(), and NLPScalingObject::unapply_vector_scaling_d_LU_NonConst().
X = X + alpha*(Matrix S^{-1} Z).
Should be implemented efficiently for the ExansionMatrix
References Matrix::AddMSinvZImpl().
Referenced by CompoundMatrix::AddMSinvZImpl().
void SinvBlrmZMTdBr | ( | 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).
Should be implemented efficiently for the ExansionMatrix
References Matrix::SinvBlrmZMTdBrImpl().
Referenced by CompoundMatrix::SinvBlrmZMTdBrImpl().
bool HasValidNumbers | ( | ) | const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
References TaggedObject::GetTag(), and Matrix::HasValidNumbersImpl().
Referenced by SumSymMatrix::HasValidNumbersImpl(), SumMatrix::HasValidNumbersImpl(), CompoundSymMatrix::HasValidNumbersImpl(), and CompoundMatrix::HasValidNumbersImpl().
Index NRows | ( | ) | const [inline] |
Number of rows.
Referenced by DenseGenMatrix::AddMatrixProduct(), IdentityMatrix::AddMSinvZImpl(), ExpansionMatrix::AddMSinvZImpl(), MultiVectorMatrix::AddOneMultiVectorMatrix(), MultiVectorMatrix::AddRightMultMatrix(), DenseGenMatrix::CholeskyBackSolveMatrix(), DenseGenMatrix::CholeskySolveMatrix(), DenseGenMatrix::CholeskySolveVector(), DenseGenMatrix::ComputeCholeskyFactor(), DenseGenMatrix::ComputeEigenVectors(), DenseGenMatrix::Copy(), IdentityMatrix::Dim(), DenseGenMatrix::FillIdentity(), DenseGenMatrix::HasValidNumbersImpl(), DenseSymMatrix::HighRankUpdate(), DenseGenMatrix::HighRankUpdateTranspose(), MultiVectorMatrix::LRMultVector(), StdAugSystemSolver::MultiSolve(), ZeroMatrix::MultVectorImpl(), SumMatrix::MultVectorImpl(), MultiVectorMatrix::MultVectorImpl(), IdentityMatrix::MultVectorImpl(), GenTMatrix::MultVectorImpl(), ExpansionMatrix::MultVectorImpl(), DenseSymMatrix::MultVectorImpl(), DenseGenMatrix::MultVectorImpl(), ZeroMatrix::PrintImpl(), SymScaledMatrix::PrintImpl(), SumMatrix::PrintImpl(), ScaledMatrix::PrintImpl(), IdentityMatrix::PrintImpl(), DenseSymMatrix::PrintImpl(), DenseGenMatrix::PrintImpl(), DenseGenMatrix::ScaleColumns(), MultiVectorMatrix::ScaleRows(), ExpansionMatrix::SinvBlrmZMTdBrImpl(), DenseSymMatrix::SpecialAddForLMSR1(), ZeroMatrix::TransMultVectorImpl(), SumMatrix::TransMultVectorImpl(), MultiVectorMatrix::TransMultVectorImpl(), GenTMatrix::TransMultVectorImpl(), ExpansionMatrix::TransMultVectorImpl(), and DenseGenMatrix::TransMultVectorImpl().
Index NCols | ( | ) | const [inline] |
Number of columns.
Referenced by DenseGenMatrix::AddMatrixProduct(), IdentityMatrix::AddMSinvZImpl(), ExpansionMatrix::AddMSinvZImpl(), MultiVectorMatrix::AddOneMultiVectorMatrix(), MultiVectorMatrix::AddRightMultMatrix(), DenseGenMatrix::CholeskyBackSolveMatrix(), DenseGenMatrix::CholeskySolveMatrix(), DenseGenMatrix::CholeskySolveVector(), DenseGenMatrix::ComputeCholeskyFactor(), DenseGenMatrix::ComputeEigenVectors(), DenseGenMatrix::Copy(), IdentityMatrix::Dim(), DenseGenMatrix::FillIdentity(), MultiVectorMatrix::FillWithNewVectors(), TNLPAdapter::GetBoundsInformation(), TripletHelper::GetNumberEntries(), MultiVectorMatrix::HasValidNumbersImpl(), DenseGenMatrix::HasValidNumbersImpl(), DenseSymMatrix::HighRankUpdate(), DenseSymMatrix::HighRankUpdateTranspose(), DenseGenMatrix::HighRankUpdateTranspose(), MultiVectorMatrix::LRMultVector(), StdAugSystemSolver::MultiSolve(), ZeroMatrix::MultVectorImpl(), SumMatrix::MultVectorImpl(), MultiVectorMatrix::MultVectorImpl(), IdentityMatrix::MultVectorImpl(), GenTMatrix::MultVectorImpl(), ExpansionMatrix::MultVectorImpl(), DenseSymMatrix::MultVectorImpl(), DenseGenMatrix::MultVectorImpl(), ZeroMatrix::PrintImpl(), SymScaledMatrix::PrintImpl(), SumMatrix::PrintImpl(), ScaledMatrix::PrintImpl(), MultiVectorMatrix::PrintImpl(), IdentityMatrix::PrintImpl(), ExpansionMatrix::PrintImpl(), DenseSymMatrix::PrintImpl(), DenseGenMatrix::PrintImpl(), MultiVectorMatrix::ScaleColumns(), DenseGenMatrix::ScaleColumns(), MultiVectorMatrix::ScaleRows(), MultiVectorMatrix::SetVector(), MultiVectorMatrix::SetVectorNonConst(), ExpansionMatrix::SinvBlrmZMTdBrImpl(), DenseSymMatrix::SpecialAddForLMSR1(), ZeroMatrix::TransMultVectorImpl(), SumMatrix::TransMultVectorImpl(), MultiVectorMatrix::TransMultVectorImpl(), GenTMatrix::TransMultVectorImpl(), ExpansionMatrix::TransMultVectorImpl(), and DenseGenMatrix::TransMultVectorImpl().
void Print | ( | SmartPtr< const Journalist > | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent = 0 , |
|||
const std::string & | prefix = "" | |||
) | const [virtual] |
Print detailed information about the matrix.
Do not overload. Overload PrintImpl instead.
References Ipopt::IsValid(), and Matrix::PrintImpl().
Referenced by CompoundSymMatrix::PrintImpl(), and CompoundMatrix::PrintImpl().
void Print | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent = 0 , |
|||
const std::string & | prefix = "" | |||
) | const [virtual] |
Print detailed information about the matrix.
Do not overload. Overload PrintImpl instead.
References Matrix::PrintImpl(), and Journalist::ProduceOutput().
SmartPtr< const MatrixSpace > OwnerSpace | ( | ) | const [inline] |
Return the owner MatrixSpace.
Referenced by MatrixSpace::IsMatrixFromSpace(), and StdAugSystemSolver::MultiSolve().
virtual void MultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, pure virtual] |
Matrix-vector multiply.
Computes y = alpha * Matrix * x + beta * y
Implemented in CompoundMatrix, CompoundSymMatrix, DenseGenMatrix, DenseSymMatrix, DiagMatrix, ExpansionMatrix, GenTMatrix, IdentityMatrix, LowRankUpdateSymMatrix, MultiVectorMatrix, ScaledMatrix, SumMatrix, SumSymMatrix, SymScaledMatrix, SymTMatrix, and ZeroMatrix.
Referenced by Matrix::MultVector().
virtual void TransMultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, pure virtual] |
Matrix(transpose) vector multiply.
Computes y = alpha * Matrix^T * x + beta * y
Implemented in CompoundMatrix, DenseGenMatrix, ExpansionMatrix, GenTMatrix, MultiVectorMatrix, ScaledMatrix, SumMatrix, SymMatrix, and ZeroMatrix.
Referenced by Matrix::TransMultVector().
void AddMSinvZImpl | ( | Number | alpha, | |
const Vector & | S, | |||
const Vector & | Z, | |||
Vector & | X | |||
) | const [protected, virtual] |
X = X + alpha*(Matrix S^{-1} Z).
Prototype for this specialize method is provided, but for efficient implementation it should be overloaded for the expansion matrix.
Reimplemented in CompoundMatrix, ExpansionMatrix, IdentityMatrix, and ScaledMatrix.
References Vector::MakeNew(), and Matrix::MultVector().
Referenced by Matrix::AddMSinvZ(), and ExpansionMatrix::AddMSinvZImpl().
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).
Should be implemented efficiently for the ExpansionMatrix.
Reimplemented in CompoundMatrix, ExpansionMatrix, and ScaledMatrix.
References Vector::Axpy(), Vector::ElementWiseDivide(), Vector::ElementWiseMultiply(), and Matrix::TransMultVector().
Referenced by Matrix::SinvBlrmZMTdBr(), ExpansionMatrix::SinvBlrmZMTdBrImpl(), and CompoundMatrix::SinvBlrmZMTdBrImpl().
virtual bool HasValidNumbersImpl | ( | ) | const [inline, protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
A default implementation always returning true is provided, but if possible it should be implemented.
Reimplemented in CompoundMatrix, CompoundSymMatrix, DenseGenMatrix, DenseSymMatrix, DiagMatrix, GenTMatrix, IdentityMatrix, LowRankUpdateSymMatrix, MultiVectorMatrix, ScaledMatrix, SumMatrix, SumSymMatrix, SymScaledMatrix, and SymTMatrix.
Referenced by Matrix::HasValidNumbers().
virtual void PrintImpl | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent, | |||
const std::string & | prefix | |||
) | const [protected, pure virtual] |
Print detailed information about the matrix.
Implemented in CompoundMatrix, CompoundSymMatrix, DenseGenMatrix, DenseSymMatrix, DiagMatrix, ExpansionMatrix, GenTMatrix, IdentityMatrix, LowRankUpdateSymMatrix, MultiVectorMatrix, ScaledMatrix, SumMatrix, SumSymMatrix, SymScaledMatrix, SymTMatrix, and ZeroMatrix.
Referenced by Matrix::Print().