Ipopt  3.11.4
 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