Ipopt  3.12.8
IpPardisoSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2010 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpPardisoSolverInterface.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2005-03-17
8 
9 
10 #ifndef __IPPARDISOSOLVERINTERFACE_HPP__
11 #define __IPPARDISOSOLVERINTERFACE_HPP__
12 
14 
15 //#define PARDISO_MATCHING_PREPROCESS
16 
17 namespace Ipopt
18 {
19 
25  {
26  public:
31 
33  virtual ~PardisoSolverInterface();
35 
37  bool InitializeImpl(const OptionsList& options,
38  const std::string& prefix);
39 
40 
44  virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
45  const Index *ia,
46  const Index *ja);
47 
50  virtual double* GetValuesArrayPtr();
51 
53  virtual ESymSolverStatus MultiSolve(bool new_matrix,
54  const Index* ia,
55  const Index* ja,
56  Index nrhs,
57  double* rhs_vals,
58  bool check_NegEVals,
59  Index numberOfNegEVals);
60 
64  virtual Index NumberOfNegEVals() const;
66 
67  //* @name Options of Linear solver */
69 
71  virtual bool IncreaseQuality();
72 
76  virtual bool ProvidesInertia() const
77  {
78  return true;
79  }
84  {
85  return CSR_Format_1_Offset;
86  }
88 
91  static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
93 
94  private:
105 
107  void operator=(const PardisoSolverInterface&);
109 
114 
117 
119  double* a_;
121 
122 #ifdef PARDISO_MATCHING_PREPROCESS
123 
124  ipfint* ia2;
125  ipfint* ja2;
126  double* a2_;
127  ipfint* perm2;
128  double* scale2;
129 
130 #endif
131 
137 
142  {
146  };
168 
175 
179  void** PT_;
190  double* DPARM_;
194 
200 
206  const Index* ja);
207 
211  const Index* ja,
212  bool check_NegEVals,
213  Index numberOfNegEVals);
214 
217  ESymSolverStatus Solve(const Index* ia,
218  const Index* ja,
219  Index nrhs,
220  double *rhs_vals);
222  };
223 
224 } // namespace Ipopt
225 #endif
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
double * a_
Array for storing the values of the matrix.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
ESymSolverStatus
Enum to report outcome of a linear solve.
FORTRAN_INTEGER_TYPE ipfint
Definition: IpTypes.hpp:26
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Index pardiso_max_droptol_corrections_
Maximal number of decreases of drop tolerance during one solve.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for IpoptType.
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
bool initialized_
Flag indicating if internal data is initialized.
PardisoMatchingStrategy match_strat_
Option that controls the matching strategy.
PardisoMatchingStrategy
Type for mathcing strategies.
PardisoSolverInterface()
Constructor.
bool skip_inertia_check_
Flag indicating if the interia is always assumed to be correct.
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Pardiso to do the analysis phase.
Compressed sparse row format for lower triangular part, with 1 offset.
ipfint MAXFCT_
Maximal number of factors with identical nonzero structure.
double * DPARM_
Parameter and info array for Pardiso.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal stuctures.
This class stores a list of user set options.
ipfint * IPARM_
Parameter and info array for Pardiso.
bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_
Flag indicating whether the symbolic factorization should only be done after perturbed elements...
Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface.
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, double *rhs_vals)
Call Pardiso to do the Solve.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Index negevals_
Number of negative eigenvalues.
virtual double * GetValuesArrayPtr()
Method returing an internal array into which the nonzero elements are to be stored.
ipfint MNUM_
Actual matrix for the solution phase.
void operator=(const PardisoSolverInterface &)
Overloaded Equals Operator.
bool pardiso_repeated_perturbation_means_singular_
Flag indicating whether repeated perturbed elements even after a new symbolic factorization should be...
bool pardiso_iterative_
Flag indicating whether we are using the iterative solver in Pardiso.
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.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
EMatrixFormat
Enum to specify sparse matrix format.
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
void ** PT_
Internal data address pointers.
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Pardiso to factorize the Matrix.
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
ipfint MTYPE_
Matrix type; real and symmetric indefinite.
virtual ~PardisoSolverInterface()
Destructor.
bool have_symbolic_factorization_
Flag indicating if symbolic factorization has already been performed.
Index dim_
Number of rows and columns of the matrix.