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