ROL
ROL_TypeU_TrustRegionAlgorithm.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_TYPEU_TRUSTREGIONALGORITHM_H
11 #define ROL_TYPEU_TRUSTREGIONALGORITHM_H
12 
13 #include "ROL_TypeU_Algorithm.hpp"
15 #include "ROL_TrustRegion_U.hpp"
17 #include "ROL_Secant.hpp"
18 
24 namespace ROL {
25 namespace TypeU {
26 
27 template<typename Real>
28 class TrustRegionAlgorithm : public Algorithm<Real> {
29 private:
30  // TRUST REGION INFORMATION
31  Ptr<TrustRegion_U<Real>> solver_;
32  Ptr<TrustRegionModel_U<Real>> model_;
34  Real delMax_;
35  Real eta0_;
36  Real eta1_;
37  Real eta2_;
38  Real gamma0_;
39  Real gamma1_;
40  Real gamma2_;
41  Real TRsafe_;
42  Real eps_;
44  int SPflag_;
45  int SPiter_;
46 
47  // NONMONOTONE INFORMATION
48  bool useNM_;
50 
51  // SECANT INFORMATION
55 
56  // INEXACT COMPUTATION PARAMETERS
57  std::vector<bool> useInexact_;
58  Real scale0_;
59  Real scale1_;
62  Real gtol_;
63 
64  // VERBOSITY SETTING
65  int verbosity_;
66  bool printHeader_;
67 
71 
72 public:
73 
74  TrustRegionAlgorithm( ParameterList &parlist,
75  const Ptr<Secant<Real>> &secant = nullPtr );
76 
78  void run( Vector<Real> &x,
79  const Vector<Real> &g,
80  Objective<Real> &obj,
81  std::ostream &outStream = std::cout) override;
82 
83  void writeHeader( std::ostream& os ) const override;
84 
85  void writeName( std::ostream& os ) const override;
86 
87  void writeOutput( std::ostream& os, const bool print_header = false ) const override;
88 
89 private:
90 
91  void initialize(const Vector<Real> &x, const Vector<Real> &g, Vector<Real> &Bg,
92  Objective<Real> &obj, std::ostream &outStream = std::cout);
93 
94  Real computeValue(const Vector<Real> &x, Objective<Real> &obj, Real pRed);
95 
108  void computeGradient(const Vector<Real> &x, Objective<Real> &obj, bool accept);
109 
110 }; // class ROL::TrustRegionAlgorithm
111 } // namespace TypeU
112 } // namespace ROL
113 
115 
116 #endif
int verbosity_
Print additional information to screen if &gt; 0.
Provides the interface to evaluate objective functions.
void initialize(const Vector< Real > &x, const Vector< Real > &g, Vector< Real > &Bg, Objective< Real > &obj, std::ostream &outStream=std::cout)
Real scale1_
Scale for inexact gradient computation.
TrustRegionAlgorithm(ParameterList &parlist, const Ptr< Secant< Real >> &secant=nullPtr)
void computeGradient(const Vector< Real > &x, Objective< Real > &obj, bool accept)
Compute gradient to iteratively satisfy inexactness condition.
Real delMax_
Maximum trust-region radius.
Ptr< TrustRegion_U< Real > > solver_
Container for trust-region solver object.
bool printHeader_
Print header at every iteration.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
Ptr< TrustRegionModel_U< Real > > model_
Container for trust-region model.
Real gamma0_
Radius decrease rate (negative rho).
void writeOutput(std::ostream &os, const bool print_header=false) const override
Print iterate status.
ETRFlag
Enumation of flags used by trust-region solvers.
ESecant
Enumeration of secant update algorithms.
Definition: ROL_Types.hpp:456
Contains definitions of enums for trust region algorithms.
int SPiter_
Subproblem solver iteration count.
int SPflag_
Subproblem solver termination flag.
Provides an interface to run unconstrained optimization algorithms.
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...
void writeName(std::ostream &os) const override
Print step name.
Provides interface for and implements limited-memory secant operators.
Definition: ROL_Secant.hpp:45
Real scale0_
Scale for inexact gradient computation.
void writeHeader(std::ostream &os) const override
Print iterate header.
Real TRsafe_
Safeguard size for numerically evaluating ratio.
Real gamma1_
Radius decrease rate (positive rho).
TRUtils::ETRFlag TRflag_
Trust-region exit flag.
ETrustRegionU etr_
Trust-region subproblem solver type.
ETrustRegionU
Enumeration of trust-region solver types.
std::vector< bool > useInexact_
Flags for inexact (0) objective function, (1) gradient, (2) Hessian.
Provides an interface to run trust-region methods for unconstrained optimization algorithms.
Real eps_
Safeguard for numerically evaluating ratio.
Real computeValue(const Vector< Real > &x, Objective< Real > &obj, Real pRed)