ROL
ROL_TypeP_QuasiNewtonAlgorithm.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_TYPEP_QUASINEWTONALGORITHM_HPP
11#define ROL_TYPEP_QUASINEWTONALGORITHM_HPP
12
14#include "ROL_SecantFactory.hpp"
15
20namespace ROL {
21namespace TypeP {
22
23template<typename Real>
25private:
26 Ptr<Secant<Real>> secant_;
28 std::string secantName_;
29
30 Real t0_;
32
33 int maxit_;
34 Real rhodec_;
35 Real c1_;
36 Real sigma1_;
37 Real sigma2_;
41 std::string algoName_;
42
43 ParameterList list_;
44
45 bool hasLEC_;
49
50 using TypeP::Algorithm<Real>::pgstep;
51 using TypeP::Algorithm<Real>::status_;
52 using TypeP::Algorithm<Real>::state_;
53
55 const Vector<Real> &g,
56 Objective<Real> &sobj,
57 Objective<Real> &nobj,
58 Vector<Real> &dg,
59 std::ostream &outStream = std::cout);
60
61public:
62
63 QuasiNewtonAlgorithm(ParameterList &list, const Ptr<Secant<Real>> &secant = nullPtr);
64
65 using TypeP::Algorithm<Real>::run;
66
67 void run( Vector<Real> &x,
68 const Vector<Real> &g,
69 Objective<Real> &sobj,
70 Objective<Real> &nobj,
71 std::ostream &outStream = std::cout) override;
72
73 void writeHeader( std::ostream& os ) const override;
74
75 void writeName( std::ostream& os ) const override;
76
77 void writeOutput( std::ostream &os, bool write_header = false ) const override;
78
79}; // class ROL::TypeP::QuasiNewtonAlgorithm
80
81} // namespace TypeP
82} // namespace ROL
83
85
86#endif
Provides the interface to evaluate objective functions.
Provides interface for and implements limited-memory secant operators.
Provides an interface to run optimization algorithms to minimize composite optimization problems f+ph...
void pgstep(Vector< Real > &pgiter, Vector< Real > &pgstep, Objective< Real > &nobj, const Vector< Real > &x, const Vector< Real > &dg, Real t, Real &tol) const
const Ptr< AlgorithmState< Real > > state_
const Ptr< CombinedStatusTest< Real > > status_
Provides an interface to run the projected secant algorithm.
Real rhodec_
Backtracking rate (default: 0.5)
Real sigma2_
Upper safeguard for quadratic line search (default: 0.9)
void writeOutput(std::ostream &os, bool write_header=false) const override
Print iterate status.
Real sigma1_
Lower safeguard for quadratic line search (default: 0.1)
Ptr< Secant< Real > > secant_
Secant object (used for quasi-Newton)
int maxit_
Maximum number of line search steps (default: 20)
Real c1_
Sufficient Decrease Parameter (default: 1e-4)
void writeHeader(std::ostream &os) const override
Print iterate header.
void initialize(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &sobj, Objective< Real > &nobj, Vector< Real > &dg, std::ostream &outStream=std::cout)
void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &sobj, Objective< Real > &nobj, 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.
Defines the linear algebra or vector space interface.