Ipopt Documentation  
 
Loading...
Searching...
No Matches
IpMa27TSolverInterface.hpp
Go to the documentation of this file.
1// Copyright (C) 2004, 2006 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// Authors: Carl Laird, Andreas Waechter IBM 2005-03-17
6
7#ifndef __IPMA27TSOLVERINTERFACE_HPP__
8#define __IPMA27TSOLVERINTERFACE_HPP__
9
11#include "IpLibraryLoader.hpp"
12#include "IpTypes.h"
13
15#define IPOPT_DECL_MA27A(x) void (x)( \
16 ipindex* N, \
17 ipindex* NZ, \
18 const ipindex* IRN, \
19 const ipindex* ICN, \
20 ipindex* IW, \
21 ipindex* LIW, \
22 ipindex* IKEEP, \
23 ipindex* IW1, \
24 ipindex* NSTEPS,\
25 ipindex* IFLAG, \
26 ipindex* ICNTL, \
27 ipnumber* CNTL, \
28 ipindex* INFO, \
29 ipnumber* OPS \
30)
31
33#define IPOPT_DECL_MA27B(x) void (x)( \
34 ipindex* N, \
35 ipindex* NZ, \
36 const ipindex* IRN, \
37 const ipindex* ICN, \
38 ipnumber* A, \
39 ipindex* LA, \
40 ipindex* IW, \
41 ipindex* LIW, \
42 ipindex* IKEEP, \
43 ipindex* NSTEPS, \
44 ipindex* MAXFRT, \
45 ipindex* IW1, \
46 ipindex* ICNTL, \
47 ipnumber* CNTL, \
48 ipindex* INFO \
49)
50
52#define IPOPT_DECL_MA27C(x) void (x)( \
53 ipindex* N, \
54 ipnumber* A, \
55 ipindex* LA, \
56 ipindex* IW, \
57 ipindex* LIW, \
58 ipnumber* W, \
59 ipindex* MAXFRT, \
60 ipnumber* RHS, \
61 ipindex* IW1, \
62 ipindex* NSTEPS, \
63 ipindex* ICNTL, \
64 ipindex* INFO \
65)
66
68#define IPOPT_DECL_MA27I(x) void (x)( \
69 ipindex* ICNTL, \
70 ipnumber* CNTL \
71)
72
73namespace Ipopt
74{
79{
80public:
83
85 SmartPtr<LibraryLoader> hslloader_
86 );
87
91
93 const OptionsList& options,
94 const std::string& prefix
95 );
96
100 Index dim,
101 Index nonzeros,
102 const Index* airn,
103 const Index* ajcn
104 );
105
107
109 bool new_matrix,
110 const Index* airn,
111 const Index* ajcn,
112 Index nrhs,
113 Number* rhs_vals,
114 bool check_NegEVals,
115 Index numberOfNegEVals);
116
117 virtual Index NumberOfNegEVals() const;
119
120 //* @name Options of Linear solver */
122 virtual bool IncreaseQuality();
123
124 virtual bool ProvidesInertia() const
125 {
126 return true;
127 }
128
130 {
131 return Triplet_Format;
132 }
134
136 static void RegisterOptions(
138 );
140
143 static void SetFunctions(
148 );
149
150private:
159
162 );
163
167 );
169
174
180
183
185
189
192
195
198
213
216
218
221
239
244
248
253
260
265
271
274
280 const Index* airn,
281 const Index* ajcn
282 );
283
290 const Index* airn,
291 const Index* ajcn,
292 bool check_NegEVals,
293 Index numberOfNegEVals
294 );
295
298 Index nrhs,
299 Number* rhs_vals
300 );
302};
303
304} // namespace Ipopt
305#endif
#define IPOPT_DECL_MA27C(x)
#define IPOPT_DECL_MA27I(x)
#define IPOPT_DECL_MA27B(x)
#define IPOPT_DECL_MA27A(x)
Interface to the symmetric linear solver MA27, derived from SparseSymLinearSolverInterface.
SmartPtr< LibraryLoader > hslloader
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class.
ESymSolverStatus Backsolve(Index nrhs, Number *rhs_vals)
Call MA27CX to do the backsolve.
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
virtual Number * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
bool initialized_
Flag indicating if internal data is initialized.
static void SetFunctions(IPOPT_DECL_MA27A(*ma27a), IPOPT_DECL_MA27B(*ma27b), IPOPT_DECL_MA27C(*ma27c),)
set MA27 functions to use for every instantiation of this class
virtual ~Ma27TSolverInterface()
Destructor.
Ma27TSolverInterface(const Ma27TSolverInterface &)
Copy Constructor.
bool refactorize_
Flag that is true if we just requested the values of the matrix again (SYMSOLVER_CALL_AGAIN) and have...
Index liw_
length of integer work space
Index icntl_[30]
integer control values
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Number la_init_factor_
Factor for estimating initial value of la.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
bool ignore_singularity_
Flag indicating if MA27 should continue if a singular matrix is detected, but right hands sides are s...
Ma27TSolverInterface(SmartPtr< LibraryLoader > hslloader_)
Constructor.
bool warm_start_same_structure_
Flag indicating whether the TNLP with identical structure has already been solved before.
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *airn, const Index *ajcn)
Method for initializing internal structures.
Number liw_init_factor_
Factor for estimating initial value of liw.
ESymSolverStatus SymbolicFactorization(const Index *airn, const Index *ajcn)
Call MA27AX and reserve memory for MA27 data.
bool skip_inertia_check_
Flag indicating if the inertia is always assumed to be correct.
void operator=(const Ma27TSolverInterface &)
Default Assignment Operator.
bool liw_increase_
flag indicating that liw should be increased before next factorization
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
bool pivtol_changed_
Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
Index dim_
Number of rows and columns of the matrix.
ESymSolverStatus Factorization(const Index *airn, const Index *ajcn, bool check_NegEVals, Index numberOfNegEVals)
Call MA27BX to factorize the Matrix.
Number pivtolmax_
Maximal pivot tolerance.
bool la_increase_
flag indicating that la should be increased before next factorization
Index negevals_
Number of negative eigenvalues.
virtual ESymSolverStatus MultiSolve(bool new_matrix, const Index *airn, const Index *ajcn, Index nrhs, Number *rhs_vals, bool check_NegEVals, Index numberOfNegEVals)
Solve operation for multiple right hand sides.
Index nonzeros_
Number of nonzeros of the matrix.
Number cntl_[5]
real control values
Number meminc_factor_
Factor for increaseing memory.
This class stores a list of user set options.
Template class for Smart Pointers.
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
@ Triplet_Format
Triplet (MA27) format for lower triangular part.
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.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17