ROL
ROL_TypeU_LineSearchAlgorithm.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_LINESEARCHALGORITHM_H
11#define ROL_TYPEU_LINESEARCHALGORITHM_H
12
16#include "ROL_LineSearch_U.hpp"
17#include "ROL_Secant.hpp"
18
62
63namespace ROL {
64namespace TypeU {
65
66template <class Real>
67class LineSearchAlgorithm : public Algorithm<Real> {
68private:
69
70 Ptr<DescentDirection_U<Real>> desc_;
71 Ptr<LineSearch_U<Real>> lineSearch_;
72
76
78
80
85
87
88 using Algorithm<Real>::state_;
89 using Algorithm<Real>::status_;
90 using Algorithm<Real>::initialize;
91
92public:
104 LineSearchAlgorithm( ParameterList &parlist,
105 const Ptr<Secant<Real>> &secant = nullPtr,
106 const Ptr<DescentDirection_U<Real>> &descent = nullPtr,
107 const Ptr<LineSearch_U<Real>> &lineSearch = nullPtr );
108
109 void initialize(const Vector<Real> &x, const Vector<Real> &g,
110 Objective<Real> &obj, std::ostream &outStream = std::cout);
111
112 using TypeU::Algorithm<Real>::run;
113 void run( Vector<Real> &x,
114 const Vector<Real> &g,
115 Objective<Real> &obj,
116 std::ostream &outStream = std::cout) override;
117
118 void writeHeader( std::ostream& os ) const override;
119
120 void writeName( std::ostream& os ) const override;
121
122 void writeOutput( std::ostream& os, const bool print_header = false ) const override;
123
124}; // class ROL::TypeU::LineSearchAlgorithm
125
126} // namespace TypeU
127} // namespace ROL
128
130
131#endif
Provides the interface to compute unconstrained optimization steps for line search.
Provides interface for and implements line searches.
Provides the interface to evaluate objective functions.
Algorithm()
Constructor, given a step and a status test.
const Ptr< CombinedStatusTest< Real > > status_
const Ptr< AlgorithmState< Real > > state_
Provides interface for and implements limited-memory secant operators.
Provides an interface to run unconstrained optimization algorithms.
Ptr< DescentDirection_U< Real > > desc_
Unglobalized step object.
LineSearchAlgorithm(ParameterList &parlist, const Ptr< Secant< Real > > &secant=nullPtr, const Ptr< DescentDirection_U< Real > > &descent=nullPtr, const Ptr< LineSearch_U< Real > > &lineSearch=nullPtr)
Constructor.
bool acceptLastAlpha_
For backwards compatibility. When max function evaluations are reached take last step.
void writeHeader(std::ostream &os) const override
Print iterate header.
bool usePreviousAlpha_
If true, use the previously accepted step length (if any) as the new initial step length.
Ptr< LineSearch_U< Real > > lineSearch_
Line-search object.
void writeName(std::ostream &os) const override
Print step name.
EDescentU edesc_
enum determines type of descent direction
void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, std::ostream &outStream=std::cout) override
ELineSearchU els_
enum determines type of line search
void initialize(const Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, std::ostream &outStream=std::cout)
void writeOutput(std::ostream &os, const bool print_header=false) const override
Print iterate status.
ECurvatureConditionU econd_
enum determines type of curvature condition
Defines the linear algebra or vector space interface.