10#ifndef ROL_COHERENTEXPUTILITY_HPP
11#define ROL_COHERENTEXPUTILITY_HPP
64 const std::vector<Real> &xstat,
66 Real val = computeValue(obj,x,tol);
67 val_ += weight_ * std::exp(val/xstat[0]);
71 const std::vector<Real> &xstat,
74 sampler.
sumAll(&val_,&ev,1);
75 return xstat[0]*std::log(ev);
80 const std::vector<Real> &xstat,
82 Real val = computeValue(obj,x,tol);
83 Real ev = std::exp(val/xstat[0]);
85 gv_ += weight_ * ev * val;
86 computeGradient(*dualVector_,obj,x,tol);
87 g_->axpy(weight_*ev,*dualVector_);
91 std::vector<Real> &gstat,
93 const std::vector<Real> &xstat,
97 std::vector<Real> myval(2,0), val(2,0);
100 sampler.
sumAll(&myval[0],&val[0],2);
104 gstat[0] = std::log(val[0]) - val[1]/(val[0]*xstat[0]);
109 const std::vector<Real> &vstat,
111 const std::vector<Real> &xstat,
113 Real val = computeValue(obj,x,tol);
114 Real ev = std::exp(val/xstat[0]);
115 val_ += weight_ * ev;
117 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
118 gv_ += weight_ * ev * gv;
119 g_->axpy(weight_*ev,*dualVector_);
120 hv_->axpy(weight_*ev*(gv-val*vstat[0]/xstat[0])/xstat[0],*dualVector_);
122 dval1_ += weight_ * ev * val;
123 dval2_ += weight_ * ev * val * val;
124 dval3_ += weight_ * ev * val * gv;
126 computeHessVec(*dualVector_,obj,v,x,tol);
127 hv_->axpy(weight_*ev,*dualVector_);
131 std::vector<Real> &hvstat,
133 const std::vector<Real> &vstat,
135 const std::vector<Real> &xstat,
138 std::vector<Real> myval(5,0), val(5,0);
144 sampler.
sumAll(&myval[0],&val[0],5);
146 Real xs2 = xstat[0]*xstat[0];
147 Real xs3 = xs2*xstat[0];
148 Real v02 = val[0]*val[0];
149 Real h11 = (val[3]*val[0] - val[2]*val[2])/(v02*xs3) * vstat[0];
150 Real h12 = (val[1]*val[2] - val[4]*val[0])/(v02*xs2);
153 hv.
scale(one/val[0]);
156 sampler.
sumAll(*g_,*dualVector_);
157 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 .