#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 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). | |
Information about the size of the matrix | |
Index | NRows () const |
Number of rows. | |
Index | NCols () const |
Number of columns. | |
Norms of the individual rows and columns | |
void | ComputeRowAMax (Vector &rows_norms, bool init=true) const |
Compute the max-norm of the rows in the matrix. | |
void | ComputeColAMax (Vector &cols_norms, bool init=true) const |
Compute the max-norm of the columns in the matrix. | |
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 |
Public Member Functions inherited from Ipopt::TaggedObject | |
TaggedObject () | |
Constructor. | |
virtual | ~TaggedObject () |
Destructor. | |
Tag | GetTag () const |
Users of TaggedObjects call this to update their own internal tags every time they perform the expensive operation. | |
bool | HasChanged (const Tag comparison_tag) const |
Users of TaggedObjects call this to check if the object HasChanged since they last updated their own internal tag. | |
Public Member Functions inherited from Ipopt::ReferencedObject | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Public Member Functions inherited from Ipopt::Subject | |
Subject () | |
Default Constructor. | |
virtual | ~Subject () |
Destructor. | |
void | AttachObserver (Observer::NotifyType notify_type, Observer *observer) const |
Attach the specified observer (i.e., begin receiving notifications). | |
void | DetachObserver (Observer::NotifyType notify_type, Observer *observer) const |
Detach the specified observer (i.e., no longer receive notifications). | |
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 | ComputeRowAMaxImpl (Vector &rows_norms, bool init) const =0 |
Compute the max-norm of the rows in the matrix. | |
virtual void | ComputeColAMaxImpl (Vector &cols_norms, bool init) const =0 |
Compute the max-norm of the columns in the matrix. | |
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. | |
Protected Member Functions inherited from Ipopt::TaggedObject | |
void | ObjectChanged () |
Objects derived from TaggedObject MUST call this method every time their internal state changes to update the internal tag for comparison. | |
Protected Member Functions inherited from Ipopt::Subject | |
void | Notify (Observer::NotifyType notify_type) const |
Private Member Functions | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
Matrix () | |
Default constructor. | |
Matrix (const Matrix &) | |
Copy constructor. | |
Matrix & | operator= (const Matrix &) |
Default Assignment Operator. | |
Private Attributes | |
const SmartPtr< const MatrixSpace > | owner_space_ |
CachedResults data members | |
TaggedObject::Tag | valid_cache_tag_ |
bool | cached_valid_ |
Additional Inherited Members | |
Public Types inherited from Ipopt::TaggedObject | |
typedef unsigned int | Tag |
Type for the Tag values. | |
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.
|
inline |
Constructor.
It has to be given a pointer to the corresponding MatrixSpace.
Definition at line 36 of file IpMatrix.hpp.
|
inlinevirtual |
Destructor.
Definition at line 45 of file IpMatrix.hpp.
|
private |
Default constructor.
|
inline |
Matrix-vector multiply.
Computes y = alpha * Matrix * x + beta * y.
Definition at line 57 of file IpMatrix.hpp.
|
inline |
Matrix(transpose) vector multiply.
Computes y = alpha * Matrix^T * x + beta * y.
Definition at line 73 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 ExpansionMatrix.
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 ExpansionMatrix.
bool Ipopt::Matrix::HasValidNumbers | ( | ) | const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
|
inline |
Number of rows.
Definition at line 401 of file IpMatrix.hpp.
|
inline |
Number of columns.
Definition at line 406 of file IpMatrix.hpp.
Compute the max-norm of the rows in the matrix.
The result is stored in rows_norms. The vector is assumed to be initialized if init is false.
Definition at line 134 of file IpMatrix.hpp.
Compute the max-norm of the columns in the matrix.
The result is stored in cols_norms. The vector is assumed to be initialized if init is false.
Definition at line 152 of file IpMatrix.hpp.
|
virtual |
Print detailed information about the matrix.
|
virtual |
|
inline |
Return the owner MatrixSpace.
Definition at line 411 of file IpMatrix.hpp.
|
protectedpure virtual |
Matrix-vector multiply.
Computes y = alpha * Matrix * x + beta * y.
Implemented in Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::TransposeMatrix, Ipopt::ZeroMatrix, Ipopt::ZeroSymMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
|
protectedpure virtual |
Matrix(transpose) vector multiply.
Computes y = alpha * Matrix^T * x + beta * y.
Implemented in Ipopt::CompoundMatrix, Ipopt::DenseGenMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ExpansionMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SymMatrix, Ipopt::TransposeMatrix, Ipopt::ZeroMatrix, Ipopt::ZeroSymMatrix, and Ipopt::GenTMatrix.
|
protectedvirtual |
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.
|
protectedvirtual |
X = S^{-1} (r + alpha*Z*M^Td).
Should be implemented efficiently for the ExpansionMatrix.
Reimplemented in Ipopt::CompoundMatrix, Ipopt::ExpansionMatrix, and Ipopt::ScaledMatrix.
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::ExpandedMultiVectorMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::TransposeMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
Definition at line 250 of file IpMatrix.hpp.
|
protectedpure virtual |
Compute the max-norm of the rows in the matrix.
The result is stored in rows_norms. The vector is assumed to be initialized if init is false.
Implemented in Ipopt::ZeroMatrix, Ipopt::ZeroSymMatrix, Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::TransposeMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
|
protectedpure virtual |
Compute the max-norm of the columns in the matrix.
The result is stored in cols_norms. The vector is assumed to be initialized if init is false.
Implemented in Ipopt::ZeroMatrix, Ipopt::ZeroSymMatrix, Ipopt::CompoundMatrix, Ipopt::DenseGenMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ExpansionMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymMatrix, Ipopt::GenTMatrix, and Ipopt::TransposeMatrix.
|
protectedpure virtual |
Print detailed information about the matrix.
Implemented in Ipopt::CompoundMatrix, Ipopt::CompoundSymMatrix, Ipopt::DenseGenMatrix, Ipopt::DenseSymMatrix, Ipopt::DiagMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ExpansionMatrix, Ipopt::IdentityMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::MultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, Ipopt::SymScaledMatrix, Ipopt::TransposeMatrix, Ipopt::ZeroMatrix, Ipopt::ZeroSymMatrix, Ipopt::GenTMatrix, and Ipopt::SymTMatrix.
|
private |
Definition at line 308 of file IpMatrix.hpp.
|
mutableprivate |
Definition at line 312 of file IpMatrix.hpp.
|
mutableprivate |
Definition at line 313 of file IpMatrix.hpp.