Ipopt Documentation  
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IpMa97SolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2012, The Science and Technology Facilities Council (STFC)
2 // Copyright (C) 2009, Jonathan Hogg <jdh41.at.cantab.net>
3 // Copyright (C) 2004, 2007 International Business Machines and others.
4 // All Rights Reserved.
5 // This code is published under the Eclipse Public License.
6 //
7 // Authors: Jonathan Hogg STFC 2012-12-21
8 // Jonathan Hogg 2009-07-29
9 // Carl Laird, Andreas Waechter IBM 2004-03-17
10 
11 #ifndef __IPMA97SOLVERINTERFACE_HPP__
12 #define __IPMA97SOLVERINTERFACE_HPP__
13 
15 extern "C"
16 {
17 #include "hsl_ma97d.h"
18 }
19 
20 namespace Ipopt
21 {
22 
24 {
25 private:
27  {
35  };
37  {
47  };
48 
49  int ndim_;
50  double* val_;
51  int numneg_;
52  int numdelay_;
53  void* akeep_;
54  void* fkeep_;
56  bool rescale_;
57  double* scaling_;
58  int fctidx_;
59 
60  /* Options */
62  double umax_;
63  int ordering_;
66  int scaling_val_[3];
68  bool dump_;
69 
70 public:
71 
73  : val_(NULL),
74  numdelay_(0),
75  akeep_(NULL),
76  fkeep_(NULL),
77  pivtol_changed_(false),
78  rescale_(false),
79  scaling_(NULL),
80  fctidx_(0),
81  scaling_type_(0),
82  dump_(false)
83  { }
84 
86 
87  static void RegisterOptions(
89  );
90 
91  bool InitializeImpl(
92  const OptionsList& options,
93  const std::string& prefix
94  );
95 
99  Index dim,
100  Index nonzeros,
101  const Index* ia,
102  const Index* ja
103  );
104 
106  {
107  return val_;
108  }
109 
111  bool new_matrix,
112  const Index* ia,
113  const Index* ja,
114  Index nrhs,
115  double* rhs_vals,
116  bool check_NegEVals,
117  Index numberOfNegEVals
118  );
119 
121  {
122  return numneg_;
123  }
125 
126  //* @name Options of Linear solver */
128  bool IncreaseQuality();
129 
130  bool ProvidesInertia() const
131  {
132  return true;
133  }
134 
136  {
137  return CSR_Format_1_Offset;
138  }
140 
143  bool ProvidesDegeneracyDetection() const
145  {
146  return false;
147  }
148 
150  const Index* /*ia*/,
151  const Index* /*ja*/,
152  std::list<Index>& /*c_deps*/
153  )
154  {
155  return SYMSOLVER_FATAL_ERROR;
156  }
158 
160  static int ScaleNameToNum(
161  const std::string& name
162  );
163 };
164 
165 } // namespace Ipopt
166 
167 #endif
bool IncreaseQuality()
Request to increase quality of solution for next solve.
bool ProvidesDegeneracyDetection() const
Query whether the indices of linearly dependent rows/columns can be determined by this linear solver...
ESymSolverStatus
Enum to report outcome of a linear solve.
#define ma97_control
Definition: hsl_ma97d.h:12
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
int numdelay_
Number of delayed pivots last time we scaled.
ESymSolverStatus DetermineDependentRows(const Index *, const Index *, std::list< Index > &)
This method determines the list of row indices of the linearly dependent rows.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class...
static int ScaleNameToNum(const std::string &name)
converts a scaling option name to its ma97 option number
Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Compressed sparse row format for lower triangular part, with 1 offset.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
This class stores a list of user set options.
bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
void * fkeep_
Stores pointer to factors (only understood Fortran code!)
int fctidx_
Current factorization number to dump to.
double * val_
Storage for variables.
ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Unrecoverable error in linear solver occurred.
EMatrixFormat
Enum to specify sparse matrix format.
double * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
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.
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
void * akeep_
Stores pointer to factors (only understood Fortran code!)
double * scaling_
Store scaling for reuse if doing dynamic scaling.
int numneg_
Number of negative pivots in last factorization.
int ndim_
Number of dimensions.
bool rescale_
Indicates if we should rescale next factorization.
bool pivtol_changed_
indicates if pivtol has been changed