44#ifndef ROL_COHERENTEXPUTILITY_HPP
45#define ROL_COHERENTEXPUTILITY_HPP
98 const std::vector<Real> &xstat,
100 Real val = computeValue(obj,x,tol);
101 val_ += weight_ * std::exp(val/xstat[0]);
105 const std::vector<Real> &xstat,
108 sampler.
sumAll(&val_,&ev,1);
109 return xstat[0]*std::log(ev);
114 const std::vector<Real> &xstat,
116 Real val = computeValue(obj,x,tol);
117 Real ev = std::exp(val/xstat[0]);
118 val_ += weight_ * ev;
119 gv_ += weight_ * ev * val;
120 computeGradient(*dualVector_,obj,x,tol);
121 g_->axpy(weight_*ev,*dualVector_);
125 std::vector<Real> &gstat,
127 const std::vector<Real> &xstat,
131 std::vector<Real> myval(2,0), val(2,0);
134 sampler.
sumAll(&myval[0],&val[0],2);
138 gstat[0] = std::log(val[0]) - val[1]/(val[0]*xstat[0]);
143 const std::vector<Real> &vstat,
145 const std::vector<Real> &xstat,
147 Real val = computeValue(obj,x,tol);
148 Real ev = std::exp(val/xstat[0]);
149 val_ += weight_ * ev;
151 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
152 gv_ += weight_ * ev * gv;
153 g_->axpy(weight_*ev,*dualVector_);
154 hv_->axpy(weight_*ev*(gv-val*vstat[0]/xstat[0])/xstat[0],*dualVector_);
156 dval1_ += weight_ * ev * val;
157 dval2_ += weight_ * ev * val * val;
158 dval3_ += weight_ * ev * val * gv;
160 computeHessVec(*dualVector_,obj,v,x,tol);
161 hv_->axpy(weight_*ev,*dualVector_);
165 std::vector<Real> &hvstat,
167 const std::vector<Real> &vstat,
169 const std::vector<Real> &xstat,
172 std::vector<Real> myval(5,0), val(5,0);
178 sampler.
sumAll(&myval[0],&val[0],5);
180 Real xs2 = xstat[0]*xstat[0];
181 Real xs3 = xs2*xstat[0];
182 Real v02 = val[0]*val[0];
183 Real h11 = (val[3]*val[0] - val[2]*val[2])/(v02*xs3) * vstat[0];
184 Real h12 = (val[1]*val[2] - val[4]*val[0])/(v02*xs2);
187 hv.
scale(one/val[0]);
190 sampler.
sumAll(*g_,*dualVector_);
191 hv.
axpy((vstat[0]*val[2]/xs2-val[1]/xstat[0])/v02,*dualVector_);
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Real getValue(const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void getHessVec(Vector< Real > &hv, std::vector< Real > &hvstat, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void updateHessVec(Objective< Real > &obj, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
void initialize(const Vector< Real > &x)
CoherentEntropicRisk(void)
void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Provides the interface to evaluate objective functions.
Provides the interface to implement any functional that maps a random variable to a (extended) real n...
void sumAll(Real *input, Real *output, int dim) const
Defines the linear algebra or vector space interface.
virtual void scale(const Real alpha)=0
Compute where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .