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