Ipopt Documentation  
 
Loading...
Searching...
No Matches
IpMa57TSolverInterface.hpp
Go to the documentation of this file.
1// Copyright (C) 2005, 2006 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// Authors: Michael Hagemann Univ of Basel 2005-10-28
6// original version (based on MA27TSolverInterface.hpp)
7
8#ifndef __IPMA57TSOLVERINTERFACE_HPP__
9#define __IPMA57TSOLVERINTERFACE_HPP__
10
12#include "IpLibraryLoader.hpp"
13#include "IpTypes.h"
14
15#ifdef FUNNY_MA57_FINT
16#include <cstddef>
17typedef ptrdiff_t ma57int;
18#else
19#include "IpTypes.h"
21#endif
22
24#define IPOPT_DECL_MA57A(x) void (x)( \
25 ma57int* n, \
26 ma57int* ne, \
27 const ma57int* irn, \
28 const ma57int* jcn, \
29 ma57int* lkeep, \
30 ma57int* keep, \
31 /* Automatically iflag = 0; ikeep pivot order iflag = 1 */ \
32 ma57int* iwork, \
33 ma57int* icntl, \
34 ma57int* info, \
35 ipnumber* rinfo \
36)
37
39#define IPOPT_DECL_MA57B(x) void (x)( \
40 ma57int* n, \
41 ma57int* ne, \
42 ipnumber* a, \
43 ipnumber* fact, \
44 ma57int* lfact, \
45 ma57int* ifact, \
46 ma57int* lifact, \
47 ma57int* lkeep, \
48 ma57int* keep, \
49 ma57int* iwork, \
50 ma57int* icntl, \
51 ipnumber* cntl, \
52 ma57int* info, \
53 ipnumber* rinfo \
54)
55
56/* Solution job: Solve for...
57 * - JOB <= 1: A
58 * - JOB == 2: PLP^t
59 * - JOB == 3: PDP^t
60 * - JOB >= 4: PL^t P^t
61 */
63#define IPOPT_DECL_MA57C(x) void (x)( \
64 ma57int* job, \
65 ma57int* n, \
66 ipnumber* fact, \
67 ma57int* lfact, \
68 ma57int* ifact, \
69 ma57int* lifact, \
70 ma57int* nrhs, \
71 ipnumber* rhs, \
72 ma57int* lrhs, \
73 ipnumber* work, \
74 ma57int* lwork, \
75 ma57int* iwork, \
76 ma57int* icntl, \
77 ma57int* info \
78)
79
81#define IPOPT_DECL_MA57E(x) void (x)( \
82 ma57int* n, \
83 ma57int* ic, \
84 ma57int* keep, \
85 ipnumber* fact, \
86 ma57int* lfact, \
87 ipnumber* newfac, \
88 ma57int* lnew, \
89 ma57int* ifact, \
90 ma57int* lifact, \
91 ma57int* newifc, \
92 ma57int* linew, \
93 ma57int* info \
94)
95
97#define IPOPT_DECL_MA57I(x) void (x)( \
98 ipnumber* cntl, \
99 ma57int* icntl \
100)
101
102namespace Ipopt
103{
108{
109public:
112
114 SmartPtr<LibraryLoader> hslloader_
115 );
116
120
122 const OptionsList& options,
123 const std::string& prefix
124 );
125
129 Index dim,
130 Index nonzeros,
131 const Index* airn,
132 const Index* ajcn
133 );
134
136
138 bool new_matrix,
139 const Index* airn,
140 const Index* ajcn,
141 Index nrhs,
142 Number* rhs_vals,
143 bool check_NegEVals,
144 Index numberOfNegEVals
145 );
146
147 virtual Index NumberOfNegEVals() const;
149
150 //* @name Options of Linear solver */
152 virtual bool IncreaseQuality();
153
154 virtual bool ProvidesInertia() const
155 {
156 return true;
157 }
158
160 {
161 return Triplet_Format;
162 }
164
166 static void RegisterOptions(
168 );
170
173 static void SetFunctions(
179 );
180
181private:
190
193 );
194
198 );
200
205
217
220
222
226
229
232
235
250
253
264
271
274
275 ma57int wd_lkeep_; /* LKEEP >= 5*N + NE + max(N,NE) + 42. */
277
278 ma57int* wd_iwork_; /* 5 * N. */
279
284
288
291
297 const Index* airn,
298 const Index* ajcn
299 );
300
307 const Index* airn,
308 const Index* ajcn,
309 bool check_NegEVals,
310 Index numberOfNegEVals
311 );
312
315 Index nrhs,
316 Number* rhs_vals
317 );
319};
320
321} // namespace Ipopt
322#endif
#define IPOPT_DECL_MA57B(x)
#define IPOPT_DECL_MA57E(x)
#define IPOPT_DECL_MA57I(x)
#define IPOPT_DECL_MA57C(x)
ipindex ma57int
#define IPOPT_DECL_MA57A(x)
int ipindex
Type of all indices of vectors, matrices etc.
Definition IpTypes.h:68
Interface to the symmetric linear solver MA57, derived from SparseSymLinearSolverInterface.
Number ma57_pre_alloc_
Factor for estimating initial size of work arrays.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Index negevals_
Number of negative eigenvalues.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *airn, const Index *ajcn)
Method for initializing internal structures.
virtual Number * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
IPOPT_DECL_MA57C * ma57c
solution
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
static void SetFunctions(IPOPT_DECL_MA57A(*ma57a), IPOPT_DECL_MA57B(*ma57b), IPOPT_DECL_MA57C(*ma57c), IPOPT_DECL_MA57E(*ma57e),)
set MA57 functions to use for every instantiation of this class
Index nonzeros_
Number of nonzeros of the matrix.
ESymSolverStatus Factorization(const Index *airn, const Index *ajcn, bool check_NegEVals, Index numberOfNegEVals)
Call MA57BX to factorize the Matrix.
IPOPT_DECL_MA57E * ma57e
copy arrays
ESymSolverStatus SymbolicFactorization(const Index *airn, const Index *ajcn)
Call MA57AX and reserve memory for MA57 data.
void operator=(const Ma57TSolverInterface &)
Default Assignment Operator.
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 initialized_
Flag indicating if internal data is initialized.
bool refactorize_
Flag that is true if we just requested the values of the matrix again (SYMSOLVER_CALL_AGAIN) and have...
Ma57TSolverInterface(const Ma57TSolverInterface &)
Copy Constructor.
bool pivtol_changed_
Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed.
Ma57TSolverInterface(SmartPtr< LibraryLoader > hslloader_)
Constructor.
Number pivtolmax_
Maximal pivot tolerance.
IPOPT_DECL_MA57I * ma57i
initialize solver
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
bool warm_start_same_structure_
Flag indicating whether the TNLP with identical structure has already been solved before.
IPOPT_DECL_MA57A * ma57a
symbolic factorization
SmartPtr< LibraryLoader > hslloader
IPOPT_DECL_MA57B * ma57b
numerical factorization
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.
virtual ~Ma57TSolverInterface()
Destructor.
Index dim_
Number of rows and columns of the matrix.
ESymSolverStatus Backsolve(Index nrhs, Number *rhs_vals)
Call MA57CX to do the backsolve.
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