Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpIterativePardisoSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpIterativePardisoSolverInterface.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2008-09-18
8 // based on IpPardisoSolverInterface.hpp rev 1119
9
10
11 #ifndef __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
12 #define __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
13
14 #include "IpSparseSymLinearSolverInterface.hpp"
15 #include "IpInexactCq.hpp"
16 #include "IpIterativeSolverTerminationTester.hpp"
17
18 namespace Ipopt
19 {
20
25 class IterativePardisoSolverInterface: public SparseSymLinearSolverInterface
26 {
27 public:
31 IterativePardisoSolverInterface(IterativeSolverTerminationTester& normal_tester,
32 IterativeSolverTerminationTester& pd_tester);
33
35 virtual ~IterativePardisoSolverInterface();
37
39 bool InitializeImpl(const OptionsList& options,
40 const std::string& prefix);
41
42
46 virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
47 const Index *ia,
48 const Index *ja);
49
52 virtual double* GetValuesArrayPtr();
53
55 virtual ESymSolverStatus MultiSolve(bool new_matrix,
56 const Index* ia,
57 const Index* ja,
58 Index nrhs,
59 double* rhs_vals,
60 bool check_NegEVals,
61 Index numberOfNegEVals);
62
66 virtual Index NumberOfNegEVals() const;
68
69 //* @name Options of Linear solver */
71
73 virtual bool IncreaseQuality();
74
78 virtual bool ProvidesInertia() const
79 {
80 return true;
81 }
85 EMatrixFormat MatrixFormat() const
86 {
87 return CSR_Format_1_Offset;
88 }
90
93 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
95
96 private:
106 IterativePardisoSolverInterface();
107
109 IterativePardisoSolverInterface(const IterativePardisoSolverInterface&);
110
112 void operator=(const IterativePardisoSolverInterface&);
114
118 Index dim_;
119
121 Index nonzeros_;
122
124 double* a_;
126
130 Index negevals_;
132
136 enum PardisoMatchingStrategy
137 {
138 COMPLETE,
139 COMPLETE2x2,
140 CONSTRAINT
141 };
143 PardisoMatchingStrategy match_strat_;
146 bool have_symbolic_factorization_;
149 bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_;
153 bool pardiso_repeated_perturbation_means_singular_;
156 bool skip_inertia_check_;
158 Index pardiso_max_droptol_corrections_;
160
163 Index pardiso_max_iter_;
164 Number pardiso_iter_relative_tol_;
165 Index pardiso_iter_coarse_size_;
166 Index pardiso_iter_max_levels_;
167 Number pardiso_iter_dropping_factor_;
168 Number pardiso_iter_dropping_schur_;
169 Index pardiso_iter_max_row_fill_;
170 Number pardiso_iter_inverse_norm_factor_;
171
172 Index normal_pardiso_max_iter_;
173 Number normal_pardiso_iter_relative_tol_;
174 Index normal_pardiso_iter_coarse_size_;
175 Index normal_pardiso_iter_max_levels_;
176 Number normal_pardiso_iter_dropping_factor_;
177 Number normal_pardiso_iter_dropping_schur_;
178 Index normal_pardiso_iter_max_row_fill_;
179 Number normal_pardiso_iter_inverse_norm_factor_;
181
183 Number decr_factor_;
184
187 Number pardiso_iter_dropping_factor_used_;
188 Number pardiso_iter_dropping_schur_used_;
189 Number normal_pardiso_iter_dropping_factor_used_;
190 Number normal_pardiso_iter_dropping_schur_used_;
192
197 bool initialized_;
199
203 void** PT_;
206 ipfint MAXFCT_;
208 ipfint MNUM_;
210 ipfint MTYPE_;
212 ipfint* IPARM_;
214 double* DPARM_;
216 ipfint MSGLVL_;
218
221 Index debug_last_iter_;
222 Index debug_cnt_;
224
229 ESymSolverStatus SymbolicFactorization(const Index* ia,
230 const Index* ja);
231
234 ESymSolverStatus Factorization(const Index* ia,
235 const Index* ja,
236 bool check_NegEVals,
237 Index numberOfNegEVals);
238
241 ESymSolverStatus Solve(const Index* ia,
242 const Index* ja,
243 Index nrhs,
244 double *rhs_vals);
246
248 InexactData& InexData()
249 {
250 InexactData& inexact_data =
251 static_cast<InexactData&>(IpData().AdditionalData());
252 DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
253 return inexact_data;
254 }
255
257 InexactCq& InexCq()
258 {
259 InexactCq& inexact_cq =
260 static_cast<InexactCq&>(IpCq().AdditionalCq());
261 DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
262 return inexact_cq;
263 }
264
266 SmartPtr<IterativeSolverTerminationTester> normal_tester_;
267
269 SmartPtr<IterativeSolverTerminationTester> pd_tester_;
270
271 };
272
273 } // namespace Ipopt
274 #endif
Ipopt::IterativePardisoSolverInterface::IncreaseQuality
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Ipopt::IterativePardisoSolverInterface::MSGLVL_
ipfint MSGLVL_
Message level.
Definition: IpIterativePardisoSolverInterface.hpp:216
Ipopt::IterativePardisoSolverInterface::PT_
void ** PT_
Internal data address pointers.
Definition: IpIterativePardisoSolverInterface.hpp:203
Ipopt::IterativePardisoSolverInterface::Solve
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, double *rhs_vals)
Call Pardiso to do the Solve.
Ipopt::IterativePardisoSolverInterface::pardiso_iter_dropping_schur_used_
Number pardiso_iter_dropping_schur_used_
Definition: IpIterativePardisoSolverInterface.hpp:188
Ipopt::ESymSolverStatus
ESymSolverStatus
Enum to report outcome of a linear solve.
Definition: IpSymLinearSolver.hpp:21
Ipopt::IterativePardisoSolverInterface::negevals_
Index negevals_
Number of negative eigenvalues.
Definition: IpIterativePardisoSolverInterface.hpp:130
ipfint
FORTRAN_INTEGER_TYPE ipfint
Definition: IpTypes.hpp:26
Ipopt::IterativePardisoSolverInterface::normal_tester_
SmartPtr< IterativeSolverTerminationTester > normal_tester_
Termination tester for normal step computation.
Definition: IpIterativePardisoSolverInterface.hpp:266
Ipopt::SparseSymLinearSolverInterface
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Definition: IpSparseSymLinearSolverInterface.hpp:98
Ipopt::IterativePardisoSolverInterface::MAXFCT_
ipfint MAXFCT_
Maximal number of factors with identical nonzero structure.
Definition: IpIterativePardisoSolverInterface.hpp:206
Ipopt::IterativePardisoSolverInterface
Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface.
Definition: IpIterativePardisoSolverInterface.hpp:25
Ipopt::IterativeSolverTerminationTester
This base class is for the termination tests for the iterative linear solver in the inexact version o...
Definition: IpIterativeSolverTerminationTester.hpp:21
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_max_row_fill_
Index normal_pardiso_iter_max_row_fill_
Definition: IpIterativePardisoSolverInterface.hpp:178
Ipopt::IterativePardisoSolverInterface::debug_cnt_
Index debug_cnt_
Definition: IpIterativePardisoSolverInterface.hpp:222
Ipopt::IterativePardisoSolverInterface::InexData
InexactData & InexData()
Method to easily access Inexact data.
Definition: IpIterativePardisoSolverInterface.hpp:248
IpSparseSymLinearSolverInterface.hpp
Ipopt::IterativePardisoSolverInterface::initialized_
bool initialized_
Flag indicating if internal data is initialized.
Definition: IpIterativePardisoSolverInterface.hpp:197
Ipopt::IterativePardisoSolverInterface::MatrixFormat
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
Definition: IpIterativePardisoSolverInterface.hpp:85
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_coarse_size_
Index normal_pardiso_iter_coarse_size_
Definition: IpIterativePardisoSolverInterface.hpp:174
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::IterativePardisoSolverInterface::pardiso_iter_inverse_norm_factor_
Number pardiso_iter_inverse_norm_factor_
Definition: IpIterativePardisoSolverInterface.hpp:170
Ipopt::IterativePardisoSolverInterface::Factorization
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Pardiso to factorize the Matrix.
Ipopt::IpoptCalculatedQuantities::AdditionalCq
IpoptAdditionalCq & AdditionalCq()
Definition: IpIpoptCalculatedQuantities.hpp:452
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_max_levels_
Index normal_pardiso_iter_max_levels_
Definition: IpIterativePardisoSolverInterface.hpp:175
Ipopt::IterativePardisoSolverInterface::MultiSolve
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.
Ipopt::SparseSymLinearSolverInterface::CSR_Format_1_Offset
Compressed sparse row format for lower triangular part, with 1 offset.
Definition: IpSparseSymLinearSolverInterface.hpp:110
Ipopt::IterativePardisoSolverInterface::skip_inertia_check_
bool skip_inertia_check_
Flag indicating if the interia is always assumed to be correct.
Definition: IpIterativePardisoSolverInterface.hpp:156
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_dropping_schur_
Number normal_pardiso_iter_dropping_schur_
Definition: IpIterativePardisoSolverInterface.hpp:177
Ipopt::IterativePardisoSolverInterface::have_symbolic_factorization_
bool have_symbolic_factorization_
Flag indicating if symbolic factorization has already been performed.
Definition: IpIterativePardisoSolverInterface.hpp:146
Ipopt::IterativePardisoSolverInterface::normal_pardiso_max_iter_
Index normal_pardiso_max_iter_
Definition: IpIterativePardisoSolverInterface.hpp:172
Ipopt::IterativePardisoSolverInterface::pardiso_max_iter_
Index pardiso_max_iter_
Options for the preconditioner.
Definition: IpIterativePardisoSolverInterface.hpp:163
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::IterativePardisoSolverInterface::COMPLETE2x2
Definition: IpIterativePardisoSolverInterface.hpp:139
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::IterativePardisoSolverInterface::match_strat_
PardisoMatchingStrategy match_strat_
Option that controls the matching strategy.
Definition: IpIterativePardisoSolverInterface.hpp:143
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_dropping_schur_used_
Number normal_pardiso_iter_dropping_schur_used_
Definition: IpIterativePardisoSolverInterface.hpp:190
Ipopt::IterativePardisoSolverInterface::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for IpoptType.
Ipopt::IterativePardisoSolverInterface::pardiso_iter_max_levels_
Index pardiso_iter_max_levels_
Definition: IpIterativePardisoSolverInterface.hpp:166
Ipopt::IterativePardisoSolverInterface::IterativePardisoSolverInterface
IterativePardisoSolverInterface()
Default Constructor.
Ipopt::IterativePardisoSolverInterface::InitializeImpl
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
Ipopt::IterativePardisoSolverInterface::pd_tester_
SmartPtr< IterativeSolverTerminationTester > pd_tester_
Termination tester for primal-dual step computation.
Definition: IpIterativePardisoSolverInterface.hpp:269
Ipopt::IterativePardisoSolverInterface::debug_last_iter_
Index debug_last_iter_
Definition: IpIterativePardisoSolverInterface.hpp:221
Ipopt::IterativePardisoSolverInterface::DPARM_
double * DPARM_
Parameter and info array for Pardiso.
Definition: IpIterativePardisoSolverInterface.hpp:214
Ipopt::IpoptData::AdditionalData
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Definition: IpIpoptData.hpp:502
Ipopt::IterativePardisoSolverInterface::a_
double * a_
Array for storing the values of the matrix.
Definition: IpIterativePardisoSolverInterface.hpp:124
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_inverse_norm_factor_
Number normal_pardiso_iter_inverse_norm_factor_
Definition: IpIterativePardisoSolverInterface.hpp:179
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::IterativePardisoSolverInterface::NumberOfNegEVals
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
Ipopt::IterativePardisoSolverInterface::pardiso_iter_dropping_factor_used_
Number pardiso_iter_dropping_factor_used_
Actualy used dropping tolerances.
Definition: IpIterativePardisoSolverInterface.hpp:187
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_dropping_factor_used_
Number normal_pardiso_iter_dropping_factor_used_
Definition: IpIterativePardisoSolverInterface.hpp:189
Ipopt::IterativePardisoSolverInterface::CONSTRAINT
Definition: IpIterativePardisoSolverInterface.hpp:140
Ipopt::IterativePardisoSolverInterface::GetValuesArrayPtr
virtual double * GetValuesArrayPtr()
Method returing an internal array into which the nonzero elements are to be stored.
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::IterativePardisoSolverInterface::pardiso_iter_relative_tol_
Number pardiso_iter_relative_tol_
Definition: IpIterativePardisoSolverInterface.hpp:164
Ipopt::IterativePardisoSolverInterface::COMPLETE
Definition: IpIterativePardisoSolverInterface.hpp:138
Ipopt::IterativePardisoSolverInterface::pardiso_repeated_perturbation_means_singular_
bool pardiso_repeated_perturbation_means_singular_
Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be...
Definition: IpIterativePardisoSolverInterface.hpp:153
Ipopt::IterativePardisoSolverInterface::pardiso_redo_symbolic_fact_only_if_inertia_wrong_
bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_
Flag indicating whether the symbolic factorization should only be done after perturbed elements...
Definition: IpIterativePardisoSolverInterface.hpp:149
Ipopt::IterativePardisoSolverInterface::IPARM_
ipfint * IPARM_
Parameter and info array for Pardiso.
Definition: IpIterativePardisoSolverInterface.hpp:212
Ipopt::InexactCq
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Definition: IpInexactCq.hpp:22
Ipopt::InexactData
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
Definition: IpInexactData.hpp:19
Ipopt::SparseSymLinearSolverInterface::EMatrixFormat
EMatrixFormat
Enum to specify sparse matrix format.
Definition: IpSparseSymLinearSolverInterface.hpp:102
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_relative_tol_
Number normal_pardiso_iter_relative_tol_
Definition: IpIterativePardisoSolverInterface.hpp:173
Ipopt::IterativePardisoSolverInterface::pardiso_iter_coarse_size_
Index pardiso_iter_coarse_size_
Definition: IpIterativePardisoSolverInterface.hpp:165
Ipopt::IterativePardisoSolverInterface::~IterativePardisoSolverInterface
virtual ~IterativePardisoSolverInterface()
Destructor.
Ipopt::IterativePardisoSolverInterface::decr_factor_
Number decr_factor_
Decrease factor for dropping tolerances.
Definition: IpIterativePardisoSolverInterface.hpp:183
Ipopt::AlgorithmStrategyObject::IpData
IpoptData & IpData() const
Definition: IpAlgStrategy.hpp:131
Ipopt::IterativePardisoSolverInterface::pardiso_iter_max_row_fill_
Index pardiso_iter_max_row_fill_
Definition: IpIterativePardisoSolverInterface.hpp:169
Ipopt::IterativePardisoSolverInterface::normal_pardiso_iter_dropping_factor_
Number normal_pardiso_iter_dropping_factor_
Definition: IpIterativePardisoSolverInterface.hpp:176
Ipopt::IterativePardisoSolverInterface::pardiso_iter_dropping_factor_
Number pardiso_iter_dropping_factor_
Definition: IpIterativePardisoSolverInterface.hpp:167
Ipopt::IterativePardisoSolverInterface::pardiso_iter_dropping_schur_
Number pardiso_iter_dropping_schur_
Definition: IpIterativePardisoSolverInterface.hpp:168
Ipopt::IterativePardisoSolverInterface::MNUM_
ipfint MNUM_
Actual matrix for the solution phase.
Definition: IpIterativePardisoSolverInterface.hpp:208
IpIterativeSolverTerminationTester.hpp
Ipopt::IterativePardisoSolverInterface::operator=
void operator=(const IterativePardisoSolverInterface &)
Overloaded Equals Operator.
Ipopt::IterativePardisoSolverInterface::SymbolicFactorization
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Pardiso to do the analysis phase.
Ipopt::IterativePardisoSolverInterface::pardiso_max_droptol_corrections_
Index pardiso_max_droptol_corrections_
Maximal number of decreases of drop tolerance during one solve.
Definition: IpIterativePardisoSolverInterface.hpp:158
IpInexactCq.hpp
Ipopt::AlgorithmStrategyObject::IpCq
IpoptCalculatedQuantities & IpCq() const
Definition: IpAlgStrategy.hpp:137
Ipopt::IterativePardisoSolverInterface::nonzeros_
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
Definition: IpIterativePardisoSolverInterface.hpp:121
Ipopt::IterativePardisoSolverInterface::dim_
Index dim_
Number of rows and columns of the matrix.
Definition: IpIterativePardisoSolverInterface.hpp:118
Ipopt::IterativePardisoSolverInterface::InexCq
InexactCq & InexCq()
Method to easily access Inexact calculated quantities.
Definition: IpIterativePardisoSolverInterface.hpp:257
Ipopt::IterativePardisoSolverInterface::MTYPE_
ipfint MTYPE_
Matrix type; real and symmetric indefinite.
Definition: IpIterativePardisoSolverInterface.hpp:210
Ipopt::IterativePardisoSolverInterface::ProvidesInertia
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Definition: IpIterativePardisoSolverInterface.hpp:78
Ipopt::IterativePardisoSolverInterface::InitializeStructure
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal stuctures.
Ipopt::IterativePardisoSolverInterface::PardisoMatchingStrategy
PardisoMatchingStrategy
Type for mathcing strategies.
Definition: IpIterativePardisoSolverInterface.hpp:136