Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpMa77SolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2009, Jonathan Hogg <jdh41.at.cantab.net>
2 // Copyright (C) 2004, 2007 International Business Machines and others.
3 // All Rights Reserved.
4 // This code is published under the Eclipse Public License.
5 //
6 // $Id: IpMa77SolverInterface.hpp 2328 2013-06-13 17:24:24Z stefan $
7 //
8 // Authors: Jonathan Hogg STFC 2013-30-05
9 // Jonathan Hogg 2009-07-29
10 // Carl Laird, Andreas Waechter IBM 2004-03-17
11
12 #ifndef __IPMA77SOLVERINTERFACE_HPP__
13 #define __IPMA77SOLVERINTERFACE_HPP__
14
15 #include "IpSparseSymLinearSolverInterface.hpp"
16
17 extern "C" {
18 #include "hsl_ma77d.h"
19 }
20
21 namespace Ipopt
22 {
23
103 class Ma77SolverInterface: public SparseSymLinearSolverInterface
104 {
105 private:
106 enum order_opts {
107 ORDER_AMD,
108 ORDER_METIS
109 };
110
111 int ndim_; // Number of dimensions
112 double *val_; // Storage for variables
113 int numneg_; // Number of negative pivots in last factorization
114 void *keep_; // Stores pointer to factors (only understood by Fortran code!)
115 bool pivtol_changed_; // indicates if pivtol has been changed
116
117 /* Options */
118 struct ma77_control control_;
119 double umax_;
120 int ordering_;
121
122 public:
123
124 Ma77SolverInterface() :
125 val_(NULL), keep_(NULL), pivtol_changed_(false)
126 {}
127 ~Ma77SolverInterface();
128
129 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
130
131 bool InitializeImpl(const OptionsList& options,
132 const std::string& prefix);
133
142 ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
143 const Index* ia,
144 const Index* ja);
145
152 double* GetValuesArrayPtr()
153 {
154 return val_;
155 }
156
189 ESymSolverStatus MultiSolve(bool new_matrix,
190 const Index* ia,
191 const Index* ja,
192 Index nrhs,
193 double* rhs_vals,
194 bool check_NegEVals,
195 Index numberOfNegEVals);
196
203 Index NumberOfNegEVals() const
204 {
205 return numneg_;
206 }
208
209 //* @name Options of Linear solver */
211
217 bool IncreaseQuality();
218
222 bool ProvidesInertia() const
223 {
224 return true;
225 }
226
230 EMatrixFormat MatrixFormat() const
231 {
232 return CSR_Full_Format_1_Offset;
233 }
235
241 bool ProvidesDegeneracyDetection() const
242 {
243 return false;
244 }
247 ESymSolverStatus DetermineDependentRows(const Index* ia,
248 const Index* ja,
249 std::list<Index>& c_deps)
250 {
251 return SYMSOLVER_FATAL_ERROR;
252 }
253 };
254
255 } // namespace Ipopt
256
257 #endif
Ipopt::Ma77SolverInterface::ndim_
int ndim_
Definition: IpMa77SolverInterface.hpp:111
Ipopt::ESymSolverStatus
ESymSolverStatus
Enum to report outcome of a linear solve.
Definition: IpSymLinearSolver.hpp:21
Ipopt::Ma77SolverInterface::GetValuesArrayPtr
double * GetValuesArrayPtr()
Method returing an internal array into which the nonzero elements (in the same order as ja) will be s...
Definition: IpMa77SolverInterface.hpp:152
Ipopt::SparseSymLinearSolverInterface
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Definition: IpSparseSymLinearSolverInterface.hpp:98
Ipopt::Ma77SolverInterface::umax_
double umax_
Definition: IpMa77SolverInterface.hpp:119
IpSparseSymLinearSolverInterface.hpp
Ipopt::Ma77SolverInterface::NumberOfNegEVals
Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
Definition: IpMa77SolverInterface.hpp:203
Ipopt::Ma77SolverInterface::Ma77SolverInterface
Ma77SolverInterface()
Definition: IpMa77SolverInterface.hpp:124
Ipopt::Ma77SolverInterface::MatrixFormat
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
Definition: IpMa77SolverInterface.hpp:230
Ipopt::Ma77SolverInterface::MultiSolve
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.
Ipopt::Ma77SolverInterface
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Definition: IpMa77SolverInterface.hpp:103
Ipopt::Ma77SolverInterface::numneg_
int numneg_
Definition: IpMa77SolverInterface.hpp:113
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::Ma77SolverInterface::val_
double * val_
Definition: IpMa77SolverInterface.hpp:112
Ipopt::Ma77SolverInterface::ProvidesDegeneracyDetection
bool ProvidesDegeneracyDetection() const
Query whether the indices of linearly dependent rows/columns can be determined by this linear solver...
Definition: IpMa77SolverInterface.hpp:241
Ipopt::Ma77SolverInterface::ORDER_METIS
Definition: IpMa77SolverInterface.hpp:108
hsl_ma77d.h
Ipopt::Ma77SolverInterface::InitializeStructure
ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal stuctures.
Ipopt::Ma77SolverInterface::~Ma77SolverInterface
~Ma77SolverInterface()
Ipopt::Ma77SolverInterface::ordering_
int ordering_
Definition: IpMa77SolverInterface.hpp:120
Ipopt::Ma77SolverInterface::pivtol_changed_
bool pivtol_changed_
Definition: IpMa77SolverInterface.hpp:115
Ipopt::Ma77SolverInterface::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Ipopt::Ma77SolverInterface::InitializeImpl
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::Ma77SolverInterface::IncreaseQuality
bool IncreaseQuality()
Request to increase quality of solution for next solve.
Ipopt::Ma77SolverInterface::ORDER_AMD
Definition: IpMa77SolverInterface.hpp:107
Ipopt::SYMSOLVER_FATAL_ERROR
Unrecoverable error in linear solver occurred.
Definition: IpSymLinearSolver.hpp:33
Ipopt::SparseSymLinearSolverInterface::EMatrixFormat
EMatrixFormat
Enum to specify sparse matrix format.
Definition: IpSparseSymLinearSolverInterface.hpp:102
Ipopt::Ma77SolverInterface::ProvidesInertia
bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Definition: IpMa77SolverInterface.hpp:222
Ipopt::Ma77SolverInterface::order_opts
order_opts
Definition: IpMa77SolverInterface.hpp:106
Ipopt::Ma77SolverInterface::control_
struct ma77_control control_
Definition: IpMa77SolverInterface.hpp:118
Ipopt::Ma77SolverInterface::keep_
void * keep_
Definition: IpMa77SolverInterface.hpp:114
Ipopt::SparseSymLinearSolverInterface::CSR_Full_Format_1_Offset
Compressed sparse row format for both lwr and upr parts, with 1 offset.
Definition: IpSparseSymLinearSolverInterface.hpp:116
Ipopt::Ma77SolverInterface::DetermineDependentRows
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.
Definition: IpMa77SolverInterface.hpp:247
ma77_control
#define ma77_control
Definition: hsl_ma77d.h:13