10 #ifndef ROL_CHAIN_RULE_OBJECTIVE_HPP
11 #define ROL_CHAIN_RULE_OBJECTIVE_HPP
32 template<
typename Real>
46 :
obj_(obj),
con_(con),
g_(l.clone()),
y_(l.dual().clone()),
Jv_(l.dual().clone()),
59 con_->update(x,type,iter);
61 obj_->update(*
y_,type,iter);
72 con_->update(x,flag,iter);
74 obj_->update(*
y_,flag,iter);
85 return obj_->value(*
y_,tol);
99 con_->applyAdjointJacobian(g,*
g_,x,tol);
113 con_->applyJacobian(*
Jv_,v,x,tol);
116 con_->applyAdjointHessian(hv,*
g_,v,x,tol);
122 const Ptr<Objective<Real>>
obj_;
123 const Ptr<Constraint<Real>>
con_;
131 #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.