Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
13 #include "IpSparseSymLinearSolverInterface.hpp"
14
15 //#define PARDISO_MATCHING_PREPROCESS
16
17 namespace Ipopt
18 {
19
24 class PardisoSolverInterface: public SparseSymLinearSolverInterface
25 {
26 public:
30 PardisoSolverInterface();
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 }
83 EMatrixFormat MatrixFormat() const
84 {
85 return CSR_Format_1_Offset;
86 }
88
91 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
93
94 private:
104 PardisoSolverInterface(const PardisoSolverInterface&);
105
107 void operator=(const PardisoSolverInterface&);
109
113 Index dim_;
114
116 Index nonzeros_;
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
135 Index negevals_;
137
141 enum PardisoMatchingStrategy
142 {
143 COMPLETE,
144 COMPLETE2x2,
145 CONSTRAINT
146 };
148 PardisoMatchingStrategy match_strat_;
151 bool have_symbolic_factorization_;
154 bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_;
158 bool pardiso_repeated_perturbation_means_singular_;
161 bool skip_inertia_check_;
164 bool pardiso_iterative_;
166 Index pardiso_max_droptol_corrections_;
168
173 bool initialized_;
175
179 void** PT_;
182 ipfint MAXFCT_;
184 ipfint MNUM_;
186 ipfint MTYPE_;
188 ipfint* IPARM_;
190 double* DPARM_;
192 ipfint MSGLVL_;
194
197 Index debug_last_iter_;
198 Index debug_cnt_;
200
205 ESymSolverStatus SymbolicFactorization(const Index* ia,
206 const Index* ja);
207
210 ESymSolverStatus Factorization(const Index* ia,
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
Ipopt::PardisoSolverInterface::a_
double * a_
Array for storing the values of the matrix.
Definition: IpPardisoSolverInterface.hpp:119
Ipopt::PardisoSolverInterface::InitializeImpl
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
Ipopt::ESymSolverStatus
ESymSolverStatus
Enum to report outcome of a linear solve.
Definition: IpSymLinearSolver.hpp:21
Ipopt::PardisoSolverInterface::CONSTRAINT
Definition: IpPardisoSolverInterface.hpp:145
ipfint
FORTRAN_INTEGER_TYPE ipfint
Definition: IpTypes.hpp:26
Ipopt::SparseSymLinearSolverInterface
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Definition: IpSparseSymLinearSolverInterface.hpp:98
Ipopt::PardisoSolverInterface::pardiso_max_droptol_corrections_
Index pardiso_max_droptol_corrections_
Maximal number of decreases of drop tolerance during one solve.
Definition: IpPardisoSolverInterface.hpp:166
Ipopt::PardisoSolverInterface::debug_cnt_
Index debug_cnt_
Definition: IpPardisoSolverInterface.hpp:198
IpSparseSymLinearSolverInterface.hpp
Ipopt::PardisoSolverInterface::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for IpoptType.
Ipopt::PardisoSolverInterface::initialized_
bool initialized_
Flag indicating if internal data is initialized.
Definition: IpPardisoSolverInterface.hpp:173
Ipopt::PardisoSolverInterface::match_strat_
PardisoMatchingStrategy match_strat_
Option that controls the matching strategy.
Definition: IpPardisoSolverInterface.hpp:148
Ipopt::PardisoSolverInterface::PardisoMatchingStrategy
PardisoMatchingStrategy
Type for mathcing strategies.
Definition: IpPardisoSolverInterface.hpp:141
Ipopt::PardisoSolverInterface::PardisoSolverInterface
PardisoSolverInterface()
Constructor.
Ipopt::PardisoSolverInterface::skip_inertia_check_
bool skip_inertia_check_
Flag indicating if the interia is always assumed to be correct.
Definition: IpPardisoSolverInterface.hpp:161
Ipopt::PardisoSolverInterface::SymbolicFactorization
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Pardiso to do the analysis phase.
Ipopt::PardisoSolverInterface::COMPLETE
Definition: IpPardisoSolverInterface.hpp:143
Ipopt::SparseSymLinearSolverInterface::CSR_Format_1_Offset
Compressed sparse row format for lower triangular part, with 1 offset.
Definition: IpSparseSymLinearSolverInterface.hpp:110
Ipopt::PardisoSolverInterface::MAXFCT_
ipfint MAXFCT_
Maximal number of factors with identical nonzero structure.
Definition: IpPardisoSolverInterface.hpp:182
Ipopt::PardisoSolverInterface::DPARM_
double * DPARM_
Parameter and info array for Pardiso.
Definition: IpPardisoSolverInterface.hpp:190
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::PardisoSolverInterface::ProvidesInertia
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Definition: IpPardisoSolverInterface.hpp:76
Ipopt::PardisoSolverInterface::InitializeStructure
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal stuctures.
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::PardisoSolverInterface::IPARM_
ipfint * IPARM_
Parameter and info array for Pardiso.
Definition: IpPardisoSolverInterface.hpp:188
Ipopt::PardisoSolverInterface::COMPLETE2x2
Definition: IpPardisoSolverInterface.hpp:144
Ipopt::PardisoSolverInterface::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: IpPardisoSolverInterface.hpp:154
Ipopt::PardisoSolverInterface
Interface to the linear solver Pardiso, derived from SparseSymLinearSolverInterface.
Definition: IpPardisoSolverInterface.hpp:24
Ipopt::PardisoSolverInterface::Solve
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, double *rhs_vals)
Call Pardiso to do the Solve.
Ipopt::PardisoSolverInterface::negevals_
Index negevals_
Number of negative eigenvalues.
Definition: IpPardisoSolverInterface.hpp:135
Ipopt::PardisoSolverInterface::GetValuesArrayPtr
virtual double * GetValuesArrayPtr()
Method returing an internal array into which the nonzero elements are to be stored.
Ipopt::PardisoSolverInterface::NumberOfNegEVals
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
Ipopt::PardisoSolverInterface::MNUM_
ipfint MNUM_
Actual matrix for the solution phase.
Definition: IpPardisoSolverInterface.hpp:184
Ipopt::PardisoSolverInterface::operator=
void operator=(const PardisoSolverInterface &)
Overloaded Equals Operator.
Ipopt::PardisoSolverInterface::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: IpPardisoSolverInterface.hpp:158
Ipopt::PardisoSolverInterface::pardiso_iterative_
bool pardiso_iterative_
Flag indicating whether we are using the iterative solver in Pardiso.
Definition: IpPardisoSolverInterface.hpp:164
Ipopt::PardisoSolverInterface::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::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::PardisoSolverInterface::MatrixFormat
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
Definition: IpPardisoSolverInterface.hpp:83
Ipopt::PardisoSolverInterface::MSGLVL_
ipfint MSGLVL_
Message level.
Definition: IpPardisoSolverInterface.hpp:192
Ipopt::SparseSymLinearSolverInterface::EMatrixFormat
EMatrixFormat
Enum to specify sparse matrix format.
Definition: IpSparseSymLinearSolverInterface.hpp:102
Ipopt::PardisoSolverInterface::IncreaseQuality
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Ipopt::PardisoSolverInterface::PT_
void ** PT_
Internal data address pointers.
Definition: IpPardisoSolverInterface.hpp:179
Ipopt::PardisoSolverInterface::debug_last_iter_
Index debug_last_iter_
Definition: IpPardisoSolverInterface.hpp:197
Ipopt::PardisoSolverInterface::Factorization
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Pardiso to factorize the Matrix.
Ipopt::PardisoSolverInterface::nonzeros_
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
Definition: IpPardisoSolverInterface.hpp:116
Ipopt::PardisoSolverInterface::MTYPE_
ipfint MTYPE_
Matrix type; real and symmetric indefinite.
Definition: IpPardisoSolverInterface.hpp:186
Ipopt::PardisoSolverInterface::~PardisoSolverInterface
virtual ~PardisoSolverInterface()
Destructor.
Ipopt::PardisoSolverInterface::have_symbolic_factorization_
bool have_symbolic_factorization_
Flag indicating if symbolic factorization has already been performed.
Definition: IpPardisoSolverInterface.hpp:151
Ipopt::PardisoSolverInterface::dim_
Index dim_
Number of rows and columns of the matrix.
Definition: IpPardisoSolverInterface.hpp:113