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);
130 Real val = computeValue(obj,x,tol);
137 const std::vector<Real> &xstat,
139 const Real half(0.5);
141 sampler.
sumAll(&val_,&cvar,1);
142 cvar += half*
coeff_*(xstat[0] + xstat[1]);
148 const std::vector<Real> &xstat,
150 const Real half(0.5), one(1);
151 Real val = computeValue(obj,x,tol);
157 computeGradient(*dualVector_,obj,x,tol);
158 g_->axpy(weight_ + c * (pf1 - pf2),*dualVector_);
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);
180 Real val = computeValue(obj,x,tol);
186 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
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_);
190 computeHessVec(*dualVector_,obj,v,x,tol);
191 hv_->axpy(weight_ + c * (pf11 - pf21),*dualVector_);
195 std::vector<Real> &hvstat,
197 const std::vector<Real> &vstat,
199 const std::vector<Real> &xstat,
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Provides the interface to evaluate objective functions.
Real getValue(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 initialize(const Vector< Real > &x)
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)
QuantileRadius(ROL::ParameterList &parlist)
void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
QuantileRadius(const Real prob, const Real coeff, const Ptr< PlusFunction< Real > > &pf)
void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Ptr< PlusFunction< Real > > plusFunction_
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.