44 #ifndef ROL_SIMULATED_OBJECTIVE_H
45 #define ROL_SIMULATED_OBJECTIVE_H
55 const ROL::Ptr<SampleGenerator<Real> >
sampler_;
56 const ROL::Ptr<Objective_SimOpt<Real> >
pobj_;
67 pobj_->update(x,flag,iter);
70 pobj_->update(x,type,iter);
77 ROL::Ptr<const Vector<Real> > uptr = uz.
get_1();
78 ROL::Ptr<const Vector<Real> > zptr = uz.
get_2();
81 std::vector<Real> param;
87 param =
sampler_->getMyPoint(static_cast<int>(i));
88 weight =
sampler_->getMyWeight(static_cast<int>(i));
89 pobj_->setParameter(param);
91 tmpval =
pobj_->value(*(pu.
get(i)), *zptr, tol);
92 tmpsum += tmpval*weight;
104 ROL::Ptr<const Vector<Real> > xuptr = xuz.
get_1();
105 ROL::Ptr<const Vector<Real> > xzptr = xuz.
get_2();
109 ROL::Ptr<Vector<Real> > guptr = guz.
get_1();
110 ROL::Ptr<Vector<Real> > gzptr = guz.
get_2();
113 std::vector<Real> param;
115 ROL::Ptr<Vector<Real> > tmp1 = gzptr->clone();
116 ROL::Ptr<Vector<Real> > tmp2 = gzptr->clone();
118 param =
sampler_->getMyPoint(static_cast<int>(i));
119 weight =
sampler_->getMyWeight(static_cast<int>(i));
120 pobj_->setParameter(param);
124 pobj_->gradient(gi, xi, tol);
140 ROL::Ptr<const Vector<Real> > xuptr = xuz.
get_1();
141 ROL::Ptr<const Vector<Real> > xzptr = xuz.
get_2();
145 ROL::Ptr<const Vector<Real> > vuptr = vuz.
get_1();
146 ROL::Ptr<const Vector<Real> > vzptr = vuz.
get_2();
150 ROL::Ptr<Vector<Real> > hvuptr = hvuz.
get_1();
151 ROL::Ptr<Vector<Real> > hvzptr = hvuz.
get_2();
154 std::vector<Real> param;
156 ROL::Ptr<Vector<Real> > tmp1 = hvzptr->clone();
157 ROL::Ptr<Vector<Real> > tmp2 = hvzptr->clone();
159 param =
sampler_->getMyPoint(static_cast<int>(i));
160 weight =
sampler_->getMyWeight(static_cast<int>(i));
161 pobj_->setParameter(param);
166 pobj_->hessVec(hvi, vi, xi, tol);
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
typename PV< Real >::size_type size_type
const ROL::Ptr< SampleGenerator< Real > > sampler_
ROL::Ptr< const Vector< Real > > get_2() const
Defines the linear algebra or vector space interface for simulation-based optimization.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the linear algebra of a vector space on a generic partitioned vector where the individual vec...
ROL::Ptr< const Vector< Real > > get(size_type i) const
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
size_type numVectors() const
virtual ~SimulatedObjective()
const ROL::Ptr< Objective_SimOpt< Real > > pobj_
SimulatedObjective(const ROL::Ptr< SampleGenerator< Real > > &sampler, const ROL::Ptr< Objective_SimOpt< Real > > &pobj)
void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< const Vector< Real > > get_1() const