44#ifndef ROL_REDUCED_OBJECTIVE_SIMOPT_DEF_H
45#define ROL_REDUCED_OBJECTIVE_SIMOPT_DEF_H
49template<
typename Real>
57 const bool useFDhessVec)
76template<
typename Real>
87 const bool useFDhessVec)
106template<
typename Real>
115 const bool useFDhessVec)
133template<
typename Real>
145 const bool useFDhessVec)
163template<
typename Real>
174template<
typename Real>
185template<
typename Real>
194template<
typename Real>
208template<
typename Real>
236template<
typename Real>
242template<
typename Real>
245 con_->setParameter(param);
246 obj_->setParameter(param);
249template<
typename Real>
251 int nupda(0), nvalu(0), ngrad(0), nhess(0), nprec(0), nstat(0), nadjo(0), nssen(0), nasen(0);
252 if (bman == nullPtr) {
264 auto sumAll = [bman](
int val) {
265 Real global(0), local(val);
266 bman->sumAll(&local,&global,1);
267 return static_cast<int>(global);
280 stream << std::string(80,
'=') << std::endl;
281 stream <<
" ROL::Reduced_Objective_SimOpt::summarize" << std::endl;
282 stream <<
" Number of calls to update: " << nupda << std::endl;
283 stream <<
" Number of calls to value: " << nvalu << std::endl;
284 stream <<
" Number of calls to gradient: " << ngrad << std::endl;
285 stream <<
" Number of calls to hessvec: " << nhess << std::endl;
286 stream <<
" Number of calls to precond: " << nprec << std::endl;
287 stream <<
" Number of state solves: " << nstat << std::endl;
288 stream <<
" Number of adjoint solves: " << nadjo << std::endl;
289 stream <<
" Number of state sensitivity solves: " << nssen << std::endl;
290 stream <<
" Number of adjoint sensitivity solves: " << nasen << std::endl;
291 stream << std::string(80,
'=') << std::endl;
295template<
typename Real>
301template<
typename Real>
329template<
typename Real>
339 adjoint_->scale(
static_cast<Real
>(-1));
346template<
typename Real>
355template<
typename Real>
Defines the constraint operator interface for simulation-based optimization.
Provides the interface to evaluate simulation-based objective functions.
virtual void setParameter(const std::vector< Real > ¶m)
const std::vector< Real > getParameter(void) const
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &z, Real &tol) override
Apply a reduced Hessian preconditioner.
Ptr< VectorController< Real > > adjointStore_
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &z, Real &tol) override
Given , evaluate the Hessian of the objective function in the direction .
Ptr< Vector< Real > > dualadjoint_
Ptr< Vector< Real > > state_
void solve_state_sensitivity(const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given which solves the state equation and a direction , solve the state senstivity equation for .
Ptr< Vector< Real > > dualstate1_
Ptr< Vector< Real > > dualcontrol_
Ptr< Vector< Real > > adjoint_
Real value(const Vector< Real > &z, Real &tol) override
Given , evaluate the objective function where solves .
const Ptr< Constraint_SimOpt< Real > > con_
Reduced_Objective_SimOpt(const Ptr< Objective_SimOpt< Real > > &obj, const Ptr< Constraint_SimOpt< Real > > &con, const Ptr< Vector< Real > > &state, const Ptr< Vector< Real > > &control, const Ptr< Vector< Real > > &adjoint, const bool storage=true, const bool useFDhessVec=false)
Constructor.
Ptr< Vector< Real > > adjoint_sens_
void solve_adjoint_equation(const Vector< Real > &z, Real &tol)
Given which solves the state equation, solve the adjoint equation for .
Ptr< VectorController< Real > > stateStore_
void update(const Vector< Real > &z, bool flag=true, int iter=-1) override
Update the SimOpt objective function and equality constraint.
void solve_state_equation(const Vector< Real > &z, Real &tol)
void gradient(Vector< Real > &g, const Vector< Real > &z, Real &tol) override
Given , evaluate the gradient of the objective function where solves .
Ptr< Vector< Real > > state_sens_
void solve_adjoint_sensitivity(const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given , the adjoint variable , and a direction , solve the adjoint sensitvity equation for .
void setParameter(const std::vector< Real > ¶m) override
void summarize(std::ostream &stream, const Ptr< BatchManager< Real > > &bman=nullPtr) const
const Ptr< Objective_SimOpt< Real > > obj_
Ptr< Vector< Real > > dualstate_
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
virtual void plus(const Vector &x)=0
Compute , where .