ROL
ROL_QuadraticObjective.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_QUADRATIC_OBJECTIVE_H
11 #define ROL_QUADRATIC_OBJECTIVE_H
12 
13 #include "ROL_Objective.hpp"
14 #include "ROL_Vector.hpp"
15 #include "ROL_Ptr.hpp"
16 #include "ROL_LinearOperator.hpp"
17 
34 namespace ROL {
35 
36 template<typename Real>
37 class QuadraticObjective : public Objective<Real> {
38 private:
39  const Ptr<const LinearOperator<Real>> H_;
40  const Ptr<const Vector<Real>> g_;
41  const Real c_;
42  Ptr<Vector<Real>> tmp_;
43 
44 public:
45  QuadraticObjective(const Ptr<const LinearOperator<Real>> &H,
46  const Ptr<const Vector<Real>> &g,
47  Real c = Real(0));
48 
49  Real value( const Vector<Real> &x, Real &tol ) override;
50  void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
51  void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
52  void invHessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
53 
54 }; // class QuadraticObjective
55 
56 } // namespace ROL
57 
59 
60 #endif
QuadraticObjective(const Ptr< const LinearOperator< Real >> &H, const Ptr< const Vector< Real >> &g, Real c=Real(0))
Provides the interface to evaluate objective functions.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
Provides the interface to evaluate quadratic objective functions.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
const Ptr< const LinearOperator< Real > > H_
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
Provides the interface to apply a linear operator.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply inverse Hessian approximation to vector.
const Ptr< const Vector< Real > > g_