#include <IpMatrix.hpp>
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 | |
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 |
Number of rows. | |
Protected Member Functions | |
implementation methods (derived classes MUST | |
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. | |
Private Member Functions | |
Default Compiler Generated Methods | |
Matrix () | |
default constructor | |
Matrix (const Matrix &) | |
Copy constructor. | |
Matrix & | operator= (const Matrix &) |
Overloaded Equals Operator. | |
Private Attributes | |
const SmartPtr< const MatrixSpace > | owner_space_ |
CachedResults data members | |
TaggedObject::Tag | valid_cache_tag_ |
bool | cached_valid_ |
Matrix Base Class.
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.
Definition at line 27 of file IpMatrix.hpp.
Ipopt::Matrix::Matrix | ( | const MatrixSpace * | owner_space | ) | [inline] |
Constructor.
It has to be given a pointer to the corresponding MatrixSpace.
Definition at line 35 of file IpMatrix.hpp.
virtual Ipopt::Matrix::~Matrix | ( | ) | [inline, virtual] |
Destructor.
Definition at line 43 of file IpMatrix.hpp.
Ipopt::Matrix::Matrix | ( | ) | [private] |
default constructor
Ipopt::Matrix::Matrix | ( | const Matrix & | ) | [private] |
Copy constructor.
void Ipopt::Matrix::MultVector | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [inline] |
Matrix-vector multiply.
Computes y = alpha * Matrix * x + beta * y. Do not overload. Overload MultVectorImpl instead.
Definition at line 52 of file IpMatrix.hpp.
void Ipopt::Matrix::TransMultVector | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [inline] |
Matrix(transpose) vector multiply.
Computes y = alpha * Matrix^T * x + beta * y. Do not overload. Overload TransMultVectorImpl instead.
Definition at line 62 of file IpMatrix.hpp.
void Ipopt::Matrix::AddMSinvZ | ( | Number | alpha, | |
const Vector & | S, | |||
const Vector & | Z, | |||
Vector & | X | |||
) | const |
X = X + alpha*(Matrix S^{-1} Z).
Should be implemented efficiently for the ExansionMatrix
void Ipopt::Matrix::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
bool Ipopt::Matrix::HasValidNumbers | ( | ) | const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Index Matrix::NRows | ( | ) | const [inline] |
Number of rows.
Definition at line 276 of file IpMatrix.hpp.
Index Matrix::NCols | ( | ) | const [inline] |
Number of columns.
Definition at line 282 of file IpMatrix.hpp.
virtual void Ipopt::Matrix::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.
virtual void Ipopt::Matrix::Print | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent = 0 , |
|||
const std::string & | prefix = "" | |||
) | const [virtual] |
Number of rows.
SmartPtr< const MatrixSpace > Matrix::OwnerSpace | ( | ) | const [inline] |
Return the owner MatrixSpace.
Definition at line 288 of file IpMatrix.hpp.
virtual void Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::ZeroMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
virtual void Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::DenseGenMatrix, Ipopt::ExpansionMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SymMatrix, Ipopt::ZeroMatrix, and Ipopt::GenTMatrix.
virtual void Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, and Ipopt::ScaledMatrix.
virtual void Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::ExpansionMatrix, and Ipopt::ScaledMatrix.
virtual bool Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
Definition at line 154 of file IpMatrix.hpp.
virtual void Ipopt::Matrix::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 Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::ZeroMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
Overloaded Equals Operator.
Reimplemented from Ipopt::TaggedObject.
Reimplemented in Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::ZeroMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
const SmartPtr<const MatrixSpace> Ipopt::Matrix::owner_space_ [private] |
Reimplemented in Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::ExpansionMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymMatrix, Ipopt::SymScaledMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
Definition at line 187 of file IpMatrix.hpp.
TaggedObject::Tag Ipopt::Matrix::valid_cache_tag_ [mutable, private] |
Definition at line 191 of file IpMatrix.hpp.
bool Ipopt::Matrix::cached_valid_ [mutable, private] |
Definition at line 192 of file IpMatrix.hpp.