10 #ifndef ROL_QUADRATIC_OBJECTIVE_DEF_H
11 #define ROL_QUADRATIC_OBJECTIVE_DEF_H
15 template<
typename Real>
19 : H_(H), g_(g), c_(c) {
23 template<
typename Real>
25 H_->apply(*tmp_,x,tol);
26 tmp_->scale(static_cast<Real>(0.5));
29 return x.
apply(*tmp_) + c_;
32 template<
typename Real>
38 template<
typename Real>
43 template<
typename Real>
45 H_->applyInverse(hv,v,tol);
QuadraticObjective(const Ptr< const LinearOperator< Real >> &H, const Ptr< const Vector< Real >> &g, Real c=Real(0))
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
virtual void plus(const Vector &x)=0
Compute , where .
Defines the linear algebra or vector space interface.
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_
Ptr< Vector< Real > > tmp_