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_;
71 ROL::Ptr<const Vector<Real> > uptr = uz.
get_1();
72 ROL::Ptr<const Vector<Real> > zptr = uz.
get_2();
75 std::vector<Real> param;
81 param =
sampler_->getMyPoint(static_cast<int>(i));
82 weight =
sampler_->getMyWeight(static_cast<int>(i));
83 pobj_->setParameter(param);
85 tmpval =
pobj_->value(*(pu.
get(i)), *zptr, tol);
86 tmpsum += tmpval*weight;
98 ROL::Ptr<const Vector<Real> > xuptr = xuz.
get_1();
99 ROL::Ptr<const Vector<Real> > xzptr = xuz.
get_2();
103 ROL::Ptr<Vector<Real> > guptr = guz.
get_1();
104 ROL::Ptr<Vector<Real> > gzptr = guz.
get_2();
107 std::vector<Real> param;
109 ROL::Ptr<Vector<Real> > tmp1 = gzptr->clone();
110 ROL::Ptr<Vector<Real> > tmp2 = gzptr->clone();
112 param =
sampler_->getMyPoint(static_cast<int>(i));
113 weight =
sampler_->getMyWeight(static_cast<int>(i));
114 pobj_->setParameter(param);
118 pobj_->gradient(gi, xi, tol);
134 ROL::Ptr<const Vector<Real> > xuptr = xuz.
get_1();
135 ROL::Ptr<const Vector<Real> > xzptr = xuz.
get_2();
139 ROL::Ptr<const Vector<Real> > vuptr = vuz.
get_1();
140 ROL::Ptr<const Vector<Real> > vzptr = vuz.
get_2();
144 ROL::Ptr<Vector<Real> > hvuptr = hvuz.
get_1();
145 ROL::Ptr<Vector<Real> > hvzptr = hvuz.
get_2();
148 std::vector<Real> param;
150 ROL::Ptr<Vector<Real> > tmp1 = hvzptr->clone();
151 ROL::Ptr<Vector<Real> > tmp2 = hvzptr->clone();
153 param =
sampler_->getMyPoint(static_cast<int>(i));
154 weight =
sampler_->getMyWeight(static_cast<int>(i));
155 pobj_->setParameter(param);
160 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)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< const Vector< Real > > get_1() const