44 #ifndef ROL_ERRORMEASUREINFO_HPP
45 #define ROL_ERRORMEASUREINFO_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(
"Error Measure").get<std::string>(
"Name");
59 lower.clear(); upper.clear();
60 nStatistic = 0; isBoundActivated =
false;
61 if ( name ==
"Koenker-Bassett" ||
62 name ==
"Moreau-Yosida-Koenker-Bassett" ||
63 name ==
"Generalized Moreau-Yosida-Koenker-Bassett" ||
64 name ==
"Exponential" ||
65 name ==
"Least Squares" ||
67 name ==
"Log Quantile" ||
68 name ==
"Smoothed Worst Cast" ) {
72 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
73 ">>> (ROL::ErrorMeasureInfo): Invalid probability " << name <<
"!");
77 if ( printToStream ) {
79 oldFormatState.copyfmt(outStream);
81 outStream << std::endl;
82 outStream << std::scientific << std::setprecision(6);
83 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
84 outStream <<
" ERRORMEASURE INFORMATION" << std::endl;
85 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
86 outStream <<
" NAME" << std::endl;
87 outStream <<
" " << name << std::endl;
88 outStream <<
" NUMBER OF STATISTICS" << std::endl;
89 outStream <<
" " << nStatistic << std::endl;
90 outStream <<
" ARE BOUNDS ACTIVATED" << std::endl;
91 outStream <<
" " << (isBoundActivated ?
"TRUE" :
"FALSE") << std::endl;
92 if ( isBoundActivated ) {
93 outStream <<
" STATISTIC LOWER BOUNDS" << std::endl;
94 for (
int i = 0; i < nStatistic-1; ++i) {
95 outStream <<
" " << lower[i] << std::endl;
97 outStream <<
" " << lower[nStatistic-1] << std::endl;
98 outStream <<
" STATISTIC UPPER BOUNDS" << std::endl;
99 for (
int i = 0; i < nStatistic-1; ++i) {
100 outStream <<
" " << upper[i] << std::endl;
102 outStream <<
" " << upper[nStatistic-1] << std::endl;
104 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
105 outStream << std::endl;
107 outStream.copyfmt(oldFormatState);
Contains definitions of custom data types in ROL.
basic_nullstream< char, char_traits< char >> nullstream
void ErrorMeasureInfo(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)