Ipopt Documentation  
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 
27 namespace Ipopt
28 {
29 
34 {
35 public:
37 
40  IterativeSolverTerminationTester& normal_tester,
42  SmartPtr<LibraryLoader> pardisoloader_
43  );
44 
48 
49  bool InitializeImpl(
50  const OptionsList& options,
51  const std::string& prefix
52  );
53 
55 
58  Index dim,
59  Index nonzeros,
60  const Index* ia,
61  const Index* ja
62  );
63 
67  virtual Number* GetValuesArrayPtr();
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 
114 private:
124 
127 
131  );
132 
134  void operator=(
136  );
138 
140 
143 
146 
150 
152 
156 
158 
161  {
165  };
186 
197 
207 
210 
218 
220 
227 
229 
231  void** PT_;
248 
254 
259 
263 
268 
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 IPOPT_DECL_PARDISO(x)
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
ESymSolverStatus
Enum to report outcome of a linear solve.
#define IPOPT_DECL_SETIPOPTCALLBACKFUNCTION(x)
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
SmartPtr< IterativeSolverTerminationTester > normal_tester_
Termination tester for normal step computation.
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface.
This base class is for the termination tests for the iterative linear solver in the inexact version o...
InexactData & InexData()
Method to easily access Inexact data.
bool initialized_
Flag indicating if internal data is initialized.
Index MNUM_
Actual matrix for the solution phase.
Index * IPARM_
Parameter and info array for Pardiso.
IpoptCalculatedQuantities & IpCq() const
virtual Number * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements are to be stored.
Index MAXFCT_
Maximal number of factors with identical nonzero structure.
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Pardiso to factorize the Matrix.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
Compressed sparse row format for lower triangular part, with 1 offset.
bool skip_inertia_check_
Flag indicating if the inertia is always assumed to be correct.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
bool have_symbolic_factorization_
Flag indicating if symbolic factorization has already been performed.
Index pardiso_max_iter_
Options for the preconditioner.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:164
Number * DPARM_
Parameter and info array for Pardiso.
This class stores a list of user set options.
PardisoMatchingStrategy match_strat_
Option that controls the matching strategy.
Number * a_
Array for storing the values of the matrix.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
IterativePardisoSolverInterface()
Default Constructor.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class...
SmartPtr< IterativeSolverTerminationTester > pd_tester_
Termination tester for primal-dual step computation.
#define IPOPT_DECL_PARDISOINIT(x)
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
ipnumber Number
Type of all numbers.
Definition: IpTypes.hpp:17
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.
Number pardiso_iter_dropping_factor_used_
Actually used dropping tolerances.
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:27
IPOPT_DECL_SETIPOPTCALLBACKFUNCTION * SetIpoptCallbackFunction
bool pardiso_repeated_perturbation_means_singular_
Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be...
bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_
Flag indicating whether the symbolic factorization should only be done after perturbed elements...
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Definition: IpInexactCq.hpp:20
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
EMatrixFormat
Enum to specify sparse matrix format.
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
virtual ~IterativePardisoSolverInterface()
Destructor.
Number decr_factor_
Decrease factor for dropping tolerances.
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, Number *rhs_vals)
Call Pardiso to do the Solve.
void operator=(const IterativePardisoSolverInterface &)
Overloaded Assignment Operator.
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Pardiso to do the analysis phase.
Index pardiso_max_droptol_corrections_
Maximal number of decreases of drop tolerance during one solve.
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
Index dim_
Number of rows and columns of the matrix.
InexactCq & InexCq()
Method to easily access Inexact calculated quantities.
Index MTYPE_
Matrix type; real and symmetric indefinite.
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.