10#ifndef ROL_REDUCED_OBJECTIVE_SIMOPT_DEF_H
11#define ROL_REDUCED_OBJECTIVE_SIMOPT_DEF_H
15template<
typename Real>
23 const bool useFDhessVec)
42template<
typename Real>
53 const bool useFDhessVec)
72template<
typename Real>
81 const bool useFDhessVec)
99template<
typename Real>
111 const bool useFDhessVec)
129template<
typename Real>
140template<
typename Real>
151template<
typename Real>
160template<
typename Real>
174template<
typename Real>
202template<
typename Real>
208template<
typename Real>
211 con_->setParameter(param);
212 obj_->setParameter(param);
215template<
typename Real>
217 int nupda(0), nvalu(0), ngrad(0), nhess(0), nprec(0), nstat(0), nadjo(0), nssen(0), nasen(0);
218 if (bman == nullPtr) {
230 auto sumAll = [bman](
int val) {
231 Real global(0), local(val);
232 bman->sumAll(&local,&global,1);
233 return static_cast<int>(global);
246 stream << std::string(80,
'=') << std::endl;
247 stream <<
" ROL::Reduced_Objective_SimOpt::summarize" << std::endl;
248 stream <<
" Number of calls to update: " << nupda << std::endl;
249 stream <<
" Number of calls to value: " << nvalu << std::endl;
250 stream <<
" Number of calls to gradient: " << ngrad << std::endl;
251 stream <<
" Number of calls to hessvec: " << nhess << std::endl;
252 stream <<
" Number of calls to precond: " << nprec << std::endl;
253 stream <<
" Number of state solves: " << nstat << std::endl;
254 stream <<
" Number of adjoint solves: " << nadjo << std::endl;
255 stream <<
" Number of state sensitivity solves: " << nssen << std::endl;
256 stream <<
" Number of adjoint sensitivity solves: " << nasen << std::endl;
257 stream << std::string(80,
'=') << std::endl;
261template<
typename Real>
267template<
typename Real>
295template<
typename Real>
305 adjoint_->scale(
static_cast<Real
>(-1));
312template<
typename Real>
321template<
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 .