44 #ifndef ROL_SIMULATED_OBJECTIVE_CVAR_H 45 #define ROL_SIMULATED_OBJECTIVE_CVAR_H 57 const Teuchos::RCP<SampleGenerator<Real> >
sampler_;
58 const Teuchos::RCP<Objective_SimOpt<Real> >
pobj_;
59 const Teuchos::RCP<PlusFunction<Real> >
pfunc_;
75 Teuchos::RCP<const Vector<Real> > uptr = uz.
get_1();
76 Teuchos::RCP<const Vector<Real> > zptr = uz.
get_2();
80 Teuchos::RCP<const Vector<Real> > z = rz.
getVector();
82 std::vector<Real> param;
83 Real weight(0), one(1);
89 param =
sampler_->getMyPoint(static_cast<int>(i));
90 weight =
sampler_->getMyWeight(static_cast<int>(i));
91 pobj_->setParameter(param);
93 tmpval =
pobj_->value(*(pu.
get(i)), *z, tol);
94 tmpplus =
pfunc_->evaluate(tmpval-t, 0);
95 tmpsum += tmpplus*weight;
109 Teuchos::RCP<const Vector<Real> > xuptr = xuz.
get_1();
110 Teuchos::RCP<const Vector<Real> > xzptr = xuz.
get_2();
114 Teuchos::RCP<const Vector<Real> > xz = rxz.
getVector();
117 Teuchos::RCP<Vector<Real> > guptr = guz.
get_1();
118 Teuchos::RCP<Vector<Real> > gzptr = guz.
get_2();
121 Teuchos::RCP<Vector<Real> > gz = rgz.
getVector();
123 std::vector<Real> param;
124 Real weight(0), one(1), sum(0), tmpsum(0), tmpval(0), tmpplus(0);
127 Teuchos::RCP<Vector<Real> > tmp1 = gz->clone();
128 Teuchos::RCP<Vector<Real> > tmp2 = gz->clone();
130 param =
sampler_->getMyPoint(static_cast<int>(i));
131 weight =
sampler_->getMyWeight(static_cast<int>(i));
132 pobj_->setParameter(param);
134 tmpval =
pobj_->value(*(pxu.
get(i)), *xz, tol);
135 tmpplus =
pfunc_->evaluate(tmpval-xt, 1);
136 tmpsum += weight*tmpplus;
140 pobj_->gradient(gi, xi, tol);
141 gi.scale(weight*tmpplus);
148 gz->scale(one/(one-
alpha_));
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
Defines the linear algebra or vector space interface for simulation-based optimization.
size_type numVectors() const
Teuchos::RCP< const Vector< Real > > get_2() const
const Teuchos::RCP< SampleGenerator< Real > > sampler_
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Teuchos::RCP< const Vector< Real > > getVector(void) const
Defines the linear algebra of a vector space on a generic partitioned vector where the individual vec...
void setStatistic(const Real stat)
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Teuchos::RCP< const Vector< Real > > get_1() const
virtual ~SimulatedObjectiveCVaR()
const Teuchos::RCP< Objective_SimOpt< Real > > pobj_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
SimulatedObjectiveCVaR(const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Objective_SimOpt< Real > > &pobj, const Teuchos::RCP< PlusFunction< Real > > &pfunc, const Real &alpha)
Teuchos::RCP< const StdVector< Real > > getStatistic(void) const
const Teuchos::RCP< PlusFunction< Real > > pfunc_
Teuchos::RCP< const Vector< Real > > get(size_type i) const