44 #ifndef ROL_DEVIATIONMEASUREINFO_HPP
45 #define ROL_DEVIATIONMEASUREINFO_HPP
47 #include "ROL_ParameterList.hpp"
54 int &nStatistic, std::vector<Real> &lower,
55 std::vector<Real> &upper,
bool &isBoundActivated,
56 const bool printToStream =
false,
57 std::ostream &outStream = std::cout) {
58 name = parlist.sublist(
"SOL").sublist(
"Deviation Measure").get<std::string>(
"Name");
59 lower.clear(); upper.clear();
60 nStatistic = 0; isBoundActivated =
false;
61 if ( name ==
"CVaR" ||
62 name ==
"Moreau-Yosida CVaR" ||
63 name ==
"Generalized Moreau-Yosida CVaR" ||
66 name ==
"Log Quantile" ||
67 name ==
"Smoothed Upper Range" ||
68 name ==
"Truncated Mean" ) {
70 lower.resize(nStatistic,ROL_NINF<Real>());
71 upper.resize(nStatistic,ROL_INF<Real>());
74 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
75 ">>> (ROL::DeviationMeasureInfo): Invalid deviation measure " << name <<
"!");
79 if ( printToStream ) {
81 oldFormatState.copyfmt(outStream);
83 outStream << std::endl;
84 outStream << std::scientific << std::setprecision(6);
85 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
86 outStream <<
" DEVIATION MEASURE INFORMATION" << std::endl;
87 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
88 outStream <<
" NAME" << std::endl;
89 outStream <<
" " << name << std::endl;
90 outStream <<
" NUMBER OF STATISTICS" << std::endl;
91 outStream <<
" " << nStatistic << std::endl;
92 outStream <<
" ARE BOUNDS ACTIVATED" << std::endl;
93 outStream <<
" " << (isBoundActivated ?
"TRUE" :
"FALSE") << std::endl;
94 if ( isBoundActivated ) {
95 outStream <<
" STATISTIC LOWER BOUNDS" << std::endl;
96 for (
int i = 0; i < nStatistic-1; ++i) {
97 outStream <<
" " << lower[i] << std::endl;
99 outStream <<
" " << lower[nStatistic-1] << std::endl;
100 outStream <<
" STATISTIC UPPER BOUNDS" << std::endl;
101 for (
int i = 0; i < nStatistic-1; ++i) {
102 outStream <<
" " << upper[i] << std::endl;
104 outStream <<
" " << upper[nStatistic-1] << std::endl;
106 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
107 outStream << std::endl;
109 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