10 #ifndef ROL_DEVIATIONMEASUREINFO_HPP
11 #define ROL_DEVIATIONMEASUREINFO_HPP
13 #include "ROL_ParameterList.hpp"
20 int &nStatistic, std::vector<Real> &lower,
21 std::vector<Real> &upper,
bool &isBoundActivated,
22 const bool printToStream =
false,
23 std::ostream &outStream = std::cout) {
24 name = parlist.sublist(
"SOL").sublist(
"Deviation Measure").get<std::string>(
"Name");
25 lower.clear(); upper.clear();
26 nStatistic = 0; isBoundActivated =
false;
27 if ( name ==
"CVaR" ||
28 name ==
"Moreau-Yosida CVaR" ||
29 name ==
"Generalized Moreau-Yosida CVaR" ||
32 name ==
"Log Quantile" ||
33 name ==
"Smoothed Upper Range" ||
34 name ==
"Truncated Mean" ) {
36 lower.resize(nStatistic,ROL_NINF<Real>());
37 upper.resize(nStatistic,ROL_INF<Real>());
40 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
41 ">>> (ROL::DeviationMeasureInfo): Invalid deviation measure " << name <<
"!");
45 if ( printToStream ) {
47 oldFormatState.copyfmt(outStream);
49 outStream << std::endl;
50 outStream << std::scientific << std::setprecision(6);
51 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
52 outStream <<
" DEVIATION MEASURE INFORMATION" << std::endl;
53 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
54 outStream <<
" NAME" << std::endl;
55 outStream <<
" " << name << std::endl;
56 outStream <<
" NUMBER OF STATISTICS" << std::endl;
57 outStream <<
" " << nStatistic << std::endl;
58 outStream <<
" ARE BOUNDS ACTIVATED" << std::endl;
59 outStream <<
" " << (isBoundActivated ?
"TRUE" :
"FALSE") << std::endl;
60 if ( isBoundActivated ) {
61 outStream <<
" STATISTIC LOWER BOUNDS" << std::endl;
62 for (
int i = 0; i < nStatistic-1; ++i) {
63 outStream <<
" " << lower[i] << std::endl;
65 outStream <<
" " << lower[nStatistic-1] << std::endl;
66 outStream <<
" STATISTIC UPPER BOUNDS" << std::endl;
67 for (
int i = 0; i < nStatistic-1; ++i) {
68 outStream <<
" " << upper[i] << std::endl;
70 outStream <<
" " << upper[nStatistic-1] << std::endl;
72 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
73 outStream << std::endl;
75 outStream.copyfmt(oldFormatState);
Contains definitions of custom data types in ROL.
void DeviationMeasureInfo(ROL::ParameterList &parlist, std::string &name, int &nStatistic, std::vector< Real > &lower, std::vector< Real > &upper, bool &isBoundActivated, const bool printToStream=false, std::ostream &outStream=std::cout)
basic_nullstream< char, char_traits< char >> nullstream