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