44 #ifndef ROL_SIMULATED_OBJECTIVE_CVAR_H
45 #define ROL_SIMULATED_OBJECTIVE_CVAR_H
57 const ROL::Ptr<SampleGenerator<Real> >
sampler_;
58 const ROL::Ptr<Objective_SimOpt<Real> >
pobj_;
59 const ROL::Ptr<PlusFunction<Real> >
pfunc_;
73 pobj_->update(x,flag,iter);
79 ROL::Ptr<const Vector<Real> > uptr = uz.
get_1();
80 ROL::Ptr<const Vector<Real> > zptr = uz.
get_2();
84 ROL::Ptr<const Vector<Real> > z = rz.
getVector();
86 std::vector<Real> param;
87 Real weight(0), one(1);
93 param =
sampler_->getMyPoint(static_cast<int>(i));
94 weight =
sampler_->getMyWeight(static_cast<int>(i));
95 pobj_->setParameter(param);
98 tmpval =
pobj_->value(*(pu.
get(i)), *z, tol);
99 tmpplus =
pfunc_->evaluate(tmpval-t, 0);
100 tmpsum += tmpplus*weight;
103 val *= (one/(one-
alpha_));
114 ROL::Ptr<const Vector<Real> > xuptr = xuz.
get_1();
115 ROL::Ptr<const Vector<Real> > xzptr = xuz.
get_2();
119 ROL::Ptr<const Vector<Real> > xz = rxz.
getVector();
122 ROL::Ptr<Vector<Real> > guptr = guz.
get_1();
123 ROL::Ptr<Vector<Real> > gzptr = guz.
get_2();
126 ROL::Ptr<Vector<Real> > gz = rgz.
getVector();
128 std::vector<Real> param;
129 Real weight(0), one(1), sum(0), tmpsum(0), tmpval(0), tmpplus(0);
132 ROL::Ptr<Vector<Real> > tmp1 = gz->clone();
133 ROL::Ptr<Vector<Real> > tmp2 = gz->clone();
135 param =
sampler_->getMyPoint(static_cast<int>(i));
136 weight =
sampler_->getMyWeight(static_cast<int>(i));
137 pobj_->setParameter(param);
140 tmpval =
pobj_->value(*(pxu.
get(i)), *xz, tol);
141 tmpplus =
pfunc_->evaluate(tmpval-xt, 1);
142 tmpsum += weight*tmpplus;
146 pobj_->gradient(gi, xi, tol);
147 gi.scale(weight*tmpplus);
154 gz->scale(one/(one-
alpha_));
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
ROL::Ptr< std::vector< Real > > getStatistic(const int comp=0, const int index=0)
typename PV< Real >::size_type size_type
const ROL::Ptr< PlusFunction< Real > > pfunc_
ROL::Ptr< const Vector< Real > > get_2() const
Defines the linear algebra or vector space interface for simulation-based optimization.
ROL::Ptr< const Vector< Real > > getVector(void) const
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
SimulatedObjectiveCVaR(const ROL::Ptr< SampleGenerator< Real > > &sampler, const ROL::Ptr< Objective_SimOpt< Real > > &pobj, const ROL::Ptr< PlusFunction< Real > > &pfunc, const Real &alpha)
void setStatistic(const Real stat, const int comp=0, const int index=0)
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
size_type numVectors() const
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual ~SimulatedObjectiveCVaR()
const ROL::Ptr< SampleGenerator< Real > > sampler_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
const ROL::Ptr< Objective_SimOpt< Real > > pobj_
ROL::Ptr< const Vector< Real > > get_1() const