Ipopt Documentation  
IpSpralSolverInterface.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: Byron Tasseff LANL 2020-03-21
8 // Jonathan Hogg STFC 2012-12-21
9 // Jonathan Hogg 2009-07-29
10 // Carl Laird, Andreas Waechter IBM 2004-03-17
11 
12 #ifndef __IPSPRALSOLVERINTERFACE_HPP__
13 #define __IPSPRALSOLVERINTERFACE_HPP__
14 
16 
17 extern "C"
18 {
19 #include "spral_ssids.h"
20 }
21 
22 namespace Ipopt
23 {
24 
29 {
30 private:
32  {
42  };
43 
44  int ndim_;
45  double* val_;
46  int numneg_;
47  int numdelay_;
48  void* akeep_;
49  void* fkeep_;
51  bool rescale_;
52  double* scaling_;
53  int fctidx_;
54 
55  /* Options */
56  struct spral_ssids_options control_;
57  double umax_;
58  int ordering_;
60  enum scaling_opts switch_[3];
61  int scaling_val_[3];
63  bool dump_;
64 
65 public:
66 
68  : val_(NULL),
69  numdelay_(0),
70  akeep_(NULL),
71  fkeep_(NULL),
72  pivtol_changed_(false),
73  rescale_(false),
74  scaling_(NULL),
75  fctidx_(0),
76  scaling_type_(0),
77  dump_(false)
78  { }
79 
81 
82  static void RegisterOptions(
84  );
85 
87  static std::string GetName();
88 
90  const OptionsList& options,
91  const std::string& prefix
92  );
93 
97  Index dim,
98  Index nonzeros,
99  const Index* ia,
100  const Index* ja
101  );
102 
104  {
105  return val_;
106  }
107 
109  bool new_matrix,
110  const Index* ia,
111  const Index* ja,
112  Index nrhs,
113  double* rhs_vals,
114  bool check_NegEVals,
115  Index numberOfNegEVals
116  );
117 
119  {
120  return numneg_;
121  }
123 
127 
128  bool ProvidesInertia() const
129  {
130  return true;
131  }
132 
134  {
135  return CSR_Format_1_Offset;
136  }
138 
143  {
144  return false;
145  }
146 
148  const Index* /*ia*/,
149  const Index* /*ja*/,
150  std::list<Index>& /*c_deps*/
151  )
152  {
153  return SYMSOLVER_FATAL_ERROR;
154  }
156 
158  static int ScaleNameToNum(
159  const std::string& name
160  );
161 
164  const std::string& name
165  );
166 };
167 
168 } // namespace Ipopt
169 
170 #endif
This class stores a list of user set options.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:165
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.
Interface to the linear solver SPRAL.
static int ScaleNameToNum(const std::string &name)
converts a scaling option name to its spral option number
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
double * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
struct spral_ssids_options control_
int fctidx_
Current factorization number to dump to.
int numneg_
Number of negative pivots in last factorization.
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 IncreaseQuality()
Request to increase quality of solution for next solve.
Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
int ndim_
Number of dimensions.
bool rescale_
Indicates if we should rescale next factorization.
double * val_
Storage for variables.
void * akeep_
Stores pointer to factors.
double * scaling_
Store scaling for reuse if doing dynamic scaling.
bool ProvidesDegeneracyDetection() const
Query whether the indices of linearly dependent rows/columns can be determined by this linear solver.
bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
static std::string GetName()
give name of MUMPS with version info
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.
bool pivtol_changed_
indicates if pivtol has been changed
int numdelay_
Number of delayed pivots last time we scaled.
void * fkeep_
Stores pointer to factors.
static int PivotMethodNameToNum(const std::string &name)
converts a pivot method option name to its spral option number
ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.
ESymSolverStatus DetermineDependentRows(const Index *, const Index *, std::list< Index > &)
This method determines the list of row indices of the linearly dependent rows.
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.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20