Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __IPMA86SOLVERINTERFACE_HPP__
00014 #define __IPMA86SOLVERINTERFACE_HPP__
00015
00016 #include "IpSparseSymLinearSolverInterface.hpp"
00017 extern "C"
00018 {
00019 #include "hsl_ma86d.h"
00020 }
00021
00022 namespace Ipopt
00023 {
00024
00104 class Ma86SolverInterface: public SparseSymLinearSolverInterface
00105 {
00106 private:
00107 int ndim_;
00108 double *val_;
00109 int numneg_;
00110 Index *order_;
00111 void *keep_;
00112 bool pivtol_changed_;
00113 double *scaling_;
00114
00115
00116 struct ma86_control control_;
00117 double umax_;
00118 bool scale_;
00119
00120 public:
00121
00122 Ma86SolverInterface() :
00123 val_(NULL), pivtol_changed_(false), scaling_(NULL)
00124 {}
00125 ~Ma86SolverInterface();
00126
00127 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00128
00129 bool InitializeImpl(const OptionsList& options,
00130 const std::string& prefix);
00131
00140 ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00141 const Index* ia,
00142 const Index* ja);
00143
00150 double* GetValuesArrayPtr()
00151 {
00152 return val_;
00153 }
00154
00187 ESymSolverStatus MultiSolve(bool new_matrix,
00188 const Index* ia,
00189 const Index* ja,
00190 Index nrhs,
00191 double* rhs_vals,
00192 bool check_NegEVals,
00193 Index numberOfNegEVals);
00194
00201 Index NumberOfNegEVals() const
00202 {
00203 return numneg_;
00204 }
00206
00207
00209
00215 bool IncreaseQuality();
00216
00220 bool ProvidesInertia() const
00221 {
00222 return true;
00223 }
00224
00228 EMatrixFormat MatrixFormat() const
00229 {
00230 return CSR_Format_1_Offset;
00231 }
00233
00239 bool ProvidesDegeneracyDetection() const
00240 {
00241 return false;
00242 }
00245 ESymSolverStatus DetermineDependentRows(const Index* ia,
00246 const Index* ja,
00247 std::list<Index>& c_deps)
00248 {
00249 return SYMSOLVER_FATAL_ERROR;
00250 }
00251
00253 static void MetisOrder(const int dim, const Index *ptr, const Index *row, Index *perm);
00254 };
00255
00256 }
00257
00258 #endif