ROL
ROL_TypeB_GradientAlgorithm.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_TYPEB_GRADIENTALGORITHM_HPP
11#define ROL_TYPEB_GRADIENTALGORITHM_HPP
12
14
19namespace ROL {
20namespace TypeB {
21
22template<typename Real>
23class GradientAlgorithm : public TypeB::Algorithm<Real> {
24private:
25 int maxit_;
30
31 using TypeB::Algorithm<Real>::status_;
32 using TypeB::Algorithm<Real>::state_;
33 using TypeB::Algorithm<Real>::proj_;
34
36 const Vector<Real> &g,
37 Objective<Real> &obj,
39 std::ostream &outStream = std::cout);
40
41public:
42
43 GradientAlgorithm(ParameterList &list);
44
45 using TypeB::Algorithm<Real>::run;
46 void run( Vector<Real> &x,
47 const Vector<Real> &g,
48 Objective<Real> &obj,
50 std::ostream &outStream = std::cout) override;
51
52 void writeHeader( std::ostream& os ) const override;
53
54 void writeName( std::ostream& os ) const override;
55
56 void writeOutput( std::ostream& os, const bool write_header = false ) const override;
57
58}; // class ROL::TypeB::GradientAlgorithm
59
60} // namespace TypeB
61} // namespace ROL
62
64
65#endif
Provides the interface to apply upper and lower bound constraints.
Provides the interface to evaluate objective functions.
Provides an interface to run bound constrained optimization algorithms.
Ptr< PolyhedralProjection< Real > > proj_
const Ptr< AlgorithmState< Real > > state_
const Ptr< CombinedStatusTest< Real > > status_
Provides an interface to run the projected gradient algorithm.
void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout) override
Run algorithm on bound constrained problems (Type-B). This general interface supports the use of dual...
void writeHeader(std::ostream &os) const override
Print iterate header.
void initialize(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
void writeName(std::ostream &os) const override
Print step name.
void writeOutput(std::ostream &os, const bool write_header=false) const override
Print iterate status.
Defines the linear algebra or vector space interface.