44 #ifndef ROL_QUADRATIC_OBJECTIVE_DEF_H
45 #define ROL_QUADRATIC_OBJECTIVE_DEF_H
49 template<
typename Real>
53 : H_(H), g_(g), c_(c) {
57 template<
typename Real>
59 H_->apply(*tmp_,x,tol);
60 tmp_->scale(static_cast<Real>(0.5));
63 return x.
apply(*tmp_) + c_;
66 template<
typename Real>
72 template<
typename Real>
77 template<
typename Real>
79 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_