Ipopt Documentation  
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 */
61  struct ma97_control control_;
62  double umax_;
63  int ordering_;
65  enum scale_opts switch_[3];
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 
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 */
129 
130  bool ProvidesInertia() const
131  {
132  return true;
133  }
134 
136  {
137  return CSR_Format_1_Offset;
138  }
140 
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
void * fkeep_
Stores pointer to factors (only understood Fortran code!)
double * val_
Storage for variables.
bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
void * akeep_
Stores pointer to factors (only understood Fortran code!)
double * scaling_
Store scaling for reuse if doing dynamic scaling.
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.
ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.
bool IncreaseQuality()
Request to increase quality of solution for next solve.
int numneg_
Number of negative pivots in last factorization.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
int ndim_
Number of dimensions.
static int ScaleNameToNum(const std::string &name)
converts a scaling option name to its ma97 option number
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class.
bool rescale_
Indicates if we should rescale next factorization.
ESymSolverStatus DetermineDependentRows(const Index *, const Index *, std::list< Index > &)
This method determines the list of row indices of the linearly dependent rows.
int fctidx_
Current factorization number to dump to.
int numdelay_
Number of delayed pivots last time we scaled.
bool ProvidesDegeneracyDetection() const
Query whether the indices of linearly dependent rows/columns can be determined by this linear solver.
Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
bool pivtol_changed_
indicates if pivtol has been changed
double * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
This class stores a list of user set options.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
EMatrixFormat
Enum to specify sparse matrix format.
@ CSR_Format_1_Offset
Compressed sparse row format for lower triangular part, with 1 offset.
#define ma97_control
Definition: hsl_ma97d.h:12
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ESymSolverStatus
Enum to report outcome of a linear solve.
@ SYMSOLVER_FATAL_ERROR
Unrecoverable error in linear solver occurred.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17