ROL
ROL_TypeE_CompositeStepAlgorithm.hpp
Go to the documentation of this file.
1// @HEADER
2// ************************************************************************
3//
4// Rapid Optimization Library (ROL) Package
5// Copyright (2014) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact lead developers:
38// Drew Kouri (dpkouri@sandia.gov) and
39// Denis Ridzal (dridzal@sandia.gov)
40//
41// ************************************************************************
42// @HEADER
43
44#ifndef ROL_TYPEE_COMPOSITESTEPALGORITHM_H
45#define ROL_TYPEE_COMPOSITESTEPALGORITHM_H
46
48
55namespace ROL {
56namespace TypeE {
57
58template<typename Real>
60private:
61 // Parameter list.
62 ParameterList list_;
63
64 // Vectors used for cloning.
65 ROL::Ptr<Vector<Real> > xvec_;
66 ROL::Ptr<Vector<Real> > gvec_;
67 ROL::Ptr<Vector<Real> > cvec_;
68 ROL::Ptr<Vector<Real> > lvec_;
69
70 // Diagnostic return flags for subalgorithms.
74
75 // Stopping conditions.
78 Real tolCG_;
79 Real tolOSS_;
81
82 // Tolerances and stopping conditions for subalgorithms.
83 Real lmhtol_;
84 Real qntol_;
85 Real pgtol_;
88 Real tntmax_;
89
90 // Trust-region parameters.
91 Real zeta_;
92 Real Delta_;
94 Real eta_;
96
97 Real ared_;
98 Real pred_;
99 Real snorm_;
100 Real nnorm_;
101 Real tnorm_;
102
103 // Output flags.
110
111 // Performance summary.
118
119 // Verbosity flags.
122
123 using TypeE::Algorithm<Real>::state_;
124 using TypeE::Algorithm<Real>::status_;
125
128 void initialize(Vector<Real> &x,
129 const Vector<Real> &g,
130 Vector<Real> &l,
131 const Vector<Real> &c,
132 Objective<Real> &obj,
133 Constraint<Real> &con,
134 std::ostream &outStream = std::cout);
135
139 const Vector<Real> &x,
140 const Vector<Real> &l,
141 Objective<Real> &obj,
142 Constraint<Real> &con);
143
147 Vector<Real> &l,
148 const Vector<Real> &s,
149 Objective<Real> &obj,
150 Constraint<Real> &con);
151
162 const Vector<Real> &x,
163 const Vector<Real> &gf,
164 Constraint<Real> &con);
165
189 const Vector<Real> &c,
190 const Vector<Real> &x,
191 Real delta,
192 Constraint<Real> &con);
193
209 Vector<Real> &tCP,
210 Vector<Real> &Wg,
211 const Vector<Real> &x,
212 const Vector<Real> &g,
213 const Vector<Real> &n,
214 const Vector<Real> &l,
215 Real delta,
216 Objective<Real> &obj,
217 Constraint<Real> &con);
218
221 void accept(Vector<Real> &s, Vector<Real> &n, Vector<Real> &t, Real f_new, Vector<Real> &c_new,
222 Vector<Real> &gf_new, Vector<Real> &l_new, Vector<Real> &g_new,
223 const Vector<Real> &x, const Vector<Real> &l, Real f, const Vector<Real> &gf, const Vector<Real> &c,
224 const Vector<Real> &g, Vector<Real> &tCP, Vector<Real> &Wg,
226
227 template<typename T> int sgn(T val) const;
228
229 void printInfoLS(const std::vector<Real> &res) const;
230
231 Real setTolOSS(const Real intol) const;
232
233
234public:
235
236 CompositeStepAlgorithm(ParameterList &list);
237
238 using TypeE::Algorithm<Real>::run;
239 virtual void run(Vector<Real> &x,
240 const Vector<Real> &g,
241 Objective<Real> &obj,
242 Constraint<Real> &econ,
243 Vector<Real> &emul,
244 const Vector<Real> &eres,
245 std::ostream &outStream = std::cout) override;
246
247 virtual void writeHeader(std::ostream& os) const override;
248
249 virtual void writeName(std::ostream& os) const override;
250
251 virtual void writeOutput(std::ostream& os, const bool print_header = false) const override;
252
253}; // class ROL::TypeE::CompositeStepAlgorithm
254
255} // namespace TypeE
256} // namespace ROL
257
259
260#endif
Defines the general constraint operator interface.
Provides the interface to evaluate objective functions.
const Ptr< AlgorithmState< Real > > state_
const Ptr< CombinedStatusTest< Real > > status_
Provides an interface to run equality constrained optimization algorithms using the Composite-Step Tr...
void accept(Vector< Real > &s, Vector< Real > &n, Vector< Real > &t, Real f_new, Vector< Real > &c_new, Vector< Real > &gf_new, Vector< Real > &l_new, Vector< Real > &g_new, const Vector< Real > &x, const Vector< Real > &l, Real f, const Vector< Real > &gf, const Vector< Real > &c, const Vector< Real > &g, Vector< Real > &tCP, Vector< Real > &Wg, Objective< Real > &obj, Constraint< Real > &con)
Check acceptance of subproblem solutions, adjust merit function penalty parameter,...
void computeLagrangeMultiplier(Vector< Real > &l, const Vector< Real > &x, const Vector< Real > &gf, Constraint< Real > &con)
Compute Lagrange multipliers by solving the least-squares problem minimizing the gradient of the Lagr...
virtual void writeHeader(std::ostream &os) const override
Print iterate header.
void initialize(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, Constraint< Real > &con, std::ostream &outStream=std::cout)
Initialize algorithm by computing a few quantities.
virtual void writeOutput(std::ostream &os, const bool print_header=false) const override
Print iterate status.
virtual void writeName(std::ostream &os) const override
Print step name.
void updateRadius(Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, Constraint< Real > &con)
Update trust-region radius, take step, etc.
void computeQuasinormalStep(Vector< Real > &n, const Vector< Real > &c, const Vector< Real > &x, Real delta, Constraint< Real > &con)
Compute quasi-normal step by minimizing the norm of the linearized constraint.
void solveTangentialSubproblem(Vector< Real > &t, Vector< Real > &tCP, Vector< Real > &Wg, const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &n, const Vector< Real > &l, Real delta, Objective< Real > &obj, Constraint< Real > &con)
Solve tangential subproblem.
virtual void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, Constraint< Real > &econ, Vector< Real > &emul, const Vector< Real > &eres, std::ostream &outStream=std::cout) override
Run algorithm on equality constrained problems (Type-E). This general interface supports the use of d...
void computeTrial(Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, Constraint< Real > &con)
Compute trial step.
void printInfoLS(const std::vector< Real > &res) const
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:84