Ipopt Documentation  
Ipopt::PardisoSolverInterface Class Reference

Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface. More...

#include <IpPardisoSolverInterface.hpp>

+ Inheritance diagram for Ipopt::PardisoSolverInterface:

Public Member Functions

Constructor/Destructor
 PardisoSolverInterface ()
 Constructor. More...
 
virtual ~PardisoSolverInterface ()
 Destructor. More...
 
bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 Implementation of the initialization method that has to be overloaded by for each derived class. More...
 
- 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. More...
 
virtual ESymSolverStatus DetermineDependentRows (const Index *, const Index *, std::list< Index > &)
 This method determines the list of row indices of the linearly dependent rows. More...
 
- Public Member Functions inherited from Ipopt::AlgorithmStrategyObject
 AlgorithmStrategyObject ()
 Default Constructor. More...
 
virtual ~AlgorithmStrategyObject ()
 Destructor. More...
 
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. More...
 
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. 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
 

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.

 PardisoSolverInterface (const PardisoSolverInterface &)
 Copy Constructor. More...
 
void operator= (const PardisoSolverInterface &)
 Default Assignment Operator. More...
 
Internal functions
ESymSolverStatus SymbolicFactorization (const Index *ia, const Index *ja)
 Call Pardiso to do the analysis phase. More...
 
ESymSolverStatus Factorization (const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
 Call Pardiso to factorize the Matrix. More...
 
ESymSolverStatus Solve (const Index *ia, const Index *ja, Index nrhs, double *rhs_vals)
 Call Pardiso to do the Solve. More...
 

Private Attributes

Information about the matrix
Index dim_
 Number of rows and columns of the matrix. More...
 
Index nonzeros_
 Number of nonzeros of the matrix in triplet representation. More...
 
double * a_
 Array for storing the values of the matrix. More...
 
Information about most recent factorization/solve
Index negevals_
 Number of negative eigenvalues. More...
 
Initialization flags
bool initialized_
 Flag indicating if internal data is initialized. More...
 
Solver specific information
void ** PT_
 Internal data address pointers. More...
 
ipfint MAXFCT_
 Maximal number of factors with identical nonzero structure. More...
 
ipfint MNUM_
 Actual matrix for the solution phase. More...
 
ipfint MTYPE_
 Matrix type; real and symmetric indefinite. More...
 
ipfintIPARM_
 Parameter and info array for Pardiso. More...
 
double * DPARM_
 Parameter and info array for Pardiso. More...
 
ipfint MSGLVL_
 Message level. More...
 
Some counters for debugging
Index debug_last_iter_
 
Index debug_cnt_
 

Methods for requesting solution of the linear system.

virtual ESymSolverStatus InitializeStructure (Index dim, Index nonzeros, const Index *ia, const Index *ja)
 Method for initializing internal structures. More...
 
virtual double * GetValuesArrayPtr ()
 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). More...
 
virtual ESymSolverStatus MultiSolve (bool new_matrix, const Index *ia, const Index *ja, Index nrhs, double *rhs_vals, bool check_NegEVals, Index numberOfNegEVals)
 Solve operation for multiple right hand sides. More...
 
virtual Index NumberOfNegEVals () const
 Number of negative eigenvalues detected during last factorization. More...
 
virtual bool IncreaseQuality ()
 Request to increase quality of solution for next solve. More...
 
virtual bool ProvidesInertia () const
 Query whether inertia is computed by linear solver. More...
 
EMatrixFormat MatrixFormat () const
 Query of requested matrix type that the linear solver understands. More...
 
static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 

Solver specific options

enum  PardisoMatchingStrategy { COMPLETE, COMPLETE2x2, CONSTRAINT }
 Type for matching strategies. More...
 
PardisoMatchingStrategy match_strat_
 Option that controls the matching strategy. More...
 
bool have_symbolic_factorization_
 Flag indicating if symbolic factorization has already been performed. More...
 
bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_
 Flag indicating whether the symbolic factorization should only be done after perturbed elements, if the inertia was wrong. More...
 
bool pardiso_repeated_perturbation_means_singular_
 Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be interpreted as a singular matrix. More...
 
bool skip_inertia_check_
 Flag indicating if the inertia is always assumed to be correct. More...
 
bool pardiso_iterative_
 Flag indicating whether we are using the iterative solver in Pardiso. More...
 
Index pardiso_max_droptol_corrections_
 Maximal number of decreases of drop tolerance during one solve. More...
 

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 linear solver Pardiso, derived from SparseSymLinearSolverInterface.

Definition at line 20 of file IpPardisoSolverInterface.hpp.

Member Enumeration Documentation

◆ PardisoMatchingStrategy

Type for matching strategies.

Enumerator
COMPLETE 
COMPLETE2x2 
CONSTRAINT 

Definition at line 129 of file IpPardisoSolverInterface.hpp.

Constructor & Destructor Documentation

◆ PardisoSolverInterface() [1/2]

Ipopt::PardisoSolverInterface::PardisoSolverInterface ( )

Constructor.

◆ ~PardisoSolverInterface()

virtual Ipopt::PardisoSolverInterface::~PardisoSolverInterface ( )
virtual

Destructor.

◆ PardisoSolverInterface() [2/2]

Ipopt::PardisoSolverInterface::PardisoSolverInterface ( const PardisoSolverInterface )
private

Copy Constructor.

Member Function Documentation

◆ InitializeImpl()

bool Ipopt::PardisoSolverInterface::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::PardisoSolverInterface::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 double* Ipopt::PardisoSolverInterface::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::PardisoSolverInterface::MultiSolve ( bool  new_matrix,
const Index ia,
const Index ja,
Index  nrhs,
double *  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::PardisoSolverInterface::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::PardisoSolverInterface::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::PardisoSolverInterface::ProvidesInertia ( ) const
inlinevirtual

Query whether inertia is computed by linear solver.

Returns
true, if linear solver provides inertia

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 64 of file IpPardisoSolverInterface.hpp.

◆ MatrixFormat()

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

Query of requested matrix type that the linear solver understands.

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 69 of file IpPardisoSolverInterface.hpp.

◆ RegisterOptions()

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

◆ operator=()

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

Default Assignment Operator.

◆ SymbolicFactorization()

ESymSolverStatus Ipopt::PardisoSolverInterface::SymbolicFactorization ( const Index ia,
const Index ja 
)
private

Call Pardiso to do the analysis phase.

◆ Factorization()

ESymSolverStatus Ipopt::PardisoSolverInterface::Factorization ( const Index ia,
const Index ja,
bool  check_NegEVals,
Index  numberOfNegEVals 
)
private

Call Pardiso to factorize the Matrix.

◆ Solve()

ESymSolverStatus Ipopt::PardisoSolverInterface::Solve ( const Index ia,
const Index ja,
Index  nrhs,
double *  rhs_vals 
)
private

Call Pardiso to do the Solve.

Member Data Documentation

◆ dim_

Index Ipopt::PardisoSolverInterface::dim_
private

Number of rows and columns of the matrix.

Definition at line 102 of file IpPardisoSolverInterface.hpp.

◆ nonzeros_

Index Ipopt::PardisoSolverInterface::nonzeros_
private

Number of nonzeros of the matrix in triplet representation.

Definition at line 105 of file IpPardisoSolverInterface.hpp.

◆ a_

double* Ipopt::PardisoSolverInterface::a_
private

Array for storing the values of the matrix.

Definition at line 108 of file IpPardisoSolverInterface.hpp.

◆ negevals_

Index Ipopt::PardisoSolverInterface::negevals_
private

Number of negative eigenvalues.

Definition at line 123 of file IpPardisoSolverInterface.hpp.

◆ match_strat_

PardisoMatchingStrategy Ipopt::PardisoSolverInterface::match_strat_
private

Option that controls the matching strategy.

Definition at line 136 of file IpPardisoSolverInterface.hpp.

◆ have_symbolic_factorization_

bool Ipopt::PardisoSolverInterface::have_symbolic_factorization_
private

Flag indicating if symbolic factorization has already been performed.

Definition at line 138 of file IpPardisoSolverInterface.hpp.

◆ pardiso_redo_symbolic_fact_only_if_inertia_wrong_

bool Ipopt::PardisoSolverInterface::pardiso_redo_symbolic_fact_only_if_inertia_wrong_
private

Flag indicating whether the symbolic factorization should only be done after perturbed elements, if the inertia was wrong.

Definition at line 142 of file IpPardisoSolverInterface.hpp.

◆ pardiso_repeated_perturbation_means_singular_

bool Ipopt::PardisoSolverInterface::pardiso_repeated_perturbation_means_singular_
private

Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be interpreted as a singular matrix.

Definition at line 147 of file IpPardisoSolverInterface.hpp.

◆ skip_inertia_check_

bool Ipopt::PardisoSolverInterface::skip_inertia_check_
private

Flag indicating if the inertia is always assumed to be correct.

Definition at line 151 of file IpPardisoSolverInterface.hpp.

◆ pardiso_iterative_

bool Ipopt::PardisoSolverInterface::pardiso_iterative_
private

Flag indicating whether we are using the iterative solver in Pardiso.

Definition at line 153 of file IpPardisoSolverInterface.hpp.

◆ pardiso_max_droptol_corrections_

Index Ipopt::PardisoSolverInterface::pardiso_max_droptol_corrections_
private

Maximal number of decreases of drop tolerance during one solve.

Definition at line 155 of file IpPardisoSolverInterface.hpp.

◆ initialized_

bool Ipopt::PardisoSolverInterface::initialized_
private

Flag indicating if internal data is initialized.

For initialization, this object needs to have seen a matrix.

Definition at line 163 of file IpPardisoSolverInterface.hpp.

◆ PT_

void** Ipopt::PardisoSolverInterface::PT_
private

Internal data address pointers.

Definition at line 169 of file IpPardisoSolverInterface.hpp.

◆ MAXFCT_

ipfint Ipopt::PardisoSolverInterface::MAXFCT_
private

Maximal number of factors with identical nonzero structure.

Here, we only store one factorization. Is always 1.

Definition at line 173 of file IpPardisoSolverInterface.hpp.

◆ MNUM_

ipfint Ipopt::PardisoSolverInterface::MNUM_
private

Actual matrix for the solution phase.

Is always 1.

Definition at line 175 of file IpPardisoSolverInterface.hpp.

◆ MTYPE_

ipfint Ipopt::PardisoSolverInterface::MTYPE_
private

Matrix type; real and symmetric indefinite.

Is always -2.

Definition at line 177 of file IpPardisoSolverInterface.hpp.

◆ IPARM_

ipfint* Ipopt::PardisoSolverInterface::IPARM_
private

Parameter and info array for Pardiso.

Definition at line 179 of file IpPardisoSolverInterface.hpp.

◆ DPARM_

double* Ipopt::PardisoSolverInterface::DPARM_
private

Parameter and info array for Pardiso.

Definition at line 181 of file IpPardisoSolverInterface.hpp.

◆ MSGLVL_

ipfint Ipopt::PardisoSolverInterface::MSGLVL_
private

Message level.

Definition at line 183 of file IpPardisoSolverInterface.hpp.

◆ debug_last_iter_

Index Ipopt::PardisoSolverInterface::debug_last_iter_
private

Definition at line 188 of file IpPardisoSolverInterface.hpp.

◆ debug_cnt_

Index Ipopt::PardisoSolverInterface::debug_cnt_
private

Definition at line 189 of file IpPardisoSolverInterface.hpp.


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