ROL
ROL_ScaledObjective.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_SCALED_OBJECTIVE_HPP
11 #define ROL_SCALED_OBJECTIVE_HPP
12 
13 #include "ROL_Objective.hpp"
14 
15 namespace ROL {
16 
17 template <typename Real>
18 class ScaledObjective : public Objective<Real> {
19 private:
20  const Ptr<Objective<Real>> obj_;
21  const Real scale_;
22 
23 public:
24  ScaledObjective(const Ptr<Objective<Real>> &obj, Real scale)
25  : obj_(obj), scale_(scale) {}
26 
27  void update(const Vector<Real> &x, UpdateType type, int iter = -1) override;
28  void setParameter(const std::vector<Real> &param) override;
29  Real value( const Vector<Real> &x, Real &tol ) override;
30  void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
31  void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
32  void invHessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
33  void precond( Vector<Real> &Pv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
34 
35 }; // class ScaledObjective
36 
37 } // End ROL Namespace
38 
40 
41 #endif
Provides the interface to evaluate objective functions.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply preconditioner to vector.
ScaledObjective(const Ptr< Objective< Real >> &obj, Real scale)
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
void setParameter(const std::vector< Real > &param) override
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply inverse Hessian approximation to vector.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
const Ptr< Objective< Real > > obj_