Ipopt  3.12.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
Ipopt::TSymLinearSolver Class Reference

General driver for linear solvers for sparse indefinite symmetric matrices. More...

#include <IpTSymLinearSolver.hpp>

+ Inheritance diagram for Ipopt::TSymLinearSolver:

Public Member Functions

bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 overloaded from AlgorithmStrategyObject More...
 
Constructor/Destructor
 TSymLinearSolver (SmartPtr< SparseSymLinearSolverInterface > solver_interface, SmartPtr< TSymScalingMethod > scaling_method)
 Constructor. More...
 
virtual ~TSymLinearSolver ()
 Destructor. More...
 
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. 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...
 
Methods related to the detection of linearly dependent

rows in a matrix

bool ProvidesDegeneracyDetection () const
 Returns true if the underlying linear solver can detect the linearly dependent rows in a matrix. More...
 
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)
 Given the entries of a matrix in Triplet format, this method determines the list of row indices of the linearly dependent rows. More...
 
- 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. More...
 
- 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. 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...
 
 AlgorithmStrategyObject ()
 Default Constructor. More...
 
virtual ~AlgorithmStrategyObject ()
 Default Destructor. 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
 

Static Public Member Functions

static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 Methods for OptionsList. More...
 

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. More...
 
 TSymLinearSolver (const TSymLinearSolver &)
 Copy Constructor. More...
 
void operator= (const TSymLinearSolver &)
 Overloaded Equals Operator. More...
 
Internal functions
ESymSolverStatus InitializeStructure (const SymMatrix &symT_A)
 Initialize nonzero structure. More...
 
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. More...
 

Private Attributes

SmartPtr
< SparseSymLinearSolverInterface
solver_interface_
 Strategy Object for an interface to a linear solver. More...
 
Information about the matrix
TaggedObject::Tag atag_
 Tag for the incoming matrix. More...
 
Index dim_
 Number of rows and columns of the matrix. More...
 
Index nonzeros_triplet_
 Number of nonzeros of the matrix in triplet format. More...
 
Index nonzeros_compressed_
 Number of nonzeros in compressed format. More...
 
Initialization flags
bool have_structure_
 Flag indicating if the internal structures are initialized. More...
 
bool linear_scaling_on_demand_
 Flag indicating whether the scaling objected is to be switched on when increased quality is requested. More...
 
bool initialized_
 Flag indicating if the InitializeStructure method has been called for the linear solver. More...
 
Stuff for scaling of the linear system.
SmartPtr< TSymScalingMethodscaling_method_
 Strategy Object for a method that computes scaling factors for the matrices. More...
 
double * scaling_factors_
 Array storing the scaling factors. More...
 
bool use_scaling_
 Flag indicating whether scaling should be performed. More...
 
bool just_switched_on_scaling_
 Flag indicating whether we just switched on the scaling. More...
 
information about the matrix.
Indexairn_
 row indices of matrix in triplet (MA27) format. More...
 
Indexajcn_
 column indices of matrix in triplet (MA27) format. More...
 
SmartPtr< TripletToCSRConvertertriplet_to_csr_converter_
 Pointer to object for conversion from triplet to compressed format. More...
 
SparseSymLinearSolverInterface::EMatrixFormat matrix_format_
 Flag indicating what matrix data format the solver requires. More...
 
Algorithmic parameters
bool warm_start_same_structure_
 Flag indicating whether the TNLP with identical structure has already been solved before. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ipopt::AlgorithmStrategyObject
const JournalistJnlst () const
 
IpoptNLPIpNLP () const
 
IpoptDataIpData () const
 
IpoptCalculatedQuantitiesIpCq () const
 
bool HaveIpData () const
 

Detailed Description

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

Constructor & Destructor Documentation

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 Ipopt::TSymLinearSolver::~TSymLinearSolver ( )
virtual

Destructor.

Ipopt::TSymLinearSolver::TSymLinearSolver ( )
private

Default Constructor.

Ipopt::TSymLinearSolver::TSymLinearSolver ( const TSymLinearSolver )
private

Copy Constructor.

Member Function Documentation

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

overloaded from AlgorithmStrategyObject

Implements Ipopt::SymLinearSolver.

virtual ESymSolverStatus Ipopt::TSymLinearSolver::MultiSolve ( const SymMatrix A,
std::vector< SmartPtr< const Vector > > &  rhsV,
std::vector< SmartPtr< Vector > > &  solV,
bool  check_NegEVals,
Index  numberOfNegEVals 
)
virtual

Solve operation for multiple right hand sides.

For details see the description in the base class SymLinearSolver.

Implements Ipopt::SymLinearSolver.

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

Number of negative eigenvalues detected during last factorization.

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

Implements Ipopt::SymLinearSolver.

virtual bool Ipopt::TSymLinearSolver::IncreaseQuality ( )
virtual

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). Returns false, if this is not possible (e.g. maximal pivot tolerance already used.)

Implements Ipopt::SymLinearSolver.

virtual bool Ipopt::TSymLinearSolver::ProvidesInertia ( ) const
virtual

Query whether inertia is computed by linear solver.

Returns true, if linear solver provides inertia.

Implements Ipopt::SymLinearSolver.

bool Ipopt::TSymLinearSolver::ProvidesDegeneracyDetection ( ) const

Returns true if the underlying linear solver can detect the linearly dependent rows in a matrix.

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 
)

Given the entries of a matrix in Triplet format, this method determines the list of row indices of the linearly dependent rows.

This is a specific implementation for Triplet matrices.

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

Methods for OptionsList.

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

Overloaded Equals Operator.

ESymSolverStatus Ipopt::TSymLinearSolver::InitializeStructure ( const SymMatrix symT_A)
private

Initialize nonzero structure.

Set dim_ and nonzeros_, and copy the nonzero structure of symT_A into airn_ and ajcn_

void Ipopt::TSymLinearSolver::GiveMatrixToSolver ( bool  new_matrix,
const SymMatrix sym_A 
)
private

Copy the elements of the matrix in the required format into the array that is provided by the solver interface.

Member Data Documentation

TaggedObject::Tag Ipopt::TSymLinearSolver::atag_
private

Tag for the incoming matrix.

Definition at line 131 of file IpTSymLinearSolver.hpp.

Index Ipopt::TSymLinearSolver::dim_
private

Number of rows and columns of the matrix.

Definition at line 134 of file IpTSymLinearSolver.hpp.

Index Ipopt::TSymLinearSolver::nonzeros_triplet_
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 139 of file IpTSymLinearSolver.hpp.

Index Ipopt::TSymLinearSolver::nonzeros_compressed_
private

Number of nonzeros in compressed format.

This is only computed if the sparse linear solver works with the CSR format.

Definition at line 143 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::have_structure_
private

Flag indicating if the internal structures are initialized.

For initialization, this object needs to have seen a matrix

Definition at line 150 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::linear_scaling_on_demand_
private

Flag indicating whether the scaling objected is to be switched on when increased quality is requested.

Definition at line 153 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::initialized_
private

Flag indicating if the InitializeStructure method has been called for the linear solver.

Definition at line 156 of file IpTSymLinearSolver.hpp.

SmartPtr<SparseSymLinearSolverInterface> Ipopt::TSymLinearSolver::solver_interface_
private

Strategy Object for an interface to a linear solver.

Definition at line 160 of file IpTSymLinearSolver.hpp.

SmartPtr<TSymScalingMethod> Ipopt::TSymLinearSolver::scaling_method_
private

Strategy Object for a method that computes scaling factors for the matrices.

If NULL, no scaling is performed.

Definition at line 165 of file IpTSymLinearSolver.hpp.

double* Ipopt::TSymLinearSolver::scaling_factors_
private

Array storing the scaling factors.

Definition at line 167 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::use_scaling_
private

Flag indicating whether scaling should be performed.

Definition at line 169 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::just_switched_on_scaling_
private

Flag indicating whether we just switched on the scaling.

Definition at line 171 of file IpTSymLinearSolver.hpp.

Index* Ipopt::TSymLinearSolver::airn_
private

row indices of matrix in triplet (MA27) format.

Definition at line 178 of file IpTSymLinearSolver.hpp.

Index* Ipopt::TSymLinearSolver::ajcn_
private

column indices of matrix in triplet (MA27) format.

Definition at line 181 of file IpTSymLinearSolver.hpp.

SmartPtr<TripletToCSRConverter> Ipopt::TSymLinearSolver::triplet_to_csr_converter_
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 185 of file IpTSymLinearSolver.hpp.

SparseSymLinearSolverInterface::EMatrixFormat Ipopt::TSymLinearSolver::matrix_format_
private

Flag indicating what matrix data format the solver requires.

Definition at line 187 of file IpTSymLinearSolver.hpp.

bool Ipopt::TSymLinearSolver::warm_start_same_structure_
private

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

Definition at line 194 of file IpTSymLinearSolver.hpp.


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