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
// Copyright (C) 2005, 2008 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors: Carl Laird, Andreas Waechter IBM 2005-08-04
#ifndef __IPCGPERTURBATIONHANDLER_HPP__
#define __IPCGPERTURBATIONHANDLER_HPP__
#include "IpPDPerturbationHandler.hpp"
#include "IpCGPenaltyCq.hpp"
namespace Ipopt
{
/** Class for handling the perturbation factors delta_x, delta_s,
* delta_c, and delta_d in the primal dual system.
*
* This class is
* used by the PDFullSpaceSolver to handle the cases where the
* primal-dual system is singular or has the wrong inertia. The
* perturbation factors are obtained based on simple heuristics,
* taking into account the size of previous perturbations.
*/
class CGPerturbationHandler: public PDPerturbationHandler
{
public:
/**@name Constructors/Destructors */
///@{
/** Default Constructor */
CGPerturbationHandler();
/** Destructor */
virtual ~CGPerturbationHandler()
{ }
///@}
/* overloaded from AlgorithmStrategyObject */
virtual bool InitializeImpl(
const OptionsList& options,
const std::string& prefix
);
/** This method must be called for each new matrix, and before any
* other method for generating perturbation factors.
*
* Usually,
* the returned perturbation factors are zero, but if the system
* is thought to be structurally singular, they might be
* positive. If the return value is false, no suitable
* perturbation could be found.
*/
bool ConsiderNewSystem(
Number& delta_x,
Number& delta_s,
Number& delta_c,
Number& delta_d
);
/** This method returns perturbation factors for the case when the
* most recent factorization resulted in a singular matrix.
*
* @return false, if no suitable perturbation could be found
*/
bool PerturbForSingularity(
Number& delta_x,
Number& delta_s,
Number& delta_c,
Number& delta_d
);
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.
*/
///@{
/** Copy Constructor */
CGPerturbationHandler(
const CGPerturbationHandler&
);
/** Default Assignment Operator */
void operator=(
const CGPerturbationHandler&
);
///@}
/** 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;
}
/** The max reference value for scaling the penalty parameter */
Number penalty_max_;
/** Feasibility for perturbation in pure Newton method*/
Number mult_diverg_feasibility_tol_;
};
} // namespace Ipopt
#endif