General driver for linear solvers for sparse indefinite symmetric matrices. More...
#include <IpTSymLinearSolver.hpp>
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 | |
TSymLinearSolver (SmartPtr< SparseSymLinearSolverInterface > solver_interface, SmartPtr< TSymScalingMethod > scaling_method) | |
Constructor. | |
virtual | ~TSymLinearSolver () |
Destructor. | |
Methods for requesting solution of the linear system. | |
virtual ESymSolverStatus | MultiSolve (const SymMatrix &A, std::vector< SmartPtr< const Vector > > &rhsV, std::vector< SmartPtr< Vector > > &solV, 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. | |
Methods related to the detection of linearly dependent | |
rows in a matrix | |
bool | ProvidesDegeneracyDetection () const |
ESymSolverStatus | DetermineDependentRows (Index n_rows, Index n_cols, Index n_jac_nz, Number *jac_c_vals, Index *jac_c_iRow, Index *jac_c_jCol, std::list< Index > &c_deps) |
Public Member Functions inherited from Ipopt::SymLinearSolver | |
SymLinearSolver () | |
virtual | ~SymLinearSolver () |
ESymSolverStatus | Solve (const SymMatrix &A, const Vector &rhs, Vector &sol, bool check_NegEVals, Index numberOfNegEVals) |
Solve operation for a single right hand side. | |
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) |
Methods for OptionsList. | |
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. | |
TSymLinearSolver () | |
Default Constructor. | |
TSymLinearSolver (const TSymLinearSolver &) | |
Copy Constructor. | |
void | operator= (const TSymLinearSolver &) |
Default Assignment Operator. | |
Internal functions | |
ESymSolverStatus | InitializeStructure (const SymMatrix &symT_A) |
Initialize nonzero structure. | |
void | GiveMatrixToSolver (bool new_matrix, const SymMatrix &sym_A) |
Copy the elements of the matrix in the required format into the array that is provided by the solver interface. | |
Private Attributes | |
SmartPtr< SparseSymLinearSolverInterface > | solver_interface_ |
Strategy Object for an interface to a linear solver. | |
Information about the matrix | |
TaggedObject::Tag | atag_ |
Tag for the incoming matrix. | |
Index | dim_ |
Number of rows and columns of the matrix. | |
Index | nonzeros_triplet_ |
Number of nonzeros of the matrix in triplet format. | |
Index | nonzeros_compressed_ |
Number of nonzeros in compressed format. | |
Initialization flags | |
bool | have_structure_ |
Flag indicating if the internal structures are initialized. | |
bool | linear_scaling_on_demand_ |
Flag indicating whether the scaling objected is to be switched on when increased quality is requested. | |
bool | initialized_ |
Flag indicating if the InitializeStructure method has been called for the linear solver. | |
Stuff for scaling of the linear system. | |
SmartPtr< TSymScalingMethod > | scaling_method_ |
Strategy Object for a method that computes scaling factors for the matrices. | |
Number * | scaling_factors_ |
Array storing the scaling factors. | |
bool | use_scaling_ |
Flag indicating whether scaling should be performed. | |
bool | just_switched_on_scaling_ |
Flag indicating whether we just switched on the scaling. | |
information about the matrix. | |
Index * | airn_ |
row indices of matrix in triplet (MA27) format. | |
Index * | ajcn_ |
column indices of matrix in triplet (MA27) format. | |
SmartPtr< TripletToCSRConverter > | triplet_to_csr_converter_ |
Pointer to object for conversion from triplet to compressed format. | |
SparseSymLinearSolverInterface::EMatrixFormat | matrix_format_ |
Flag indicating what matrix data format the solver requires. | |
Algorithmic parameters | |
bool | warm_start_same_structure_ |
Flag indicating whether the TNLP with identical structure has already been solved before. | |
Additional Inherited Members | |
Protected Member Functions inherited from Ipopt::AlgorithmStrategyObject | |
const Journalist & | Jnlst () const |
IpoptNLP & | IpNLP () const |
IpoptData & | IpData () const |
IpoptCalculatedQuantities & | IpCq () const |
bool | HaveIpData () const |
General driver for linear solvers for sparse indefinite symmetric matrices.
This interface includes a call to a method for scaling of the matrix (if given). This class takes in the constructor a pointer to the interface to an actual linear solver, and possibly a pointer to a method for computing scaling factors. It translates the SymMatrix into the format required by the linear solver and calls the solver via the TSymLinearSolverInterface. If a scaling method has been given, the matrix, the right hand side, and the solution are scaled.
Definition at line 33 of file IpTSymLinearSolver.hpp.
Ipopt::TSymLinearSolver::TSymLinearSolver | ( | SmartPtr< SparseSymLinearSolverInterface > | solver_interface, |
SmartPtr< TSymScalingMethod > | scaling_method | ||
) |
Constructor.
The solver_interface is a pointer to a linear solver for symmetric matrices in triplet format. If scaling_method not NULL, it must be a pointer to a class for computing scaling factors for the matrix.
|
virtual |
Destructor.
|
private |
Default Constructor.
|
private |
Copy Constructor.
|
virtual |
Implementation of the initialization method that has to be overloaded by for each derived class.
Implements Ipopt::SymLinearSolver.
|
virtual |
Solve operation for multiple right hand sides.
Solves the linear system A * Sol = Rhs with multiple right hand sides. If necessary, A is factorized. Correct solutions are only guaranteed if the return values is SYMSOLVER_SUCCESS. The solver will return SYMSOLVER_SINGULAR if the linear system is singular, and it will return SYMSOLVER_WRONG_INERTIA if check_NegEVals is true and the number of negative eigenvalues in the matrix does not match numberOfNegEVals.
check_NegEVals cannot be chosen true, if ProvidesInertia() returns false.
Implements Ipopt::SymLinearSolver.
Number of negative eigenvalues detected during last factorization.
This must not be called if the linear solver does not compute this quantities (see ProvidesInertia).
Implements Ipopt::SymLinearSolver.
Request to increase quality of solution for next solve.
Ask linear solver to increase quality of solution for the next solve (e.g. increase pivot tolerance).
Implements Ipopt::SymLinearSolver.
Query whether inertia is computed by linear solver.
Implements Ipopt::SymLinearSolver.
bool Ipopt::TSymLinearSolver::ProvidesDegeneracyDetection | ( | ) | const |
ESymSolverStatus Ipopt::TSymLinearSolver::DetermineDependentRows | ( | Index | n_rows, |
Index | n_cols, | ||
Index | n_jac_nz, | ||
Number * | jac_c_vals, | ||
Index * | jac_c_iRow, | ||
Index * | jac_c_jCol, | ||
std::list< Index > & | c_deps | ||
) |
|
static |
Methods for OptionsList.
|
private |
Default Assignment Operator.
|
private |
Initialize nonzero structure.
Set dim_ and nonzeros_, and copy the nonzero structure of symT_A into airn_ and ajcn_.
|
private |
Copy the elements of the matrix in the required format into the array that is provided by the solver interface.
|
private |
Tag for the incoming matrix.
Definition at line 128 of file IpTSymLinearSolver.hpp.
|
private |
Number of rows and columns of the matrix.
Definition at line 131 of file IpTSymLinearSolver.hpp.
|
private |
Number of nonzeros of the matrix in triplet format.
Note that some elements might appear multiple times in which case the values are added.
Definition at line 138 of file IpTSymLinearSolver.hpp.
|
private |
Number of nonzeros in compressed format.
This is only computed if the sparse linear solver works with the CSR format.
Definition at line 144 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating if the internal structures are initialized.
For initialization, this object needs to have seen a matrix.
Definition at line 153 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating whether the scaling objected is to be switched on when increased quality is requested.
Definition at line 157 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating if the InitializeStructure method has been called for the linear solver.
Definition at line 161 of file IpTSymLinearSolver.hpp.
|
private |
Strategy Object for an interface to a linear solver.
Definition at line 165 of file IpTSymLinearSolver.hpp.
|
private |
Strategy Object for a method that computes scaling factors for the matrices.
If NULL, no scaling is performed.
Definition at line 173 of file IpTSymLinearSolver.hpp.
|
private |
Array storing the scaling factors.
Definition at line 175 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating whether scaling should be performed.
Definition at line 177 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating whether we just switched on the scaling.
Definition at line 179 of file IpTSymLinearSolver.hpp.
|
private |
row indices of matrix in triplet (MA27) format.
Definition at line 185 of file IpTSymLinearSolver.hpp.
|
private |
column indices of matrix in triplet (MA27) format.
Definition at line 187 of file IpTSymLinearSolver.hpp.
|
private |
Pointer to object for conversion from triplet to compressed format.
This is only required if the linear solver works with the compressed representation.
Definition at line 193 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating what matrix data format the solver requires.
Definition at line 195 of file IpTSymLinearSolver.hpp.
|
private |
Flag indicating whether the TNLP with identical structure has already been solved before.
Definition at line 203 of file IpTSymLinearSolver.hpp.