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

Interface to the symmetric linear solver MA57, derived from SparseSymLinearSolverInterface. More...

#include <IpMa57TSolverInterface.hpp>

+ Inheritance diagram for Ipopt::Ma57TSolverInterface:

Public Member Functions

bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 Implementation of the initialization method that has to be overloaded by for each derived class.
 
Constructor/Destructor
 Ma57TSolverInterface (SmartPtr< LibraryLoader > hslloader_)
 Constructor.
 
virtual ~Ma57TSolverInterface ()
 Destructor.
 
Methods for requesting solution of the linear system.
virtual ESymSolverStatus InitializeStructure (Index dim, Index nonzeros, const Index *airn, const Index *ajcn)
 Method for initializing internal structures.
 
virtual NumberGetValuesArrayPtr ()
 Method returning an internal array into which the nonzero elements (in the same order as ja) will be stored by the calling routine before a call to MultiSolve with a new_matrix=true (or after a return of MultiSolve with SYMSOLV_CALL_AGAIN).
 
virtual ESymSolverStatus MultiSolve (bool new_matrix, const Index *airn, const Index *ajcn, Index nrhs, Number *rhs_vals, bool check_NegEVals, Index numberOfNegEVals)
 Solve operation for multiple right hand sides.
 
virtual Index NumberOfNegEVals () const
 Number of negative eigenvalues detected during last factorization.
 
virtual bool IncreaseQuality ()
 Request to increase quality of solution for next solve.
 
virtual bool ProvidesInertia () const
 Query whether inertia is computed by linear solver.
 
EMatrixFormat MatrixFormat () const
 Query of requested matrix type that the linear solver understands.
 
- Public Member Functions inherited from Ipopt::SparseSymLinearSolverInterface
 SparseSymLinearSolverInterface ()
 
virtual ~SparseSymLinearSolverInterface ()
 
virtual bool ProvidesDegeneracyDetection () const
 Query whether the indices of linearly dependent rows/columns can be determined by this linear solver.
 
virtual ESymSolverStatus DetermineDependentRows (const Index *, const Index *, std::list< Index > &)
 This method determines the list of row indices of the linearly dependent rows.
 
- Public Member Functions inherited from Ipopt::AlgorithmStrategyObject
bool Initialize (const Journalist &jnlst, IpoptNLP &ip_nlp, IpoptData &ip_data, IpoptCalculatedQuantities &ip_cq, const OptionsList &options, const std::string &prefix)
 This method is called every time the algorithm starts again - it is used to reset any internal state.
 
bool ReducedInitialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Reduced version of the Initialize method, which does not require special Ipopt information.
 
 AlgorithmStrategyObject ()
 Default Constructor.
 
virtual ~AlgorithmStrategyObject ()
 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
 

Static Public Member Functions

static void SetFunctions (IPOPT_DECL_MA57A(*ma57a), IPOPT_DECL_MA57B(*ma57b), IPOPT_DECL_MA57C(*ma57c), IPOPT_DECL_MA57E(*ma57e),)
 set MA57 functions to use for every instantiation of this class
 
static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 

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.

 Ma57TSolverInterface (const Ma57TSolverInterface &)
 Copy Constructor.
 
void operator= (const Ma57TSolverInterface &)
 Default Assignment Operator.
 
Internal functions
ESymSolverStatus SymbolicFactorization (const Index *airn, const Index *ajcn)
 Call MA57AX and reserve memory for MA57 data.
 
ESymSolverStatus Factorization (const Index *airn, const Index *ajcn, bool check_NegEVals, Index numberOfNegEVals)
 Call MA57BX to factorize the Matrix.
 
ESymSolverStatus Backsolve (Index nrhs, Number *rhs_vals)
 Call MA57CX to do the backsolve.
 

Private Attributes

MA57 function pointers
SmartPtr< LibraryLoaderhslloader
 
IPOPT_DECL_MA57Ama57a
 symbolic factorization
 
IPOPT_DECL_MA57Bma57b
 numerical factorization
 
IPOPT_DECL_MA57Cma57c
 solution
 
IPOPT_DECL_MA57Ema57e
 copy arrays
 
IPOPT_DECL_MA57Ima57i
 initialize solver
 
Information about the matrix
Index dim_
 Number of rows and columns of the matrix.
 
Index nonzeros_
 Number of nonzeros of the matrix.
 
Information about most recent factorization/solve
Index negevals_
 Number of negative eigenvalues.
 
Initialization flags
bool initialized_
 Flag indicating if internal data is initialized.
 
bool pivtol_changed_
 Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed.
 
bool refactorize_
 Flag that is true if we just requested the values of the matrix again (SYMSOLVER_CALL_AGAIN) and have to factorize again.
 
Solver specific data/options
Number pivtol_
 Pivot tolerance.
 
Number pivtolmax_
 Maximal pivot tolerance.
 
Number ma57_pre_alloc_
 Factor for estimating initial size of work arrays.
 
bool warm_start_same_structure_
 Flag indicating whether the TNLP with identical structure has already been solved before.
 
Data for the linear solver.

Storing factorization and other solver specific data structure.

Number wd_cntl_ [5]
 
ma57int wd_icntl_ [20]
 
ma57int wd_info_ [40]
 
Number wd_rinfo_ [20]
 
ma57int wd_lkeep_
 
ma57intwd_keep_
 
ma57intwd_iwork_
 
Numberwd_fact_
 
ma57int wd_lfact_
 
ma57intwd_ifact_
 
ma57int wd_lifact_
 
Numbera_
 factor A of matrix
 

Additional Inherited Members

- Public Types inherited from Ipopt::SparseSymLinearSolverInterface
enum  EMatrixFormat {
  Triplet_Format , CSR_Format_0_Offset , CSR_Format_1_Offset , CSR_Full_Format_0_Offset ,
  CSR_Full_Format_1_Offset
}
 Enum to specify sparse matrix format. More...
 
- Protected Member Functions inherited from Ipopt::AlgorithmStrategyObject
const JournalistJnlst () const
 
IpoptNLPIpNLP () const
 
IpoptDataIpData () const
 
IpoptCalculatedQuantitiesIpCq () const
 
bool HaveIpData () const
 

Detailed Description

Interface to the symmetric linear solver MA57, derived from SparseSymLinearSolverInterface.

Definition at line 107 of file IpMa57TSolverInterface.hpp.

Constructor & Destructor Documentation

◆ Ma57TSolverInterface() [1/2]

Ipopt::Ma57TSolverInterface::Ma57TSolverInterface ( SmartPtr< LibraryLoader hslloader_)

Constructor.

Parameters
hslloader_
Since
3.14.0

◆ ~Ma57TSolverInterface()

virtual Ipopt::Ma57TSolverInterface::~Ma57TSolverInterface ( )
virtual

Destructor.

◆ Ma57TSolverInterface() [2/2]

Ipopt::Ma57TSolverInterface::Ma57TSolverInterface ( const Ma57TSolverInterface )
private

Copy Constructor.

Member Function Documentation

◆ InitializeImpl()

bool Ipopt::Ma57TSolverInterface::InitializeImpl ( const OptionsList options,
const std::string &  prefix 
)
virtual

Implementation of the initialization method that has to be overloaded by for each derived class.

Implements Ipopt::SparseSymLinearSolverInterface.

◆ InitializeStructure()

virtual ESymSolverStatus Ipopt::Ma57TSolverInterface::InitializeStructure ( Index  dim,
Index  nonzeros,
const Index ia,
const Index ja 
)
virtual

Method for initializing internal structures.

Here, ndim gives the number of rows and columns of the matrix, nonzeros give the number of nonzero elements, and ia and ja give the positions of the nonzero elements, given in the matrix format determined by MatrixFormat.

Implements Ipopt::SparseSymLinearSolverInterface.

◆ GetValuesArrayPtr()

virtual Number * Ipopt::Ma57TSolverInterface::GetValuesArrayPtr ( )
virtual

Method returning an internal array into which the nonzero elements (in the same order as ja) will be stored by the calling routine before a call to MultiSolve with a new_matrix=true (or after a return of MultiSolve with SYMSOLV_CALL_AGAIN).

The returned array must have space for at least nonzero elements.

Implements Ipopt::SparseSymLinearSolverInterface.

◆ MultiSolve()

virtual ESymSolverStatus Ipopt::Ma57TSolverInterface::MultiSolve ( bool  new_matrix,
const Index ia,
const Index ja,
Index  nrhs,
Number rhs_vals,
bool  check_NegEVals,
Index  numberOfNegEVals 
)
virtual

Solve operation for multiple right hand sides.

Solves the linear system A * x = b with multiple right hand sides, where A is the symmetric indefinite matrix. Here, ia and ja give the positions of the values (in the required matrix data format). The actual values of the matrix will have been given to this object by copying them into the array provided by GetValuesArrayPtr. ia and ja are identical to the ones given to InitializeStructure. The flag new_matrix is set to true, if the values of the matrix has changed, and a refactorization is required.

Returns
SYMSOLV_SUCCESS if the factorization and solves were successful, SYMSOLV_SINGULAR if the linear system is singular, and SYMSOLV_WRONG_INERTIA if check_NegEVals is true and the number of negative eigenvalues in the matrix does not match numberOfNegEVals. If SYMSOLV_CALL_AGAIN is returned, then the calling function will request the pointer for the array for storing a again (with GetValuesPtr), write the values of the nonzero elements into it, and call this MultiSolve method again with the same right-hand sides. (This can be done, for example, if the linear solver realized it does not have sufficient memory and needs to redo the factorization; e.g., for MA27.)

The number of right-hand sides is given by nrhs, the values of the right-hand sides are given in rhs_vals (one full right-hand side stored immediately after the other), and solutions are to be returned in the same array.

check_NegEVals will not be chosen true, if ProvidesInertia() returns false.

Implements Ipopt::SparseSymLinearSolverInterface.

◆ NumberOfNegEVals()

virtual Index Ipopt::Ma57TSolverInterface::NumberOfNegEVals ( ) const
virtual

Number of negative eigenvalues detected during last factorization.

Returns
the number of negative eigenvalues of the most recent factorized matrix.

This must not be called if the linear solver does not compute this quantities (see ProvidesInertia).

Implements Ipopt::SparseSymLinearSolverInterface.

◆ IncreaseQuality()

virtual bool Ipopt::Ma57TSolverInterface::IncreaseQuality ( )
virtual

Request to increase quality of solution for next solve.

The calling class asks linear solver to increase quality of solution for the next solve (e.g. increase pivot tolerance).

Returns
false, if this is not possible (e.g. maximal pivot tolerance already used.)

Implements Ipopt::SparseSymLinearSolverInterface.

◆ ProvidesInertia()

virtual bool Ipopt::Ma57TSolverInterface::ProvidesInertia ( ) const
inlinevirtual

Query whether inertia is computed by linear solver.

Returns
true, if linear solver provides inertia

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 154 of file IpMa57TSolverInterface.hpp.

◆ MatrixFormat()

EMatrixFormat Ipopt::Ma57TSolverInterface::MatrixFormat ( ) const
inlinevirtual

Query of requested matrix type that the linear solver understands.

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 159 of file IpMa57TSolverInterface.hpp.

◆ RegisterOptions()

static void Ipopt::Ma57TSolverInterface::RegisterOptions ( SmartPtr< RegisteredOptions roptions)
static

◆ SetFunctions()

static void Ipopt::Ma57TSolverInterface::SetFunctions ( IPOPT_DECL_MA57A ma57a,
IPOPT_DECL_MA57B ma57b,
IPOPT_DECL_MA57C ma57c,
IPOPT_DECL_MA57E ma57e 
)
static

set MA57 functions to use for every instantiation of this class

Since
3.14.0

◆ operator=()

void Ipopt::Ma57TSolverInterface::operator= ( const Ma57TSolverInterface )
private

Default Assignment Operator.

◆ SymbolicFactorization()

ESymSolverStatus Ipopt::Ma57TSolverInterface::SymbolicFactorization ( const Index airn,
const Index ajcn 
)
private

Call MA57AX and reserve memory for MA57 data.

Reserve memory for iw_ and ikeep_, call MA57AD to perform symbolic manipulations, and reserve all the remaining data memory

◆ Factorization()

ESymSolverStatus Ipopt::Ma57TSolverInterface::Factorization ( const Index airn,
const Index ajcn,
bool  check_NegEVals,
Index  numberOfNegEVals 
)
private

Call MA57BX to factorize the Matrix.

It is assumed that the first nonzeros_ element of a_ contain the values of the matrix to be factorized.

◆ Backsolve()

ESymSolverStatus Ipopt::Ma57TSolverInterface::Backsolve ( Index  nrhs,
Number rhs_vals 
)
private

Call MA57CX to do the backsolve.

Member Data Documentation

◆ hslloader

SmartPtr<LibraryLoader> Ipopt::Ma57TSolverInterface::hslloader
private

Definition at line 204 of file IpMa57TSolverInterface.hpp.

◆ ma57a

IPOPT_DECL_MA57A* Ipopt::Ma57TSolverInterface::ma57a
private

symbolic factorization

Definition at line 207 of file IpMa57TSolverInterface.hpp.

◆ ma57b

IPOPT_DECL_MA57B* Ipopt::Ma57TSolverInterface::ma57b
private

numerical factorization

Definition at line 209 of file IpMa57TSolverInterface.hpp.

◆ ma57c

IPOPT_DECL_MA57C* Ipopt::Ma57TSolverInterface::ma57c
private

solution

Definition at line 211 of file IpMa57TSolverInterface.hpp.

◆ ma57e

IPOPT_DECL_MA57E* Ipopt::Ma57TSolverInterface::ma57e
private

copy arrays

Definition at line 213 of file IpMa57TSolverInterface.hpp.

◆ ma57i

IPOPT_DECL_MA57I* Ipopt::Ma57TSolverInterface::ma57i
private

initialize solver

Definition at line 215 of file IpMa57TSolverInterface.hpp.

◆ dim_

Index Ipopt::Ma57TSolverInterface::dim_
private

Number of rows and columns of the matrix.

Definition at line 221 of file IpMa57TSolverInterface.hpp.

◆ nonzeros_

Index Ipopt::Ma57TSolverInterface::nonzeros_
private

Number of nonzeros of the matrix.

Definition at line 224 of file IpMa57TSolverInterface.hpp.

◆ negevals_

Index Ipopt::Ma57TSolverInterface::negevals_
private

Number of negative eigenvalues.

Definition at line 230 of file IpMa57TSolverInterface.hpp.

◆ initialized_

bool Ipopt::Ma57TSolverInterface::initialized_
private

Flag indicating if internal data is initialized.

For initialization, this object needs to have seen a matrix

Definition at line 239 of file IpMa57TSolverInterface.hpp.

◆ pivtol_changed_

bool Ipopt::Ma57TSolverInterface::pivtol_changed_
private

Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed.

Definition at line 243 of file IpMa57TSolverInterface.hpp.

◆ refactorize_

bool Ipopt::Ma57TSolverInterface::refactorize_
private

Flag that is true if we just requested the values of the matrix again (SYMSOLVER_CALL_AGAIN) and have to factorize again.

Definition at line 248 of file IpMa57TSolverInterface.hpp.

◆ pivtol_

Number Ipopt::Ma57TSolverInterface::pivtol_
private

Pivot tolerance.

Definition at line 254 of file IpMa57TSolverInterface.hpp.

◆ pivtolmax_

Number Ipopt::Ma57TSolverInterface::pivtolmax_
private

Maximal pivot tolerance.

Definition at line 256 of file IpMa57TSolverInterface.hpp.

◆ ma57_pre_alloc_

Number Ipopt::Ma57TSolverInterface::ma57_pre_alloc_
private

Factor for estimating initial size of work arrays.

Definition at line 258 of file IpMa57TSolverInterface.hpp.

◆ warm_start_same_structure_

bool Ipopt::Ma57TSolverInterface::warm_start_same_structure_
private

Flag indicating whether the TNLP with identical structure has already been solved before.

Definition at line 262 of file IpMa57TSolverInterface.hpp.

◆ wd_cntl_

Number Ipopt::Ma57TSolverInterface::wd_cntl_[5]
private

Definition at line 269 of file IpMa57TSolverInterface.hpp.

◆ wd_icntl_

ma57int Ipopt::Ma57TSolverInterface::wd_icntl_[20]
private

Definition at line 270 of file IpMa57TSolverInterface.hpp.

◆ wd_info_

ma57int Ipopt::Ma57TSolverInterface::wd_info_[40]
private

Definition at line 272 of file IpMa57TSolverInterface.hpp.

◆ wd_rinfo_

Number Ipopt::Ma57TSolverInterface::wd_rinfo_[20]
private

Definition at line 273 of file IpMa57TSolverInterface.hpp.

◆ wd_lkeep_

ma57int Ipopt::Ma57TSolverInterface::wd_lkeep_
private

Definition at line 275 of file IpMa57TSolverInterface.hpp.

◆ wd_keep_

ma57int* Ipopt::Ma57TSolverInterface::wd_keep_
private

Definition at line 276 of file IpMa57TSolverInterface.hpp.

◆ wd_iwork_

ma57int* Ipopt::Ma57TSolverInterface::wd_iwork_
private

Definition at line 278 of file IpMa57TSolverInterface.hpp.

◆ wd_fact_

Number* Ipopt::Ma57TSolverInterface::wd_fact_
private

Definition at line 280 of file IpMa57TSolverInterface.hpp.

◆ wd_lfact_

ma57int Ipopt::Ma57TSolverInterface::wd_lfact_
private

Definition at line 281 of file IpMa57TSolverInterface.hpp.

◆ wd_ifact_

ma57int* Ipopt::Ma57TSolverInterface::wd_ifact_
private

Definition at line 282 of file IpMa57TSolverInterface.hpp.

◆ wd_lifact_

ma57int Ipopt::Ma57TSolverInterface::wd_lifact_
private

Definition at line 283 of file IpMa57TSolverInterface.hpp.

◆ a_

Number* Ipopt::Ma57TSolverInterface::a_
private

factor A of matrix

Definition at line 286 of file IpMa57TSolverInterface.hpp.


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