10#ifndef ROL_REDUCEDDYNAMICSTATIONARYCONTROLSOBJECTIVE_HPP
11#define ROL_REDUCEDDYNAMICSTATIONARYCONTROLSOBJECTIVE_HPP
20template <
typename Real>
42template <
typename Real>
46 using size_type =
typename std::vector<Real>::size_type;
87 hook_->postValue(val);
95 hook_->preGradient(x);
102 if (
hook_ != nullPtr)
103 hook_->postGradient(g);
123 Ptr<ReducedDynamicStationaryControlsObjectiveHook<Real>>
hook_;
Provides the interface to evaluate objective functions.
static Ptr< PartitionedVector > create(std::initializer_list< Vp > vs)
Defines the reduced time-dependent objective function interface for simulation-based optimization.
virtual void preValue(const Vector< Real > &x) const =0
virtual void postValue(Real val) const =0
virtual void preGradient(const Vector< Real > &x) const =0
ReducedDynamicStationaryControlsObjectiveHook()
virtual void postGradient(const Vector< Real > &g) const =0
virtual ~ReducedDynamicStationaryControlsObjectiveHook()
Defines the reduced time-dependent objective function interface for simulation-based optimization whe...
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Ptr< PartitionedVector< Real > > x_dyn_
Ptr< PartitionedVector< Real > > g_dyn_
ReducedDynamicStationaryControlsObjective(const Ptr< ReducedDynamicObjective< Real > > &red_dyn_obj, const Ptr< Vector< Real > > &x, const size_type Nt, const Ptr< ReducedDynamicStationaryControlsObjectiveHook< Real > > &hook=nullPtr)
void update(const Vector< Real > &x, bool flag=true, int iter=-1) override
Update objective function.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
Ptr< PartitionedVector< Real > > v_dyn_
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
typename std::vector< Real >::size_type size_type
virtual ~ReducedDynamicStationaryControlsObjective()
Ptr< ReducedDynamicStationaryControlsObjectiveHook< Real > > hook_
Ptr< ReducedDynamicObjective< Real > > red_dyn_obj_
Defines the linear algebra or vector space interface.
virtual void zero()
Set to zero vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .