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

Interface to the linear solver SPRAL. More...

#include <IpSpralSolverInterface.hpp>

+ Inheritance diagram for Ipopt::SpralSolverInterface:

Public Member Functions

 SpralSolverInterface ()
 
 ~SpralSolverInterface ()
 
bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 Implementation of the initialization method that has to be overloaded by for each derived class.
 
Methods for requesting solution of the linear system.
ESymSolverStatus InitializeStructure (Index dim, Index nonzeros, const Index *ia, const Index *ja)
 Method for initializing internal structures.
 
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).
 
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.
 
Index NumberOfNegEVals () const
 Number of negative eigenvalues detected during last factorization.
 
Options of Linear solver
bool IncreaseQuality ()
 Request to increase quality of solution for next solve.
 
bool ProvidesInertia () const
 Query whether inertia is computed by linear solver.
 
EMatrixFormat MatrixFormat () const
 Query of requested matrix type that the linear solver understands.
 
Methods related to the detection of linearly dependent

rows in a matrix

bool ProvidesDegeneracyDetection () const
 Query whether the indices of linearly dependent rows/columns can be determined by this linear solver.
 
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::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 std::string GetName ()
 give name of MUMPS with version info
 
static int ScaleNameToNum (const std::string &name)
 converts a scaling option name to its spral option number
 
static int PivotMethodNameToNum (const std::string &name)
 converts a pivot method option name to its spral option number
 

Private Types

enum  scaling_opts {
  SWITCH_NEVER , SWITCH_AT_START , SWITCH_AT_START_REUSE , SWITCH_ON_DEMAND ,
  SWITCH_ON_DEMAND_REUSE , SWITCH_NDELAY , SWITCH_NDELAY_REUSE , SWITCH_OD_ND ,
  SWITCH_OD_ND_REUSE
}
 

Private Attributes

int ndim_
 Number of dimensions.
 
doubleval_
 Storage for variables.
 
int numneg_
 Number of negative pivots in last factorization.
 
int numdelay_
 Number of delayed pivots last time we scaled.
 
voidakeep_
 Stores pointer to factors.
 
voidfkeep_
 Stores pointer to factors.
 
bool pivtol_changed_
 indicates if pivtol has been changed
 
bool rescale_
 Indicates if we should rescale next factorization.
 
doublescaling_
 Store scaling for reuse if doing dynamic scaling.
 
int fctidx_
 Current factorization number to dump to.
 
struct spral_ssids_options control_
 
double umax_
 
int ordering_
 
int scaling_type_
 
enum scaling_opts switch_ [3]
 
int scaling_val_ [3]
 
int current_level_
 
bool dump_
 

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 SPRAL.

Since
3.14.0

Definition at line 28 of file IpSpralSolverInterface.hpp.

Member Enumeration Documentation

◆ scaling_opts

Enumerator
SWITCH_NEVER 
SWITCH_AT_START 
SWITCH_AT_START_REUSE 
SWITCH_ON_DEMAND 
SWITCH_ON_DEMAND_REUSE 
SWITCH_NDELAY 
SWITCH_NDELAY_REUSE 
SWITCH_OD_ND 
SWITCH_OD_ND_REUSE 

Definition at line 31 of file IpSpralSolverInterface.hpp.

Constructor & Destructor Documentation

◆ SpralSolverInterface()

Ipopt::SpralSolverInterface::SpralSolverInterface ( )
inline

Definition at line 67 of file IpSpralSolverInterface.hpp.

◆ ~SpralSolverInterface()

Ipopt::SpralSolverInterface::~SpralSolverInterface ( )

Member Function Documentation

◆ RegisterOptions()

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

◆ GetName()

static std::string Ipopt::SpralSolverInterface::GetName ( )
static

give name of MUMPS with version info

◆ InitializeImpl()

bool Ipopt::SpralSolverInterface::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()

ESymSolverStatus Ipopt::SpralSolverInterface::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()

double * Ipopt::SpralSolverInterface::GetValuesArrayPtr ( )
inlinevirtual

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.

Definition at line 103 of file IpSpralSolverInterface.hpp.

◆ MultiSolve()

ESymSolverStatus Ipopt::SpralSolverInterface::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()

Index Ipopt::SpralSolverInterface::NumberOfNegEVals ( ) const
inlinevirtual

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.

Definition at line 118 of file IpSpralSolverInterface.hpp.

◆ IncreaseQuality()

bool Ipopt::SpralSolverInterface::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()

bool Ipopt::SpralSolverInterface::ProvidesInertia ( ) const
inlinevirtual

Query whether inertia is computed by linear solver.

Returns
true, if linear solver provides inertia

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 128 of file IpSpralSolverInterface.hpp.

◆ MatrixFormat()

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

Query of requested matrix type that the linear solver understands.

Implements Ipopt::SparseSymLinearSolverInterface.

Definition at line 133 of file IpSpralSolverInterface.hpp.

◆ ProvidesDegeneracyDetection()

bool Ipopt::SpralSolverInterface::ProvidesDegeneracyDetection ( ) const
inlinevirtual

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

Reimplemented from Ipopt::SparseSymLinearSolverInterface.

Definition at line 142 of file IpSpralSolverInterface.hpp.

◆ DetermineDependentRows()

ESymSolverStatus Ipopt::SpralSolverInterface::DetermineDependentRows ( const Index ,
const Index ,
std::list< Index > &   
)
inlinevirtual

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

Reimplemented from Ipopt::SparseSymLinearSolverInterface.

Definition at line 147 of file IpSpralSolverInterface.hpp.

◆ ScaleNameToNum()

static int Ipopt::SpralSolverInterface::ScaleNameToNum ( const std::string &  name)
static

converts a scaling option name to its spral option number

◆ PivotMethodNameToNum()

static int Ipopt::SpralSolverInterface::PivotMethodNameToNum ( const std::string &  name)
static

converts a pivot method option name to its spral option number

Member Data Documentation

◆ ndim_

int Ipopt::SpralSolverInterface::ndim_
private

Number of dimensions.

Definition at line 44 of file IpSpralSolverInterface.hpp.

◆ val_

double* Ipopt::SpralSolverInterface::val_
private

Storage for variables.

Definition at line 45 of file IpSpralSolverInterface.hpp.

◆ numneg_

int Ipopt::SpralSolverInterface::numneg_
private

Number of negative pivots in last factorization.

Definition at line 46 of file IpSpralSolverInterface.hpp.

◆ numdelay_

int Ipopt::SpralSolverInterface::numdelay_
private

Number of delayed pivots last time we scaled.

Definition at line 47 of file IpSpralSolverInterface.hpp.

◆ akeep_

void* Ipopt::SpralSolverInterface::akeep_
private

Stores pointer to factors.

Definition at line 48 of file IpSpralSolverInterface.hpp.

◆ fkeep_

void* Ipopt::SpralSolverInterface::fkeep_
private

Stores pointer to factors.

Definition at line 49 of file IpSpralSolverInterface.hpp.

◆ pivtol_changed_

bool Ipopt::SpralSolverInterface::pivtol_changed_
private

indicates if pivtol has been changed

Definition at line 50 of file IpSpralSolverInterface.hpp.

◆ rescale_

bool Ipopt::SpralSolverInterface::rescale_
private

Indicates if we should rescale next factorization.

Definition at line 51 of file IpSpralSolverInterface.hpp.

◆ scaling_

double* Ipopt::SpralSolverInterface::scaling_
private

Store scaling for reuse if doing dynamic scaling.

Definition at line 52 of file IpSpralSolverInterface.hpp.

◆ fctidx_

int Ipopt::SpralSolverInterface::fctidx_
private

Current factorization number to dump to.

Definition at line 53 of file IpSpralSolverInterface.hpp.

◆ control_

struct spral_ssids_options Ipopt::SpralSolverInterface::control_
private

Definition at line 56 of file IpSpralSolverInterface.hpp.

◆ umax_

double Ipopt::SpralSolverInterface::umax_
private

Definition at line 57 of file IpSpralSolverInterface.hpp.

◆ ordering_

int Ipopt::SpralSolverInterface::ordering_
private

Definition at line 58 of file IpSpralSolverInterface.hpp.

◆ scaling_type_

int Ipopt::SpralSolverInterface::scaling_type_
private

Definition at line 59 of file IpSpralSolverInterface.hpp.

◆ switch_

enum scaling_opts Ipopt::SpralSolverInterface::switch_[3]
private

Definition at line 60 of file IpSpralSolverInterface.hpp.

◆ scaling_val_

int Ipopt::SpralSolverInterface::scaling_val_[3]
private

Definition at line 61 of file IpSpralSolverInterface.hpp.

◆ current_level_

int Ipopt::SpralSolverInterface::current_level_
private

Definition at line 62 of file IpSpralSolverInterface.hpp.

◆ dump_

bool Ipopt::SpralSolverInterface::dump_
private

Definition at line 63 of file IpSpralSolverInterface.hpp.


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