44 #ifndef ROL_RISKMEASUREFACTORY_HPP
45 #define ROL_RISKMEASUREFACTORY_HPP
47 #include "ROL_ParameterList.hpp"
113 std::string retString;
116 retString =
"CVaR";
break;
118 retString =
"Moreau-Yosida CVaR";
break;
120 retString =
"Generalized Moreau-Yosida CVaR";
break;
122 retString =
"Mixed CVaR";
break;
124 retString =
"Spectral Risk";
break;
126 retString =
"Second Order CVaR";
break;
128 retString =
"Chebyshev Spectral Risk";
break;
130 retString =
"Quantile Radius";
break;
132 retString =
"HMCR";
break;
134 retString =
"Entropic Risk";
break;
136 retString =
"Coherent Entropic Risk";
break;
138 retString =
"Mean Plus Semi-Deviation";
break;
140 retString =
"Mean Plus Semi-Deviation From Target";
break;
142 retString =
"Mean Plus Deviation From Target";
break;
144 retString =
"Mean Plus Deviation";
break;
146 retString =
"Mean Plus Variance From Target";
break;
148 retString =
"Mean Plus Variance";
break;
150 retString =
"Truncated Mean";
break;
152 retString =
"Log Quantile";
break;
154 retString =
"Smoothed Worst Case";
break;
156 retString =
"Log Exponential";
break;
158 retString =
"Safety Margin";
break;
160 retString =
"Chi-Squared Divergence";
break;
162 retString =
"KL Divergence";
break;
164 retString =
"Last Type (Dummy)";
break;
166 retString =
"INVALID ERiskMeasure";
break;
230 std::string risk = parlist.sublist(
"SOL").sublist(
"Risk Measure").get(
"Name",
"CVaR");
234 return makePtr<CVaR<Real>>(parlist);
236 return makePtr<ExpectationQuadRisk<Real>>(makePtr<MoreauYosidaCVaR<Real>>(parlist));
238 return makePtr<ExpectationQuadRisk<Real>>(makePtr<GenMoreauYosidaCVaR<Real>>(parlist));
240 return makePtr<MixedCVaR<Real>>(parlist);
242 return makePtr<SpectralRisk<Real>>(parlist);
244 return makePtr<SecondOrderCVaR<Real>>(parlist);
246 return makePtr<ChebyshevSpectral<Real>>(parlist);
248 return makePtr<QuantileRadius<Real>>(parlist);
250 return makePtr<HMCR<Real>>(parlist);
252 return makePtr<EntropicRisk<Real>>(parlist);
254 return makePtr<CoherentEntropicRisk<Real>>();
256 return makePtr<MeanSemiDeviation<Real>>(parlist);
258 return makePtr<MeanSemiDeviationFromTarget<Real>>(parlist);
260 return makePtr<MeanDeviationFromTarget<Real>>(parlist);
262 return makePtr<MeanDeviation<Real>>(parlist);
264 return makePtr<MeanVarianceFromTarget<Real>>(parlist);
266 return makePtr<MeanVariance<Real>>(parlist);
268 return makePtr<ExpectationQuadRisk<Real>>(makePtr<TruncatedMeanQuadrangle<Real>>(parlist));
270 return makePtr<ExpectationQuadRisk<Real>>(makePtr<LogQuantileQuadrangle<Real>>(parlist));
272 return makePtr<ExpectationQuadRisk<Real>>(makePtr<SmoothedWorstCaseQuadrangle<Real>>(parlist));
274 return makePtr<ExpectationQuadRisk<Real>>(makePtr<LogExponentialQuadrangle<Real>>(parlist));
276 return makePtr<ExpectationQuadRisk<Real>>(makePtr<MeanVarianceQuadrangle<Real>>(parlist));
278 return makePtr<Chi2Divergence<Real>>(parlist);
280 return makePtr<KLDivergence<Real>>(parlist);
282 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
283 "Invalid risk measure type " << risk <<
"!");
EKrylov & operator++(EKrylov &type)
Contains definitions of custom data types in ROL.
std::string removeStringFormat(std::string s)
ERiskMeasure StringToERiskMeasure(std::string s)
int isValidRiskMeasure(ERiskMeasure ed)
Ptr< RandVarFunctional< Real > > RiskMeasureFactory(ROL::ParameterList &parlist)
std::string ERiskMeasureToString(ERiskMeasure ed)
EKrylov & operator--(EKrylov &type)