00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __IPPARDISOSOLVERINTERFACE_HPP__
00011 #define __IPPARDISOSOLVERINTERFACE_HPP__
00012
00013 #include "IpSparseSymLinearSolverInterface.hpp"
00014
00015 namespace Ipopt
00016 {
00017
00022 class PardisoSolverInterface: public SparseSymLinearSolverInterface
00023 {
00024 public:
00028 PardisoSolverInterface();
00029
00031 virtual ~PardisoSolverInterface();
00033
00035 bool InitializeImpl(const OptionsList& options,
00036 const std::string& prefix);
00037
00038
00042 virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00043 const Index *ia,
00044 const Index *ja);
00045
00048 virtual double* GetValuesArrayPtr();
00049
00051 virtual ESymSolverStatus MultiSolve(bool new_matrix,
00052 const Index* ia,
00053 const Index* ja,
00054 Index nrhs,
00055 double* rhs_vals,
00056 bool check_NegEVals,
00057 Index numberOfNegEVals);
00058
00062 virtual Index NumberOfNegEVals() const;
00064
00065
00067
00069 virtual bool IncreaseQuality();
00070
00074 virtual bool ProvidesInertia() const
00075 {
00076 return true;
00077 }
00081 EMatrixFormat MatrixFormat() const
00082 {
00083 return CSR_Format_1_Offset;
00084 }
00086
00089 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00091
00092 private:
00102 PardisoSolverInterface(const PardisoSolverInterface&);
00103
00105 void operator=(const PardisoSolverInterface&);
00107
00111 Index dim_;
00112
00114 Index nonzeros_;
00115
00117 double* a_;
00119
00123 Index negevals_;
00125
00129 enum PardisoMatchingStrategy
00130 {
00131 COMPLETE,
00132 COMPLETE2x2,
00133 CONSTRAINT
00134 };
00136 PardisoMatchingStrategy match_strat_;
00139 bool have_symbolic_factorization_;
00142 bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_;
00146 bool pardiso_repeated_perturbation_means_singular_;
00148
00153 bool initialized_;
00155
00159 void** PT_;
00162 ipfint MAXFCT_;
00164 ipfint MNUM_;
00166 ipfint MTYPE_;
00168 ipfint* IPARM_;
00170 ipfint MSGLVL_;
00172
00175 Index debug_last_iter_;
00176 Index debug_cnt_;
00178
00183 ESymSolverStatus SymbolicFactorization(const Index* ia,
00184 const Index* ja);
00185
00188 ESymSolverStatus Factorization(const Index* ia,
00189 const Index* ja,
00190 bool check_NegEVals,
00191 Index numberOfNegEVals);
00192
00195 ESymSolverStatus Solve(const Index* ia,
00196 const Index* ja,
00197 Index nrhs,
00198 double *rhs_vals);
00200 };
00201
00202 }
00203 #endif