44 #ifndef ROL_RANDVARFUNCTIONALINFO_HPP
45 #define ROL_RANDVARFUNCTIONALINFO_HPP
57 int &nStatistic, std::vector<Real> &lower,
58 std::vector<Real> &upper,
bool &isBoundActivated,
59 const bool printToStream =
false,
60 std::ostream &outStream = std::cout) {
61 std::string type = parlist.sublist(
"SOL").get(
"Stochastic Component Type",
"Risk Averse");
62 if (type ==
"Risk Averse") {
63 RiskMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
65 else if (type ==
"Deviation") {
66 DeviationMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
68 else if (type ==
"Error") {
69 ErrorMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
71 else if (type ==
"Regret") {
72 RegretMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
74 else if (type ==
"Probability") {
75 ProbabilityInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
78 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
79 ">>> (ROL::RandVarFunctionalInfo): Invalid random variable functional type!");
83 if ( printToStream ) {
85 oldFormatState.copyfmt(outStream);
87 outStream << std::endl;
88 outStream << std::scientific << std::setprecision(6);
89 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
90 outStream <<
" RANDVARFUNCTIONAL INFORMATION" << std::endl;
91 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
92 outStream <<
" NAME" << std::endl;
93 outStream <<
" " << name << std::endl;
94 outStream <<
" NUMBER OF STATISTICS" << std::endl;
95 outStream <<
" " << nStatistic << std::endl;
96 outStream <<
" ARE BOUNDS ACTIVATED" << std::endl;
97 outStream <<
" " << (isBoundActivated ?
"TRUE" :
"FALSE") << std::endl;
98 if ( isBoundActivated ) {
99 outStream <<
" STATISTIC LOWER BOUNDS" << std::endl;
100 for (
int i = 0; i < nStatistic-1; ++i) {
101 outStream <<
" " << lower[i] << std::endl;
103 outStream <<
" " << lower[nStatistic-1] << std::endl;
104 outStream <<
" STATISTIC UPPER BOUNDS" << std::endl;
105 for (
int i = 0; i < nStatistic-1; ++i) {
106 outStream <<
" " << upper[i] << std::endl;
108 outStream <<
" " << upper[nStatistic-1] << std::endl;
110 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
111 outStream << std::endl;
113 outStream.copyfmt(oldFormatState);
void RandVarFunctionalInfo(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