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
// Copyright (C) 2005, 2008 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors: Andreas Waechter IBM 2005-10-13
//
// Lifeng Chen/Zaiwen Wen Columbia Univ
#ifndef __IPCGSEARCHDIRCALC_HPP__
#define __IPCGSEARCHDIRCALC_HPP__
#include "IpSearchDirCalculator.hpp"
#include "IpPDSystemSolver.hpp"
#include "IpCGPenaltyCq.hpp"
namespace Ipopt
{
/** Implementation of the search direction calculator that computes
* the Chen-Goldfarb step for the current barrier and penalty
* parameter.
*/
class CGSearchDirCalculator: public SearchDirectionCalculator
{
public:
/**@name Constructors/Destructors */
///@{
/** Constructor */
CGSearchDirCalculator(
const SmartPtr<PDSystemSolver>& pd_solver
);
/** Destructor */
virtual ~CGSearchDirCalculator();
///@}
/** overloaded from AlgorithmStrategyObject */
virtual bool InitializeImpl(
const OptionsList& options,
const std::string& prefix
);
/** Method for computing the search direction.
*
* If the penalty
* parameter has not yet been initialized, it is initialized
* now. The computed direction is stored in IpData().delta().
*/
virtual bool ComputeSearchDirection();
/** Methods for IpoptType */
///@{
static void RegisterOptions(
SmartPtr<RegisteredOptions> roptions
);
///@}
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.
*/
///@{
/** Default Constructor */
CGSearchDirCalculator();
/** Copy Constructor */
CGSearchDirCalculator(
const CGSearchDirCalculator&
);
/** Default Assignment Operator */
void operator=(
const CGSearchDirCalculator&
);
///@}
/** Method to easily access CGPenalty data */
CGPenaltyData& CGPenData()
{
CGPenaltyData& cg_pen_data = static_cast<CGPenaltyData&>(IpData().AdditionalData());
DBG_ASSERT(dynamic_cast<CGPenaltyData*>(&IpData().AdditionalData()));
return cg_pen_data;
}
/** Method to easily access CGPenalty calculated quantities */
CGPenaltyCq& CGPenCq()
{
CGPenaltyCq& cg_pen_cq = static_cast<CGPenaltyCq&>(IpCq().AdditionalCq());
DBG_ASSERT(dynamic_cast<CGPenaltyCq*>(&IpCq().AdditionalCq()));
return cg_pen_cq;
}
/** @name Algorithmic parameters */
///@{
/** safeguard factor for bound multipliers.
*
* If value >= 1, then
* the dual variables will never deviate from the primal estimate
* by more than the factors kappa_sigma and 1./kappa_sigma.
*/
Number penalty_init_min_;
/** Maximal value for initial penalty parameter */
Number penalty_init_max_;
/** Maximal value for penalty parameters */
Number penalty_max_;
/** parameters used in computation of line search penalty parameter and
* KKT perturbation parameters
*/
Number pen_des_fact_;
/** Algorithm type */
bool penalty_backward_;
/** parameters used to check if the fast direction can be
* used as the line search direction
*/
Number kappa_x_dis_;
Number kappa_y_dis_;
Number vartheta_;
Number delta_y_max_;
Number fast_des_fact_;
Number pen_init_fac_;
/** Flag indicating whether the fast Chen-Goldfarb direction
* should never be used
*/
bool never_use_fact_cgpen_direction_;
/** Counter for how many times the pen parameter is updated non-monotonically */
Index nonmonotone_pen_update_counter_;
///@}
/** @name Strategy objects */
///@{
SmartPtr<PDSystemSolver> pd_solver_;
///@}
};
} // namespace Ipopt
#endif