Ipopt  3.12.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 // $Id: IpMa97SolverInterface.hpp 2001 2011-06-02 17:43:07Z andreasw $
8 //
9 // Authors: Jonathan Hogg STFC 2012-12-21
10 // Jonathan Hogg 2009-07-29
11 // Carl Laird, Andreas Waechter IBM 2004-03-17
12 
13 #ifndef __IPMA97SOLVERINTERFACE_HPP__
14 #define __IPMA97SOLVERINTERFACE_HPP__
15 
17 extern "C"
18 {
19 #include "hsl_ma97d.h"
20 }
21 
22 namespace Ipopt
23 {
24 
105  {
106  private:
107  enum order_opts {
115  };
116  enum scale_opts {
126  };
127 
128  int ndim_; // Number of dimensions
129  double *val_; // Storage for variables
130  int numneg_; // Number of negative pivots in last factorization
131  int numdelay_; // Number of delayed pivots last time we scaled
132  void *akeep_; // Stores pointer to factors (only understood Fortran code!)
133  void *fkeep_; // Stores pointer to factors (only understood Fortran code!)
134  bool pivtol_changed_; // indicates if pivtol has been changed
135  bool rescale_; // Indicates if we shuold rescale next factorization
136  double *scaling_; // Store scaling for reuse if doing dynamic scaling
137  int fctidx_; // Current factorization number to dump to
138 
139  /* Options */
141  double umax_;
145  int scaling_val_[3];
147  bool dump_;
148 
149  public:
150 
152  val_(NULL), numdelay_(0), akeep_(NULL), fkeep_(NULL), pivtol_changed_(false),
153  rescale_(false), scaling_(NULL), fctidx_(0), scaling_type_(0),
154  dump_(false)
155  {}
157 
158  static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
159 
160  bool InitializeImpl(const OptionsList& options,
161  const std::string& prefix);
162 
172  const Index* ia,
173  const Index* ja);
174 
182  {
183  return val_;
184  }
185 
218  ESymSolverStatus MultiSolve(bool new_matrix,
219  const Index* ia,
220  const Index* ja,
221  Index nrhs,
222  double* rhs_vals,
223  bool check_NegEVals,
224  Index numberOfNegEVals);
225 
233  {
234  return numneg_;
235  }
237 
238  //* @name Options of Linear solver */
240 
246  bool IncreaseQuality();
247 
251  bool ProvidesInertia() const
252  {
253  return true;
254  }
255 
260  {
261  return CSR_Format_1_Offset;
262  }
264 
271  {
272  return false;
273  }
277  const Index* ja,
278  std::list<Index>& c_deps)
279  {
280  return SYMSOLVER_FATAL_ERROR;
281  }
282 
284  static int ScaleNameToNum(const std::string& name);
285  };
286 
287 } // namespace Ipopt
288 
289 #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:13
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
static int ScaleNameToNum(const std::string &name)
converts a scalign optoin name to its ma97 option number
Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
ESymSolverStatus DetermineDependentRows(const Index *ia, const Index *ja, std::list< Index > &c_deps)
This method determines the list of row indices of the linearly dependent rows.
Compressed sparse row format for lower triangular part, with 1 offset.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
This class stores a list of user set options.
bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal stuctures.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Unrecoverable error in linear solver occurred.
EMatrixFormat
Enum to specify sparse matrix format.
double * GetValuesArrayPtr()
Method returing an internal array into which the nonzero elements (in the same order as ja) will be s...
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.