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 enum order_opts {
00108 ORDER_AUTO,
00109 ORDER_AMD,
00110 ORDER_METIS
00111 };
00112
00113 int ndim_;
00114 double *val_;
00115 int numneg_;
00116 Index *order_;
00117 void *keep_;
00118 bool pivtol_changed_;
00119
00120
00121 struct ma86_control control_;
00122 double umax_;
00123 int ordering_;
00124
00125 public:
00126
00127 Ma86SolverInterface() :
00128 val_(NULL), keep_(NULL), pivtol_changed_(false)
00129 {}
00130 ~Ma86SolverInterface();
00131
00132 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00133
00134 bool InitializeImpl(const OptionsList& options,
00135 const std::string& prefix);
00136
00145 ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00146 const Index* ia,
00147 const Index* ja);
00148
00155 double* GetValuesArrayPtr()
00156 {
00157 return val_;
00158 }
00159
00192 ESymSolverStatus MultiSolve(bool new_matrix,
00193 const Index* ia,
00194 const Index* ja,
00195 Index nrhs,
00196 double* rhs_vals,
00197 bool check_NegEVals,
00198 Index numberOfNegEVals);
00199
00206 Index NumberOfNegEVals() const
00207 {
00208 return numneg_;
00209 }
00211
00212
00214
00220 bool IncreaseQuality();
00221
00225 bool ProvidesInertia() const
00226 {
00227 return true;
00228 }
00229
00233 EMatrixFormat MatrixFormat() const
00234 {
00235 return CSR_Format_1_Offset;
00236 }
00238
00244 bool ProvidesDegeneracyDetection() const
00245 {
00246 return false;
00247 }
00250 ESymSolverStatus DetermineDependentRows(const Index* ia,
00251 const Index* ja,
00252 std::list<Index>& c_deps)
00253 {
00254 return SYMSOLVER_FATAL_ERROR;
00255 }
00256 };
00257
00258 }
00259
00260 #endif