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"
17
34namespace ROL {
35
36template<typename Real>
37class QuadraticObjective : public Objective<Real> {
38private:
39 const Ptr<const LinearOperator<Real>> H_;
40 const Ptr<const Vector<Real>> g_;
41 const Real c_;
42 Ptr<Vector<Real>> tmp_;
43
44public:
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
Provides the interface to apply a linear operator.
Provides the interface to evaluate objective functions.
Provides the interface to evaluate quadratic objective functions.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
const Ptr< const Vector< Real > > g_
const Ptr< const LinearOperator< Real > > H_
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.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
Defines the linear algebra or vector space interface.