ROL
ROL_Objective_FSsolver_Def.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_OBJECTIVE_FSSOLVER_DEF_H
11#define ROL_OBJECTIVE_FSSOLVER_DEF_H
12
13namespace ROL {
14
15template<typename Real>
16Real Objective_FSsolver<Real>::value( const Vector<Real> &u, Real &tol ) {
17 return static_cast<Real>(0.5)*u.dot(u);
18}
19
20template<typename Real>
22 g.set(u.dual());
23}
24
25template<typename Real>
26void Objective_FSsolver<Real>::hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &u, Real &tol ) {
27 hv.set(v.dual());
28}
29
30} // namespace ROL
31
32#endif
Real value(const Vector< Real > &u, Real &tol) override
Compute value.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, Real &tol) override
Apply Hessian approximation to vector.
void gradient(Vector< Real > &g, const Vector< Real > &u, Real &tol) override
Compute gradient.
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
virtual Real dot(const Vector &x) const =0
Compute where .