1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Copyright (C) 2007 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors: Andreas Waechter IBM 2007-05-21
#ifndef __IPEQUILIBRATIONSCALING_HPP__
#define __IPEQUILIBRATIONSCALING_HPP__
#include "IpNLPScaling.hpp"
#include "IpNLP.hpp"
#include "IpMc19TSymScalingMethod.hpp" // to get IPOPT_DECL_MC19A
namespace Ipopt
{
/** This class does problem scaling by setting the
* scaling parameters based on the maximum of the
* gradient at the user provided initial point.
*/
class EquilibrationScaling: public StandardScalingBase
{
public:
/**@name Constructors/Destructors */
///@{
EquilibrationScaling(
const SmartPtr<NLP>& nlp,
SmartPtr<LibraryLoader> hslloader_
) : StandardScalingBase(),
nlp_(nlp),
hslloader(hslloader_),
mc19a(NULL)
{ }
/** Destructor */
virtual ~EquilibrationScaling()
{ }
///@}
/** Methods for IpoptType */
///@{
/** Register the options for this class */
static void RegisterOptions(
const SmartPtr<RegisteredOptions>& roptions
);
///@}
protected:
/** Initialize the object from the options */
bool InitializeImpl(
const OptionsList& options,
const std::string& prefix
);
virtual void DetermineScalingParametersImpl(
const SmartPtr<const VectorSpace> x_space,
const SmartPtr<const VectorSpace> c_space,
const SmartPtr<const VectorSpace> d_space,
const SmartPtr<const MatrixSpace> jac_c_space,
const SmartPtr<const MatrixSpace> jac_d_space,
const SmartPtr<const SymMatrixSpace> h_space,
const Matrix& Px_L,
const Vector& x_L,
const Matrix& Px_U,
const Vector& x_U,
Number& df,
SmartPtr<Vector>& dx,
SmartPtr<Vector>& dc,
SmartPtr<Vector>& dd
);
private:
/**@name Default Compiler Generated Methods
* (Hidden to avoid implicit creation/calling).
*
* These methods are not implemented and
* we do not want the compiler to implement
* them for us, so we declare them private
* and do not define them. This ensures that
* they will not be implicitly created/called.
*/
///@{
/** Copy Constructor */
EquilibrationScaling(
const EquilibrationScaling&
);
/** Default Assignment Operator */
void operator=(
const EquilibrationScaling&
);
///@}
/** pointer to the NLP to get scaling parameters */
SmartPtr<NLP> nlp_;
/** maximal radius for the random perturbation of the initial point */
Number point_perturbation_radius_;
/**@name MC19 function pointer
* @{
*/
SmartPtr<LibraryLoader> hslloader;
IPOPT_DECL_MC19A(*mc19a);
/**@} */
};
/** This class is a simple object for generating randomly perturbed
* points that are within the NLP bounds.
*
* The ramdon_perturb_radius gives the upper bound of the
* perturbation.
*/
class PointPerturber: public ReferencedObject
{
public:
/**@name Constructors/Destructors */
///@{
PointPerturber(
const Vector& reference_point,
Number random_pert_radius,
const Matrix& Px_L,
const Vector& x_L,
const Matrix& Px_U,
const Vector& x_U
);
/** Destructor */
virtual ~PointPerturber()
{ }
///@}
/** Return a new perturbed point */
SmartPtr<Vector> MakeNewPerturbedPoint() const;
private:
/**@name Default Compiler Generated Methods
* (Hidden to avoid implicit creation/calling).
*
* These methods are not implemented and
* we do not want the compiler to implement
* them for us, so we declare them private
* and do not define them. This ensures that
* they will not be implicitly created/called.
*/
///@{
/** Copy Constructor */
PointPerturber(
const PointPerturber&
);
/** Default Assignment Operator */
void operator=(
const PointPerturber&
);
///@}
/** pointer to the midpoint of the perturbation */
SmartPtr<Vector> ref_point_;
/** pointer to the perturbation vector */
SmartPtr<Vector> pert_dir_;
};
} // namespace Ipopt
#endif