44 #ifndef ROL_CHAIN_RULE_OBJECTIVE_HPP
45 #define ROL_CHAIN_RULE_OBJECTIVE_HPP
66 template<
typename Real>
80 :
obj_(obj),
con_(con),
g_(l.clone()),
y_(l.dual().clone()),
Jv_(l.dual().clone()),
93 con_->update(x,type,iter);
95 obj_->update(*
y_,type,iter);
106 con_->update(x,flag,iter);
108 obj_->update(*
y_,flag,iter);
119 return obj_->value(*
y_,tol);
133 con_->applyAdjointJacobian(g,*
g_,x,tol);
147 con_->applyJacobian(*
Jv_,v,x,tol);
150 con_->applyAdjointHessian(hv,*
g_,v,x,tol);
156 const Ptr<Objective<Real>>
obj_;
157 const Ptr<Constraint<Real>>
con_;
165 #endif // ROL_CHAIN_RULE_OBJECTIVE_HPP
Provides the interface to evaluate objective functions.
virtual void plus(const Vector &x)=0
Compute , where .
Ptr< Vector< Real > > JtHJv_
Defines the linear algebra or vector space interface.
ChainRuleObjective(const Ptr< Objective< Real >> &obj, const Ptr< Constraint< Real >> &con, const Vector< Real > &x, const Vector< Real > &l)
Constructor.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
const Ptr< Objective< Real > > obj_
Ptr< Vector< Real > > HJv_
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< Vector< Real > > Jv_
virtual Real value(const Vector< Real > &x, Real &tol)
Compute value.
Defines the general constraint operator interface.
virtual void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
virtual ~ChainRuleObjective()=default
const Ptr< Constraint< Real > > con_
Defines an objective of the form f(g(x)) where.