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
// Copyright (C) 2008 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors: Andreas Waechter IBM 2008-09-09
#ifndef __IPINEXACTPDSOLVER_HPP__
#define __IPINEXACTPDSOLVER_HPP__
#include "IpAlgStrategy.hpp"
#include "IpAugSystemSolver.hpp"
#include "IpPDPerturbationHandler.hpp"
#include "IpInexactCq.hpp"
namespace Ipopt
{
/** This is the implementation of the Primal-Dual System, allowing
* the usage of an inexact linear solver.
*
* The step computed is usually for the tangential step.
*/
class InexactPDSolver: public AlgorithmStrategyObject
{
public:
/** @name Constructor/Destructor */
///@{
/** Constructor that takes in the Augmented System solver that
* is to be used inside
*/
InexactPDSolver(
AugSystemSolver& augSysSolver,
PDPerturbationHandler& perturbHandler
);
/** Destructor */
virtual ~InexactPDSolver();
///@}
bool InitializeImpl(
const OptionsList& options,
const std::string& prefix
);
/** Solve the primal dual system, given one right hand side.
*/
virtual bool Solve(
const IteratesVector& rhs,
IteratesVector& sol
);
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 */
InexactPDSolver();
/** Overloaded Assignment Operator */
InexactPDSolver& operator=(
const InexactPDSolver&
);
///@}
/** Method to easily access Inexact data */
InexactData& InexData()
{
InexactData& inexact_data = static_cast<InexactData&>(IpData().AdditionalData());
DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
return inexact_data;
}
/** Method to easily access Inexact calculated quantities */
InexactCq& InexCq()
{
InexactCq& inexact_cq = static_cast<InexactCq&>(IpCq().AdditionalCq());
DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
return inexact_cq;
}
/** @name Strategy objects to hold on to. */
///@{
/** Pointer to the Solver for the augmented system */
SmartPtr<AugSystemSolver> augSysSolver_;
/** Pointer to the Perturbation Handler. */
SmartPtr<PDPerturbationHandler> perturbHandler_;
///@}
/** Internal function for computing the residual (resid) given the
* right hand side (rhs) and the solution of the system (res).
*/
void ComputeResiduals(
const SymMatrix& W,
const Matrix& J_c,
const Matrix& J_d,
const Matrix& Pd_L,
const Matrix& Pd_U,
const Vector& v_L,
const Vector& v_U,
const Vector& slack_s_L,
const Vector& slack_s_U,
const Vector& sigma_s,
const IteratesVector& rhs,
const IteratesVector& res,
IteratesVector& resid
);
/** Method for checking if the Hessian matrix has to be modified.
*
* All required data is obtained from the Data objects, so those
* values have to be set before this is called.
*/
bool HessianRequiresChange();
/** @name Algorithmic options */
///@{
/** Psi factor in the tangential component condition */
Number tcc_psi_;
/** theta factor in the tangential component condition */
Number tcc_theta_;
/** mu exponent when multiplied to theta in the tangential
* component condition */
Number tcc_theta_mu_exponent_;
/** flag indicating if the Hessian for the (s,s) part should be
* modified with the slacks instead of the identity matrix
*/
bool modify_hessian_with_slacks_;
/** Threshold on line search evaluation count to trigger Hessian
* modification.
*/
Index inexact_regularization_ls_count_trigger_;
///@}
/** flag indicating if we are dealing with the Pardiso solver
* (temporary)
*/
bool is_pardiso_;
Index last_info_ls_count_;
};
} // namespace Ipopt
#endif