Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpTSymLinearSolver.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2007 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpTSymLinearSolver.hpp 2206 2013-04-13 15:29:15Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-03-17
8
9 #ifndef __IPTSYMLINEARSOLVER_HPP__
10 #define __IPTSYMLINEARSOLVER_HPP__
11
12 #include "IpSymLinearSolver.hpp"
13 #include "IpSparseSymLinearSolverInterface.hpp"
14 #include "IpTSymScalingMethod.hpp"
15 #include "IpSymMatrix.hpp"
16 #include "IpTripletToCSRConverter.hpp"
17 #include <vector>
18 #include <list>
19
20 namespace Ipopt
21 {
22
33 class TSymLinearSolver: public SymLinearSolver
34 {
35 public:
42 TSymLinearSolver(SmartPtr<SparseSymLinearSolverInterface> solver_interface,
43 SmartPtr<TSymScalingMethod> scaling_method);
44
46 virtual ~TSymLinearSolver();
48
50 bool InitializeImpl(const OptionsList& options,
51 const std::string& prefix);
52
58 virtual ESymSolverStatus MultiSolve(const SymMatrix &A,
59 std::vector<SmartPtr<const Vector> >& rhsV,
60 std::vector<SmartPtr<Vector> >& solV,
61 bool check_NegEVals,
62 Index numberOfNegEVals);
63
68 virtual Index NumberOfNegEVals() const;
70
71 //* @name Options of Linear solver */
73
78 virtual bool IncreaseQuality();
79
83 virtual bool ProvidesInertia() const;
85
91 bool ProvidesDegeneracyDetection() const;
96 ESymSolverStatus DetermineDependentRows(Index n_rows, Index n_cols,
97 Index n_jac_nz,
98 Number* jac_c_vals,
99 Index* jac_c_iRow,
100 Index* jac_c_jCol,
101 std::list<Index>& c_deps);
103
106 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
108
109 private:
119 TSymLinearSolver();
120
122 TSymLinearSolver(const TSymLinearSolver&);
123
125 void operator=(const TSymLinearSolver&);
127
131 TaggedObject::Tag atag_;
132
134 Index dim_;
135
139 Index nonzeros_triplet_;
143 Index nonzeros_compressed_;
145
150 bool have_structure_;
153 bool linear_scaling_on_demand_;
156 bool initialized_;
158
160 SmartPtr<SparseSymLinearSolverInterface> solver_interface_;
165 SmartPtr<TSymScalingMethod> scaling_method_;
167 double* scaling_factors_;
169 bool use_scaling_;
171 bool just_switched_on_scaling_;
173
178 Index* airn_;
181 Index* ajcn_;
185 SmartPtr<TripletToCSRConverter> triplet_to_csr_converter_;
187 SparseSymLinearSolverInterface::EMatrixFormat matrix_format_;
189
194 bool warm_start_same_structure_;
196
203 ESymSolverStatus InitializeStructure(const SymMatrix& symT_A);
204
207 void GiveMatrixToSolver(bool new_matrix, const SymMatrix& sym_A);
209 };
210
211 } // namespace Ipopt
212 #endif
Ipopt::TSymLinearSolver::solver_interface_
SmartPtr< SparseSymLinearSolverInterface > solver_interface_
Strategy Object for an interface to a linear solver.
Definition: IpTSymLinearSolver.hpp:160
Ipopt::TSymLinearSolver::have_structure_
bool have_structure_
Flag indicating if the internal structures are initialized.
Definition: IpTSymLinearSolver.hpp:150
Ipopt::TSymLinearSolver::scaling_method_
SmartPtr< TSymScalingMethod > scaling_method_
Strategy Object for a method that computes scaling factors for the matrices.
Definition: IpTSymLinearSolver.hpp:165
Ipopt::ESymSolverStatus
ESymSolverStatus
Enum to report outcome of a linear solve.
Definition: IpSymLinearSolver.hpp:21
Ipopt::TSymLinearSolver::matrix_format_
SparseSymLinearSolverInterface::EMatrixFormat matrix_format_
Flag indicating what matrix data format the solver requires.
Definition: IpTSymLinearSolver.hpp:187
Ipopt::TSymLinearSolver::just_switched_on_scaling_
bool just_switched_on_scaling_
Flag indicating whether we just switched on the scaling.
Definition: IpTSymLinearSolver.hpp:171
IpSymLinearSolver.hpp
IpSymMatrix.hpp
IpSparseSymLinearSolverInterface.hpp
Ipopt::TSymLinearSolver::NumberOfNegEVals
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
Ipopt::TSymLinearSolver::~TSymLinearSolver
virtual ~TSymLinearSolver()
Destructor.
Ipopt::TSymLinearSolver::warm_start_same_structure_
bool warm_start_same_structure_
Flag indicating whether the TNLP with identical structure has already been solved before...
Definition: IpTSymLinearSolver.hpp:194
Ipopt::TSymLinearSolver
General driver for linear solvers for sparse indefinite symmetric matrices.
Definition: IpTSymLinearSolver.hpp:33
IpTripletToCSRConverter.hpp
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
IpTSymScalingMethod.hpp
Ipopt::TSymLinearSolver::MultiSolve
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.
Ipopt::TSymLinearSolver::airn_
Index * airn_
row indices of matrix in triplet (MA27) format.
Definition: IpTSymLinearSolver.hpp:178
Ipopt::TSymLinearSolver::InitializeStructure
ESymSolverStatus InitializeStructure(const SymMatrix &symT_A)
Initialize nonzero structure.
Ipopt::TSymLinearSolver::InitializeImpl
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
Ipopt::TSymLinearSolver::TSymLinearSolver
TSymLinearSolver()
Default Constructor.
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:23
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::TSymLinearSolver::nonzeros_triplet_
Index nonzeros_triplet_
Number of nonzeros of the matrix in triplet format.
Definition: IpTSymLinearSolver.hpp:139
Ipopt::TSymLinearSolver::GiveMatrixToSolver
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 ...
Ipopt::TSymLinearSolver::DetermineDependentRows
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 th...
Ipopt::TSymLinearSolver::ajcn_
Index * ajcn_
column indices of matrix in triplet (MA27) format.
Definition: IpTSymLinearSolver.hpp:181
Ipopt::TSymLinearSolver::operator=
void operator=(const TSymLinearSolver &)
Overloaded Equals Operator.
Ipopt::TSymLinearSolver::triplet_to_csr_converter_
SmartPtr< TripletToCSRConverter > triplet_to_csr_converter_
Pointer to object for conversion from triplet to compressed format.
Definition: IpTSymLinearSolver.hpp:185
Ipopt::TSymLinearSolver::linear_scaling_on_demand_
bool linear_scaling_on_demand_
Flag indicating whether the scaling objected is to be switched on when increased quality is requested...
Definition: IpTSymLinearSolver.hpp:153
Ipopt::TSymLinearSolver::use_scaling_
bool use_scaling_
Flag indicating whether scaling should be performed.
Definition: IpTSymLinearSolver.hpp:169
Ipopt::TSymLinearSolver::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::TSymLinearSolver::scaling_factors_
double * scaling_factors_
Array storing the scaling factors.
Definition: IpTSymLinearSolver.hpp:167
Ipopt::TaggedObject::Tag
unsigned int Tag
Type for the Tag values.
Definition: IpTaggedObject.hpp:80
Ipopt::SparseSymLinearSolverInterface::EMatrixFormat
EMatrixFormat
Enum to specify sparse matrix format.
Definition: IpSparseSymLinearSolverInterface.hpp:102
Ipopt::TSymLinearSolver::ProvidesDegeneracyDetection
bool ProvidesDegeneracyDetection() const
Returns true if the underlying linear solver can detect the linearly dependent rows in a matrix...
Ipopt::TSymLinearSolver::atag_
TaggedObject::Tag atag_
Tag for the incoming matrix.
Definition: IpTSymLinearSolver.hpp:131
Ipopt::SymLinearSolver
Base class for all derived symmetric linear solvers.
Definition: IpSymLinearSolver.hpp:50
Ipopt::TSymLinearSolver::IncreaseQuality
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Ipopt::TSymLinearSolver::ProvidesInertia
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Ipopt::TSymLinearSolver::dim_
Index dim_
Number of rows and columns of the matrix.
Definition: IpTSymLinearSolver.hpp:134
Ipopt::TSymLinearSolver::initialized_
bool initialized_
Flag indicating if the InitializeStructure method has been called for the linear solver.
Definition: IpTSymLinearSolver.hpp:156
Ipopt::TSymLinearSolver::nonzeros_compressed_
Index nonzeros_compressed_
Number of nonzeros in compressed format.
Definition: IpTSymLinearSolver.hpp:143