Ipopt  3.12.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
Ipopt::Matrix Class Referenceabstract

Matrix Base Class. More...

#include <IpMatrix.hpp>

+ Inheritance diagram for Ipopt::Matrix:

Public Member Functions

bool HasValidNumbers () const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan). More...
 
SmartPtr< const MatrixSpaceOwnerSpace () const
 Return the owner MatrixSpace. More...
 
Constructor/Destructor
 Matrix (const MatrixSpace *owner_space)
 Constructor. More...
 
virtual ~Matrix ()
 Destructor. More...
 
Operations of the Matrix on a Vector
void MultVector (Number alpha, const Vector &x, Number beta, Vector &y) const
 Matrix-vector multiply. More...
 
void TransMultVector (Number alpha, const Vector &x, Number beta, Vector &y) const
 Matrix(transpose) vector multiply. More...
 
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). More...
 
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). More...
 
Information about the size of the matrix
Index NRows () const
 Number of rows. More...
 
Index NCols () const
 Number of columns. More...
 
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. More...
 
void ComputeColAMax (Vector &cols_norms, bool init=true) const
 Compute the max-norm of the columns in the matrix. More...
 
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. More...
 
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. More...
 
virtual ~TaggedObject ()
 Destructor. More...
 
Tag GetTag () const
 Users of TaggedObjects call this to update their own internal tags every time they perform the expensive operation. More...
 
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. More...
 
- 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. More...
 
virtual ~Subject ()
 Default destructor. More...
 
void AttachObserver (Observer::NotifyType notify_type, Observer *observer) const
 Attach the specified observer (i.e., begin recieving notifications). More...
 
void DetachObserver (Observer::NotifyType notify_type, Observer *observer) const
 Detach the specified observer (i.e., no longer recieve notifications). More...
 

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. More...
 
virtual void TransMultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const =0
 Matrix(transpose) vector multiply. More...
 
virtual void AddMSinvZImpl (Number alpha, const Vector &S, const Vector &Z, Vector &X) const
 X = X + alpha*(Matrix S^{-1} Z). More...
 
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). More...
 
virtual bool HasValidNumbersImpl () const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan). More...
 
virtual void ComputeRowAMaxImpl (Vector &rows_norms, bool init) const =0
 Compute the max-norm of the rows in the matrix. More...
 
virtual void ComputeColAMaxImpl (Vector &cols_norms, bool init) const =0
 Compute the max-norm of the columns in the matrix. More...
 
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. More...
 
- 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. More...
 
- 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 More...
 
 Matrix (const Matrix &)
 Copy constructor. More...
 
Matrixoperator= (const Matrix &)
 Overloaded Equals Operator. More...
 

Private Attributes

const SmartPtr< const MatrixSpaceowner_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. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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 ( )
inlinevirtual

Destructor.

Definition at line 43 of file IpMatrix.hpp.

Ipopt::Matrix::Matrix ( )
private

default constructor

Ipopt::Matrix::Matrix ( const Matrix )
private

Copy constructor.

Member Function Documentation

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 Ipopt::Matrix::NRows ( ) const
inline

Number of rows.

Definition at line 310 of file IpMatrix.hpp.

Index Ipopt::Matrix::NCols ( ) const
inline

Number of columns.

Definition at line 316 of file IpMatrix.hpp.

void Ipopt::Matrix::ComputeRowAMax ( Vector rows_norms,
bool  init = true 
) const
inline

Compute the max-norm of the rows in the matrix.

The result is stored in rows_norms. The vector is assumed to be initialized of init is false.

Definition at line 108 of file IpMatrix.hpp.

void Ipopt::Matrix::ComputeColAMax ( Vector cols_norms,
bool  init = true 
) const
inline

Compute the max-norm of the columns in the matrix.

The result is stored in cols_norms The vector is assumed to be initialized of init is false.

Definition at line 117 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
SmartPtr< const MatrixSpace > Ipopt::Matrix::OwnerSpace ( ) const
inline

Return the owner MatrixSpace.

Definition at line 322 of file IpMatrix.hpp.

virtual void Ipopt::Matrix::MultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const
protectedpure virtual
virtual void Ipopt::Matrix::TransMultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const
protectedpure virtual
virtual void Ipopt::Matrix::AddMSinvZImpl ( Number  alpha,
const Vector S,
const Vector Z,
Vector X 
) const
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::ScaledMatrix, Ipopt::ExpansionMatrix, and Ipopt::IdentityMatrix.

virtual void Ipopt::Matrix::SinvBlrmZMTdBrImpl ( Number  alpha,
const Vector S,
const Vector R,
const Vector Z,
const Vector D,
Vector X 
) const
protectedvirtual

X = S^{-1} (r + alpha*Z*M^Td).

Should be implemented efficiently for the ExpansionMatrix.

Reimplemented in Ipopt::CompoundMatrix, Ipopt::ScaledMatrix, and Ipopt::ExpansionMatrix.

virtual bool Ipopt::Matrix::HasValidNumbersImpl ( ) const
inlineprotectedvirtual

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::DenseGenMatrix, Ipopt::MultiVectorMatrix, Ipopt::SymTMatrix, Ipopt::CompoundMatrix, Ipopt::DenseSymMatrix, Ipopt::LowRankUpdateSymMatrix, Ipopt::GenTMatrix, Ipopt::CompoundSymMatrix, Ipopt::ExpandedMultiVectorMatrix, Ipopt::ScaledMatrix, Ipopt::SymScaledMatrix, Ipopt::IdentityMatrix, Ipopt::TransposeMatrix, Ipopt::SumMatrix, Ipopt::SumSymMatrix, and Ipopt::DiagMatrix.

Definition at line 179 of file IpMatrix.hpp.

virtual void Ipopt::Matrix::ComputeRowAMaxImpl ( Vector rows_norms,
bool  init 
) const
protectedpure virtual
virtual void Ipopt::Matrix::ComputeColAMaxImpl ( Vector cols_norms,
bool  init 
) const
protectedpure virtual
virtual void Ipopt::Matrix::PrintImpl ( const Journalist jnlst,
EJournalLevel  level,
EJournalCategory  category,
const std::string &  name,
Index  indent,
const std::string &  prefix 
) const
protectedpure virtual
Matrix& Ipopt::Matrix::operator= ( const Matrix )
private

Overloaded Equals Operator.

Member Data Documentation

const SmartPtr<const MatrixSpace> Ipopt::Matrix::owner_space_
private

Definition at line 221 of file IpMatrix.hpp.

TaggedObject::Tag Ipopt::Matrix::valid_cache_tag_
mutableprivate

Definition at line 225 of file IpMatrix.hpp.

bool Ipopt::Matrix::cached_valid_
mutableprivate

Definition at line 226 of file IpMatrix.hpp.


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