Ipopt
3.11.4
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
Algorithm
LinearSolvers
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
16
#include "
IpSparseSymLinearSolverInterface.hpp
"
17
extern
"C"
18
{
19
#include "
hsl_ma97d.h
"
20
}
21
22
namespace
Ipopt
23
{
24
104
class
Ma97SolverInterface
:
public
SparseSymLinearSolverInterface
105
{
106
private
:
107
enum
order_opts
{
108
ORDER_AUTO
,
109
ORDER_BEST
,
110
ORDER_AMD
,
111
ORDER_METIS
,
112
ORDER_MATCHED_AUTO
,
113
ORDER_MATCHED_AMD
,
114
ORDER_MATCHED_METIS
115
};
116
enum
scale_opts
{
117
SWITCH_NEVER
,
118
SWITCH_AT_START
,
119
SWITCH_AT_START_REUSE
,
120
SWITCH_ON_DEMAND
,
121
SWITCH_ON_DEMAND_REUSE
,
122
SWITCH_NDELAY
,
123
SWITCH_NDELAY_REUSE
,
124
SWITCH_OD_ND
,
125
SWITCH_OD_ND_REUSE
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 */
140
struct
ma97_control
control_
;
141
double
umax_
;
142
int
ordering_
;
143
int
scaling_type_
;
144
enum
scale_opts
switch_
[3];
145
int
scaling_val_
[3];
146
int
current_level_
;
147
bool
dump_
;
148
149
public
:
150
151
Ma97SolverInterface
() :
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
{}
156
~Ma97SolverInterface
();
157
158
static
void
RegisterOptions
(
SmartPtr<RegisteredOptions>
roptions);
159
160
bool
InitializeImpl
(
const
OptionsList
& options,
161
const
std::string& prefix);
162
171
ESymSolverStatus
InitializeStructure
(
Index
dim,
Index
nonzeros,
172
const
Index
* ia,
173
const
Index
* ja);
174
181
double
*
GetValuesArrayPtr
()
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
232
Index
NumberOfNegEVals
()
const
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
259
EMatrixFormat
MatrixFormat
()
const
260
{
261
return
CSR_Format_1_Offset
;
262
}
264
270
bool
ProvidesDegeneracyDetection
()
const
271
{
272
return
false
;
273
}
276
ESymSolverStatus
DetermineDependentRows
(
const
Index
* ia,
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
Generated on Mon Oct 21 2013 19:08:15 for Ipopt by
1.8.4