44 #ifndef ROL_QUANTILERADIUSQUADRANGLE_HPP
45 #define ROL_QUANTILERADIUSQUADRANGLE_HPP
50 #include "ROL_ParameterList.hpp"
85 ROL_TEST_FOR_EXCEPTION((
prob_>one ||
prob_<
zero), std::invalid_argument,
86 ">>> ERROR (ROL::QuantileRadius): Confidence level out of range!");
87 ROL_TEST_FOR_EXCEPTION((
coeff_<
zero), std::invalid_argument,
88 ">>> ERROR (ROL::QuantileRadius): Coefficient is negative!");
96 ROL::ParameterList &list
97 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"Quantile Radius");
99 prob_ = list.get<Real>(
"Confidence Level");
100 coeff_ = list.get<Real>(
"Coefficient");
114 vec_.assign(2,static_cast<Real>(0));
118 Real stat(0), half(0.5);
119 if (xstat != nullPtr) {
120 stat = half*((*xstat)[0] + (*xstat)[1]);
127 const std::vector<Real> &xstat,
129 const Real half(0.5), one(1);
137 const std::vector<Real> &xstat,
139 const Real half(0.5);
142 cvar += half*
coeff_*(xstat[0] + xstat[1]);
148 const std::vector<Real> &xstat,
150 const Real half(0.5), one(1);
162 std::vector<Real> &gstat,
164 const std::vector<Real> &xstat,
166 const Real half(0.5);
175 const std::vector<Real> &vstat,
177 const std::vector<Real> &xstat,
179 const Real half(0.5), one(1);
187 vec_[0] -= c*pf12*(gv-vstat[0]);
188 vec_[1] += c*pf22*(gv+vstat[1]);
189 hv_->axpy(c*(pf12*(gv-vstat[0]) + pf22*(gv+vstat[1])),*
dualVector_);
195 std::vector<Real> &hvstat,
197 const std::vector<Real> &vstat,
199 const std::vector<Real> &xstat,
Provides the interface to evaluate objective functions.
void computeHessVec(Vector< Real > &hv, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Real computeStatistic(const Ptr< std::vector< Real >> &xstat) const
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)
Return risk measure Hessian-times-a-vector.
Real computeValue(Objective< Real > &obj, const Vector< Real > &x, Real &tol)
Ptr< Vector< Real > > hv_
QuantileRadius(const Real prob, const Real coeff, const Ptr< PlusFunction< Real > > &pf)
Ptr< Vector< Real > > dualVector_
Defines the linear algebra or vector space interface.
void sumAll(Real *input, Real *output, int dim) const
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)
Return risk measure value.
Ptr< PlusFunction< Real > > plusFunction_
void computeGradient(Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &x, Real &tol)
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)
Update internal risk measure storage for Hessian-time-a-vector computation.
Real computeGradVec(Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Provides the interface to implement any functional that maps a random variable to a (extended) real n...
void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal risk measure storage for gradient computation.
QuantileRadius(ROL::ParameterList &parlist)
void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal storage for value computation.
void initialize(const Vector< Real > &x)
Initialize temporary variables.
void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Return risk measure (sub)gradient.
virtual void initialize(const Vector< Real > &x)
Initialize temporary variables.