Ipopt Documentation  
 
Loading...
Searching...
No Matches
Ipopt::CompoundMatrixSpace Class Reference

This is the matrix space for CompoundMatrix. More...

#include <IpCompoundMatrix.hpp>

+ Inheritance diagram for Ipopt::CompoundMatrixSpace:

Public Member Functions

SmartPtr< const MatrixSpaceGetCompSpace (Index irow, Index jcol) const
 Obtain the component MatrixSpace in block row irow and block column jcol.
 
CompoundMatrixMakeNewCompoundMatrix () const
 Method for creating a new matrix of this specific type.
 
virtual MatrixMakeNew () const
 Pure virtual method for creating a new Matrix of the corresponding type.
 
Constructors / Destructors
 CompoundMatrixSpace (Index ncomps_rows, Index ncomps_cols, Index total_nRows, Index total_nCols)
 Constructor, given the number of row and columns blocks, as well as the totel number of rows and columns.
 
 ~CompoundMatrixSpace ()
 Destructor.
 
Methods for setting information about the components.
void SetBlockRows (Index irow, Index nrows)
 Set the number nrows of rows in row-block number irow.
 
void SetBlockCols (Index jcol, Index ncols)
 Set the number ncols of columns in column-block number jcol.
 
Index GetBlockRows (Index irow) const
 Get the number nrows of rows in row-block number irow.
 
Index GetBlockCols (Index jcol) const
 Set the number ncols of columns in column-block number jcol.
 
void SetCompSpace (Index irow, Index jcol, const MatrixSpace &mat_space, bool auto_allocate=false)
 Set the component MatrixSpace.
 
Accessor methods
Index NComps_Rows () const
 Number of block rows.
 
Index NComps_Cols () const
 Number of block columns.
 
bool Diagonal () const
 True if the blocks lie on the diagonal - can make some operations faster.
 
- Public Member Functions inherited from Ipopt::MatrixSpace
Index NRows () const
 Accessor function for the number of rows.
 
Index NCols () const
 Accessor function for the number of columns.
 
bool IsMatrixFromSpace (const Matrix &matrix) const
 Method to test if a given matrix belongs to a particular matrix space.
 
 MatrixSpace (Index nRows, Index nCols)
 Constructor, given the number rows and columns of all matrices generated by this MatrixSpace.
 
virtual ~MatrixSpace ()
 Destructor.
 
- 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
 

Private Member Functions

bool DimensionsSet () const
 Auxiliary function for debugging to set if all block dimensions have been set.
 
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.

 CompoundMatrixSpace ()
 Default constructor.
 
 CompoundMatrixSpace (const CompoundMatrixSpace &)
 Copy Constructor.
 
CompoundMatrixSpaceoperator= (const CompoundMatrixSpace &)
 Default Assignment Operator.
 

Private Attributes

Index ncomps_rows_
 Number of block rows.
 
Index ncomps_cols_
 Number of block columns.
 
bool dimensions_set_
 Store whether or not the dimensions are valid.
 
std::vector< std::vector< SmartPtr< const MatrixSpace > > > comp_spaces_
 2-dim std::vector of matrix spaces for the components
 
std::vector< std::vector< bool > > allocate_block_
 2-dim std::vector of booleans deciding whether to allocate a new matrix for the blocks automagically
 
std::vector< Indexblock_rows_
 Vector of the number of rows in each comp column.
 
std::vector< Indexblock_cols_
 Vector of the number of cols in each comp row.
 
bool diagonal_
 true if the CompoundMatrixSpace only has Matrix spaces along the diagonal.
 

Detailed Description

This is the matrix space for CompoundMatrix.

Before a CompoundMatrix can be created, at least one MatrixSpace has to be set per block row and column. Individual component MatrixSpace's can be set with the SetComp method.

Definition at line 222 of file IpCompoundMatrix.hpp.

Constructor & Destructor Documentation

◆ CompoundMatrixSpace() [1/3]

Ipopt::CompoundMatrixSpace::CompoundMatrixSpace ( Index  ncomps_rows,
Index  ncomps_cols,
Index  total_nRows,
Index  total_nCols 
)

Constructor, given the number of row and columns blocks, as well as the totel number of rows and columns.

◆ ~CompoundMatrixSpace()

Ipopt::CompoundMatrixSpace::~CompoundMatrixSpace ( )
inline

Destructor.

Definition at line 238 of file IpCompoundMatrix.hpp.

◆ CompoundMatrixSpace() [2/3]

Ipopt::CompoundMatrixSpace::CompoundMatrixSpace ( )
private

Default constructor.

◆ CompoundMatrixSpace() [3/3]

Ipopt::CompoundMatrixSpace::CompoundMatrixSpace ( const CompoundMatrixSpace )
private

Copy Constructor.

Member Function Documentation

◆ SetBlockRows()

void Ipopt::CompoundMatrixSpace::SetBlockRows ( Index  irow,
Index  nrows 
)

Set the number nrows of rows in row-block number irow.

◆ SetBlockCols()

void Ipopt::CompoundMatrixSpace::SetBlockCols ( Index  jcol,
Index  ncols 
)

Set the number ncols of columns in column-block number jcol.

◆ GetBlockRows()

Index Ipopt::CompoundMatrixSpace::GetBlockRows ( Index  irow) const

Get the number nrows of rows in row-block number irow.

◆ GetBlockCols()

Index Ipopt::CompoundMatrixSpace::GetBlockCols ( Index  jcol) const

Set the number ncols of columns in column-block number jcol.

◆ SetCompSpace()

void Ipopt::CompoundMatrixSpace::SetCompSpace ( Index  irow,
Index  jcol,
const MatrixSpace mat_space,
bool  auto_allocate = false 
)

Set the component MatrixSpace.

If auto_allocate is true, then a new CompoundMatrix created later with MakeNew will have this component automatically created with the Matrix's MakeNew. Otherwise, the corresponding component will be NULL and has to be set with the SetComp methods of the CompoundMatrix.

◆ GetCompSpace()

SmartPtr< const MatrixSpace > Ipopt::CompoundMatrixSpace::GetCompSpace ( Index  irow,
Index  jcol 
) const
inline

Obtain the component MatrixSpace in block row irow and block column jcol.

Definition at line 285 of file IpCompoundMatrix.hpp.

◆ NComps_Rows()

Index Ipopt::CompoundMatrixSpace::NComps_Rows ( ) const
inline

Number of block rows.

Definition at line 298 of file IpCompoundMatrix.hpp.

◆ NComps_Cols()

Index Ipopt::CompoundMatrixSpace::NComps_Cols ( ) const
inline

Number of block columns.

Definition at line 304 of file IpCompoundMatrix.hpp.

◆ Diagonal()

bool Ipopt::CompoundMatrixSpace::Diagonal ( ) const
inline

True if the blocks lie on the diagonal - can make some operations faster.

Definition at line 310 of file IpCompoundMatrix.hpp.

◆ MakeNewCompoundMatrix()

CompoundMatrix * Ipopt::CompoundMatrixSpace::MakeNewCompoundMatrix ( ) const

Method for creating a new matrix of this specific type.

◆ MakeNew()

virtual Matrix * Ipopt::CompoundMatrixSpace::MakeNew ( ) const
inlinevirtual

Pure virtual method for creating a new Matrix of the corresponding type.

Implements Ipopt::MatrixSpace.

Definition at line 319 of file IpCompoundMatrix.hpp.

◆ operator=()

CompoundMatrixSpace & Ipopt::CompoundMatrixSpace::operator= ( const CompoundMatrixSpace )
private

Default Assignment Operator.

◆ DimensionsSet()

bool Ipopt::CompoundMatrixSpace::DimensionsSet ( ) const
private

Auxiliary function for debugging to set if all block dimensions have been set.

Member Data Documentation

◆ ncomps_rows_

Index Ipopt::CompoundMatrixSpace::ncomps_rows_
private

Number of block rows.

Definition at line 347 of file IpCompoundMatrix.hpp.

◆ ncomps_cols_

Index Ipopt::CompoundMatrixSpace::ncomps_cols_
private

Number of block columns.

Definition at line 350 of file IpCompoundMatrix.hpp.

◆ dimensions_set_

bool Ipopt::CompoundMatrixSpace::dimensions_set_
mutableprivate

Store whether or not the dimensions are valid.

Definition at line 353 of file IpCompoundMatrix.hpp.

◆ comp_spaces_

std::vector<std::vector<SmartPtr<const MatrixSpace> > > Ipopt::CompoundMatrixSpace::comp_spaces_
private

2-dim std::vector of matrix spaces for the components

Definition at line 356 of file IpCompoundMatrix.hpp.

◆ allocate_block_

std::vector<std::vector<bool> > Ipopt::CompoundMatrixSpace::allocate_block_
private

2-dim std::vector of booleans deciding whether to allocate a new matrix for the blocks automagically

Definition at line 361 of file IpCompoundMatrix.hpp.

◆ block_rows_

std::vector<Index> Ipopt::CompoundMatrixSpace::block_rows_
private

Vector of the number of rows in each comp column.

Definition at line 364 of file IpCompoundMatrix.hpp.

◆ block_cols_

std::vector<Index> Ipopt::CompoundMatrixSpace::block_cols_
private

Vector of the number of cols in each comp row.

Definition at line 367 of file IpCompoundMatrix.hpp.

◆ diagonal_

bool Ipopt::CompoundMatrixSpace::diagonal_
private

true if the CompoundMatrixSpace only has Matrix spaces along the diagonal.

This means that the CompoundMatrix will only have matrices along the diagonal and it could make some operations more efficient.

Definition at line 374 of file IpCompoundMatrix.hpp.


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