00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __IPMA77SOLVERINTERFACE_HPP__
00013 #define __IPMA77SOLVERINTERFACE_HPP__
00014
00015 #include "IpSparseSymLinearSolverInterface.hpp"
00016
00017 extern "C" {
00018 #include "hsl_ma77d.h"
00019 }
00020
00021 namespace Ipopt
00022 {
00023
00103 class Ma77SolverInterface: public SparseSymLinearSolverInterface
00104 {
00105 private:
00106 enum order_opts {
00107 ORDER_AMD,
00108 ORDER_METIS
00109 };
00110
00111 int ndim_;
00112 double *val_;
00113 int numneg_;
00114 void *keep_;
00115 bool pivtol_changed_;
00116
00117
00118 struct ma77_control control_;
00119 double umax_;
00120 int ordering_;
00121
00122 public:
00123
00124 Ma77SolverInterface() :
00125 val_(NULL), keep_(NULL), pivtol_changed_(false)
00126 {}
00127 ~Ma77SolverInterface();
00128
00129 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00130
00131 bool InitializeImpl(const OptionsList& options,
00132 const std::string& prefix);
00133
00142 ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00143 const Index* ia,
00144 const Index* ja);
00145
00152 double* GetValuesArrayPtr()
00153 {
00154 return val_;
00155 }
00156
00189 ESymSolverStatus MultiSolve(bool new_matrix,
00190 const Index* ia,
00191 const Index* ja,
00192 Index nrhs,
00193 double* rhs_vals,
00194 bool check_NegEVals,
00195 Index numberOfNegEVals);
00196
00203 Index NumberOfNegEVals() const
00204 {
00205 return numneg_;
00206 }
00208
00209
00211
00217 bool IncreaseQuality();
00218
00222 bool ProvidesInertia() const
00223 {
00224 return true;
00225 }
00226
00230 EMatrixFormat MatrixFormat() const
00231 {
00232 return CSR_Full_Format_1_Offset;
00233 }
00235
00241 bool ProvidesDegeneracyDetection() const
00242 {
00243 return false;
00244 }
00247 ESymSolverStatus DetermineDependentRows(const Index* ia,
00248 const Index* ja,
00249 std::list<Index>& c_deps)
00250 {
00251 return SYMSOLVER_FATAL_ERROR;
00252 }
00253 };
00254
00255 }
00256
00257 #endif