ROL
ROL_TypeU_TrustRegionAlgorithm.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_TYPEU_TRUSTREGIONALGORITHM_H
45#define ROL_TYPEU_TRUSTREGIONALGORITHM_H
46
49#include "ROL_TrustRegion_U.hpp"
51#include "ROL_Secant.hpp"
52
58namespace ROL {
59namespace TypeU {
60
61template<typename Real>
62class TrustRegionAlgorithm : public Algorithm<Real> {
63private:
64 // TRUST REGION INFORMATION
65 Ptr<TrustRegion_U<Real>> solver_;
66 Ptr<TrustRegionModel_U<Real>> model_;
68 Real delMax_;
69 Real eta0_;
70 Real eta1_;
71 Real eta2_;
72 Real gamma0_;
73 Real gamma1_;
74 Real gamma2_;
75 Real TRsafe_;
76 Real eps_;
78 int SPflag_;
79 int SPiter_;
80
81 // NONMONOTONE INFORMATION
82 bool useNM_;
84
85 // SECANT INFORMATION
89
90 // INEXACT COMPUTATION PARAMETERS
91 std::vector<bool> useInexact_;
92 Real scale0_;
93 Real scale1_;
96
97 // VERBOSITY SETTING
100
101 using Algorithm<Real>::state_;
102 using Algorithm<Real>::status_;
103 using Algorithm<Real>::initialize;
104
105public:
106
107 TrustRegionAlgorithm( ParameterList &parlist,
108 const Ptr<Secant<Real>> &secant = nullPtr );
109
110 using Algorithm<Real>::run;
111 void run( Vector<Real> &x,
112 const Vector<Real> &g,
113 Objective<Real> &obj,
114 std::ostream &outStream = std::cout) override;
115
116 void writeHeader( std::ostream& os ) const override;
117
118 void writeName( std::ostream& os ) const override;
119
120 void writeOutput( std::ostream& os, bool print_header = false ) const override;
121
122private:
123
124 void initialize(const Vector<Real> &x, const Vector<Real> &g, Vector<Real> &Bg,
125 Objective<Real> &obj, std::ostream &outStream = std::cout);
126
127 Real computeValue(const Vector<Real> &x, Objective<Real> &obj, Real pRed);
128
141 void computeGradient(const Vector<Real> &x, Objective<Real> &obj);
142
143}; // class ROL::TrustRegionAlgorithm
144} // namespace TypeU
145} // namespace ROL
146
148
149#endif
Contains definitions of enums for trust region algorithms.
Provides the interface to evaluate objective functions.
Provides interface for and implements limited-memory secant operators.
Definition: ROL_Secant.hpp:79
Provides an interface to run unconstrained optimization algorithms.
const Ptr< CombinedStatusTest< Real > > status_
const Ptr< AlgorithmState< Real > > state_
Provides an interface to run trust-region methods for unconstrained optimization algorithms.
Real scale1_
Scale for inexact gradient computation.
bool printHeader_
Print header at every iteration.
std::vector< bool > useInexact_
Flags for inexact (0) objective function, (1) gradient, (2) Hessian.
int SPiter_
Subproblem solver iteration count.
Real gamma0_
Radius decrease rate (negative rho).
Real TRsafe_
Safeguard size for numerically evaluating ratio.
void writeHeader(std::ostream &os) const override
Print iterate header.
Real scale0_
Scale for inexact gradient computation.
void writeOutput(std::ostream &os, bool print_header=false) const override
Print iterate status.
Real eps_
Safeguard for numerically evaluating ratio.
int verbosity_
Print additional information to screen if > 0.
void writeName(std::ostream &os) const override
Print step name.
Real computeValue(const Vector< Real > &x, Objective< Real > &obj, Real pRed)
Real gamma1_
Radius decrease rate (positive rho).
int SPflag_
Subproblem solver termination flag.
TRUtils::ETRFlag TRflag_
Trust-region exit flag.
Real delMax_
Maximum trust-region radius.
Ptr< TrustRegionModel_U< Real > > model_
Container for trust-region model.
void initialize(const Vector< Real > &x, const Vector< Real > &g, Vector< Real > &Bg, Objective< Real > &obj, std::ostream &outStream=std::cout)
void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, std::ostream &outStream=std::cout) override
Run algorithm on unconstrained problems (Type-U). This general interface supports the use of dual opt...
ETrustRegionU etr_
Trust-region subproblem solver type.
void computeGradient(const Vector< Real > &x, Objective< Real > &obj)
Compute gradient to iteratively satisfy inexactness condition.
Ptr< TrustRegion_U< Real > > solver_
Container for trust-region solver object.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:84