Ipopt Documentation  
 
Loading...
Searching...
No Matches
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// Authors: Andreas Waechter IBM 2008-09-18
6// based on IpPardisoSolverInterface.hpp rev 1119
7
8#ifndef __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
9#define __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
10
12#include "IpInexactCq.hpp"
14#include "IpPardisoSolverInterface.hpp" // for IPOPT_DECL_... macros
15#include "IpTypes.h"
16
17#define IPOPT_DECL_SETIPOPTCALLBACKFUNCTION(x) void (x)( \
18 int (*IpoptFunction)( \
19 int n, \
20 ipnumber* xx, \
21 ipnumber* r, \
22 int k, \
23 ipnumber b \
24 ) \
25)
26
27namespace Ipopt
28{
29
34{
35public:
38
42 SmartPtr<LibraryLoader> pardisoloader_
43 );
44
48
50 const OptionsList& options,
51 const std::string& prefix
52 );
53
56
58 Index dim,
59 Index nonzeros,
60 const Index* ia,
61 const Index* ja
62 );
63
68
71 bool new_matrix,
72 const Index* ia,
73 const Index* ja,
74 Index nrhs,
75 Number* rhs_vals,
76 bool check_NegEVals,
77 Index numberOfNegEVals
78 );
79
83 virtual Index NumberOfNegEVals() const;
85
86 //* @name Options of Linear solver */
88
90 virtual bool IncreaseQuality();
91
96 virtual bool ProvidesInertia() const
97 {
98 return true;
99 }
100
105 {
106 return CSR_Format_1_Offset;
107 }
109
110 static void RegisterOptions(
112 );
113
114private:
125
127
131 );
132
136 );
138
141
143
146
150
153
156
159
186
197
207
210
218
221
227
230
231 void** PT_;
248
254
259
263
269
271 const Index* ia,
272 const Index* ja
273 );
274
277 const Index* ia,
278 const Index* ja,
279 bool check_NegEVals,
280 Index numberOfNegEVals
281 );
282
286 const Index* ia,
287 const Index* ja,
288 Index nrhs,
289 Number* rhs_vals
290 );
292
295 {
296 InexactData& inexact_data = static_cast<InexactData&>(IpData().AdditionalData());
297 DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
298 return inexact_data;
299 }
300
303 {
304 InexactCq& inexact_cq = static_cast<InexactCq&>(IpCq().AdditionalCq());
305 DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
306 return inexact_cq;
307 }
308
311
314
315};
316
317} // namespace Ipopt
318
319#endif
#define DBG_ASSERT(test)
Definition IpDebug.hpp:27
#define IPOPT_DECL_SETIPOPTCALLBACKFUNCTION(x)
#define IPOPT_DECL_PARDISO(x)
#define IPOPT_DECL_PARDISOINIT(x)
IpoptCalculatedQuantities & IpCq() const
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm.
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface.
SmartPtr< IterativeSolverTerminationTester > normal_tester_
Termination tester for normal step computation.
Number * DPARM_
Parameter and info array for Pardiso.
virtual ESymSolverStatus MultiSolve(bool new_matrix, const Index *ia, const Index *ja, Index nrhs, Number *rhs_vals, bool check_NegEVals, Index numberOfNegEVals)
Solve operation for multiple right hand sides.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Number pardiso_iter_dropping_factor_used_
Actually used dropping tolerances.
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, Number *rhs_vals)
Call Pardiso to do the Solve.
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
bool have_symbolic_factorization_
Flag indicating if symbolic factorization has already been performed.
Index MTYPE_
Matrix type; real and symmetric indefinite.
IterativePardisoSolverInterface(const IterativePardisoSolverInterface &)
Copy Constructor.
IterativePardisoSolverInterface()
Default Constructor.
InexactData & InexData()
Method to easily access Inexact data.
bool skip_inertia_check_
Flag indicating if the inertia is always assumed to be correct.
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Pardiso to factorize the Matrix.
IterativePardisoSolverInterface(IterativeSolverTerminationTester &normal_tester, IterativeSolverTerminationTester &pd_tester, SmartPtr< LibraryLoader > pardisoloader_)
Constructor.
void operator=(const IterativePardisoSolverInterface &)
Overloaded Assignment Operator.
SmartPtr< IterativeSolverTerminationTester > pd_tester_
Termination tester for primal-dual step computation.
Number decr_factor_
Decrease factor for dropping tolerances.
Index MAXFCT_
Maximal number of factors with identical nonzero structure.
virtual Number * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements are to be stored.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class.
IPOPT_DECL_SETIPOPTCALLBACKFUNCTION * SetIpoptCallbackFunction
Index MNUM_
Actual matrix for the solution phase.
Index dim_
Number of rows and columns of the matrix.
Index pardiso_max_droptol_corrections_
Maximal number of decreases of drop tolerance during one solve.
Number * a_
Array for storing the values of the matrix.
PardisoMatchingStrategy match_strat_
Option that controls the matching strategy.
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Pardiso to do the analysis phase.
InexactCq & InexCq()
Method to easily access Inexact calculated quantities.
bool initialized_
Flag indicating if internal data is initialized.
Index * IPARM_
Parameter and info array for Pardiso.
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.
bool pardiso_repeated_perturbation_means_singular_
Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be...
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_
Flag indicating whether the symbolic factorization should only be done after perturbed elements,...
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
virtual ~IterativePardisoSolverInterface()
Destructor.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
This base class is for the termination tests for the iterative linear solver in the inexact version o...
This class stores a list of user set options.
Template class for Smart Pointers.
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
@ CSR_Format_1_Offset
Compressed sparse row format for upper triangular part, with 1 offset.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ESymSolverStatus
Enum to report outcome of a linear solve.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17