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

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

#include <IpWsmpSolverInterface.hpp>

+ Inheritance diagram for Ipopt::WsmpSolverInterface:

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.
 
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 *ia, const Index *ja, std::list< Index > &c_deps)
 This method determines the list of row indices of the linearly dependent rows.
 
Constructor/Destructor
 WsmpSolverInterface ()
 Constructor.
 
virtual ~WsmpSolverInterface ()
 Destructor.
 
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.
 
virtual doubleGetValuesArrayPtr ()
 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 *ia, const Index *ja, Index nrhs, double *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 ()
 
- 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 RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 
static void GetVersion (int &V, int &R, int &M)
 give WSMP version
 

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.

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

Private Attributes

Index matrix_file_number_
 Counter for matrix file numbers.
 
Information about the matrix
Index dim_
 Number of rows and columns of the matrix.
 
Index nonzeros_
 Number of nonzeros of the matrix in triplet representation.
 
doublea_
 Array for storing the values of the matrix.
 
Solver specific options
Index wsmp_num_threads_
 Option that controls the matching strategy.
 
Number wsmp_pivtol_
 Pivot tolerance.
 
Number wsmp_pivtolmax_
 Maximal pivot tolerance.
 
Index wsmp_scaling_
 Indicating which of WSMP's scaling methods should be used.
 
Number wsmp_singularity_threshold_
 WSMP's singularity threshold.
 
Index wsmp_write_matrix_iteration_
 iteration number in which matrices are to be written out
 
bool skip_inertia_check_
 Flag indicating if the inertia is always assumed to be correct.
 
bool wsmp_no_pivoting_
 Flag indicating whether the positive definite version of WSMP should be used.
 
Information about most recent factorization/solve
Index negevals_
 Number of negative eigenvalues.
 
Initialization flags
bool initialized_
 Flag indicating if internal data is initialized.
 
bool printed_num_threads_
 Flag indicating if we already printed how many threads are used by WSMP.
 
bool pivtol_changed_
 Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed, or the computation of the ordering has been triggered with DPARNM[14].
 
bool have_symbolic_factorization_
 Flag indicating whether symbolic factorization and order has already been performed.
 
Index factorizations_since_recomputed_ordering_
 Counter indicating how many factorizations have been done sine the last recomputation of the ordering.
 
Solver specific information
IndexIPARM_
 Integer parameter array for WSSMP.
 
doubleDPARM_
 Double precision parameter array for WSSMP.
 
IndexPERM_
 WSSMP's permutation vector.
 
IndexINVP_
 WSSMP's inverse permutation vector.
 
IndexMRP_
 WSSMP's internal MRP array.
 

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 Wsmp, derived from SparseSymLinearSolverInterface.

Definition at line 20 of file IpWsmpSolverInterface.hpp.

Constructor & Destructor Documentation

◆ WsmpSolverInterface() [1/2]

Ipopt::WsmpSolverInterface::WsmpSolverInterface ( )

Constructor.

◆ ~WsmpSolverInterface()

virtual Ipopt::WsmpSolverInterface::~WsmpSolverInterface ( )
virtual

Destructor.

◆ WsmpSolverInterface() [2/2]

Ipopt::WsmpSolverInterface::WsmpSolverInterface ( const WsmpSolverInterface )
private

Copy Constructor.

Member Function Documentation

◆ InitializeImpl()

bool Ipopt::WsmpSolverInterface::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::WsmpSolverInterface::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::WsmpSolverInterface::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::WsmpSolverInterface::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::WsmpSolverInterface::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::WsmpSolverInterface::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::WsmpSolverInterface::ProvidesInertia ( ) const
inlinevirtual

Query whether inertia is computed by linear solver.

Returns
true, if linear solver provides inertia

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 69 of file IpWsmpSolverInterface.hpp.

◆ MatrixFormat()

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

Query of requested matrix type that the linear solver understands.

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 74 of file IpWsmpSolverInterface.hpp.

◆ RegisterOptions()

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

◆ GetVersion()

static void Ipopt::WsmpSolverInterface::GetVersion ( int V,
int R,
int M 
)
static

give WSMP version

◆ ProvidesDegeneracyDetection()

virtual bool Ipopt::WsmpSolverInterface::ProvidesDegeneracyDetection ( ) const
virtual

Query whether the indices of linearly dependent rows/columns can be determined by this linear solver.

Reimplemented from Ipopt::SparseSymLinearSolverInterface.

◆ DetermineDependentRows()

virtual ESymSolverStatus Ipopt::WsmpSolverInterface::DetermineDependentRows ( const Index ,
const Index ,
std::list< Index > &   
)
virtual

This method determines the list of row indices of the linearly dependent rows.

Reimplemented from Ipopt::SparseSymLinearSolverInterface.

◆ operator=()

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

Default Assignment Operator.

◆ SymbolicFactorization()

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

Call Wsmp to do the analysis phase.

◆ InternalSymFact()

ESymSolverStatus Ipopt::WsmpSolverInterface::InternalSymFact ( const Index ia,
const Index ja,
Index  numberOfNegEVals 
)
private

Call Wsmp to really do the analysis phase.

◆ Factorization()

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

Call Wsmp to factorize the Matrix.

◆ Solve()

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

Call Wsmp to do the Solve.

Member Data Documentation

◆ dim_

Index Ipopt::WsmpSolverInterface::dim_
private

Number of rows and columns of the matrix.

Definition at line 124 of file IpWsmpSolverInterface.hpp.

◆ nonzeros_

Index Ipopt::WsmpSolverInterface::nonzeros_
private

Number of nonzeros of the matrix in triplet representation.

Definition at line 127 of file IpWsmpSolverInterface.hpp.

◆ a_

double* Ipopt::WsmpSolverInterface::a_
private

Array for storing the values of the matrix.

Definition at line 130 of file IpWsmpSolverInterface.hpp.

◆ wsmp_num_threads_

Index Ipopt::WsmpSolverInterface::wsmp_num_threads_
private

Option that controls the matching strategy.

Definition at line 148 of file IpWsmpSolverInterface.hpp.

◆ wsmp_pivtol_

Number Ipopt::WsmpSolverInterface::wsmp_pivtol_
private

Pivot tolerance.

Definition at line 150 of file IpWsmpSolverInterface.hpp.

◆ wsmp_pivtolmax_

Number Ipopt::WsmpSolverInterface::wsmp_pivtolmax_
private

Maximal pivot tolerance.

Definition at line 152 of file IpWsmpSolverInterface.hpp.

◆ wsmp_scaling_

Index Ipopt::WsmpSolverInterface::wsmp_scaling_
private

Indicating which of WSMP's scaling methods should be used.

Definition at line 154 of file IpWsmpSolverInterface.hpp.

◆ wsmp_singularity_threshold_

Number Ipopt::WsmpSolverInterface::wsmp_singularity_threshold_
private

WSMP's singularity threshold.

The smaller this value the less likely a matrix is declared singular.

Definition at line 159 of file IpWsmpSolverInterface.hpp.

◆ wsmp_write_matrix_iteration_

Index Ipopt::WsmpSolverInterface::wsmp_write_matrix_iteration_
private

iteration number in which matrices are to be written out

Definition at line 161 of file IpWsmpSolverInterface.hpp.

◆ skip_inertia_check_

bool Ipopt::WsmpSolverInterface::skip_inertia_check_
private

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

Definition at line 163 of file IpWsmpSolverInterface.hpp.

◆ wsmp_no_pivoting_

bool Ipopt::WsmpSolverInterface::wsmp_no_pivoting_
private

Flag indicating whether the positive definite version of WSMP should be used.

Definition at line 165 of file IpWsmpSolverInterface.hpp.

◆ matrix_file_number_

Index Ipopt::WsmpSolverInterface::matrix_file_number_
private

Counter for matrix file numbers.

Definition at line 169 of file IpWsmpSolverInterface.hpp.

◆ negevals_

Index Ipopt::WsmpSolverInterface::negevals_
private

Number of negative eigenvalues.

Definition at line 174 of file IpWsmpSolverInterface.hpp.

◆ initialized_

bool Ipopt::WsmpSolverInterface::initialized_
private

Flag indicating if internal data is initialized.

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

Definition at line 183 of file IpWsmpSolverInterface.hpp.

◆ printed_num_threads_

bool Ipopt::WsmpSolverInterface::printed_num_threads_
private

Flag indicating if we already printed how many threads are used by WSMP.

Definition at line 185 of file IpWsmpSolverInterface.hpp.

◆ pivtol_changed_

bool Ipopt::WsmpSolverInterface::pivtol_changed_
private

Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed, or the computation of the ordering has been triggered with DPARNM[14].

Definition at line 190 of file IpWsmpSolverInterface.hpp.

◆ have_symbolic_factorization_

bool Ipopt::WsmpSolverInterface::have_symbolic_factorization_
private

Flag indicating whether symbolic factorization and order has already been performed.

Definition at line 194 of file IpWsmpSolverInterface.hpp.

◆ factorizations_since_recomputed_ordering_

Index Ipopt::WsmpSolverInterface::factorizations_since_recomputed_ordering_
private

Counter indicating how many factorizations have been done sine the last recomputation of the ordering.

Definition at line 198 of file IpWsmpSolverInterface.hpp.

◆ IPARM_

Index* Ipopt::WsmpSolverInterface::IPARM_
private

Integer parameter array for WSSMP.

Definition at line 204 of file IpWsmpSolverInterface.hpp.

◆ DPARM_

double* Ipopt::WsmpSolverInterface::DPARM_
private

Double precision parameter array for WSSMP.

Definition at line 206 of file IpWsmpSolverInterface.hpp.

◆ PERM_

Index* Ipopt::WsmpSolverInterface::PERM_
private

WSSMP's permutation vector.

Definition at line 208 of file IpWsmpSolverInterface.hpp.

◆ INVP_

Index* Ipopt::WsmpSolverInterface::INVP_
private

WSSMP's inverse permutation vector.

Definition at line 210 of file IpWsmpSolverInterface.hpp.

◆ MRP_

Index* Ipopt::WsmpSolverInterface::MRP_
private

WSSMP's internal MRP array.

Definition at line 212 of file IpWsmpSolverInterface.hpp.


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