10 #ifndef ROL_RANDVARFUNCTIONALINFO_HPP
11 #define ROL_RANDVARFUNCTIONALINFO_HPP
23 int &nStatistic, std::vector<Real> &lower,
24 std::vector<Real> &upper,
bool &isBoundActivated,
25 const bool printToStream =
false,
26 std::ostream &outStream = std::cout) {
27 std::string type = parlist.sublist(
"SOL").get(
"Type",
"Risk Averse");
28 if (type ==
"Risk Averse") {
29 RiskMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
31 else if (type ==
"Deviation") {
32 DeviationMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
34 else if (type ==
"Error") {
35 ErrorMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
37 else if (type ==
"Regret") {
38 RegretMeasureInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
40 else if (type ==
"Probability") {
41 ProbabilityInfo<Real>(parlist,name,nStatistic,lower,upper,isBoundActivated,printToStream,outStream);
44 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
45 ">>> (ROL::RandVarFunctionalInfo): Invalid random variable functional type!");
49 if ( printToStream ) {
51 oldFormatState.copyfmt(outStream);
53 outStream << std::endl;
54 outStream << std::scientific << std::setprecision(6);
55 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
56 outStream <<
" RANDVARFUNCTIONAL INFORMATION" << std::endl;
57 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
58 outStream <<
" NAME" << std::endl;
59 outStream <<
" " << name << std::endl;
60 outStream <<
" NUMBER OF STATISTICS" << std::endl;
61 outStream <<
" " << nStatistic << std::endl;
62 outStream <<
" ARE BOUNDS ACTIVATED" << std::endl;
63 outStream <<
" " << (isBoundActivated ?
"TRUE" :
"FALSE") << std::endl;
64 if ( isBoundActivated ) {
65 outStream <<
" STATISTIC LOWER BOUNDS" << std::endl;
66 for (
int i = 0; i < nStatistic-1; ++i) {
67 outStream <<
" " << lower[i] << std::endl;
69 outStream <<
" " << lower[nStatistic-1] << std::endl;
70 outStream <<
" STATISTIC UPPER BOUNDS" << std::endl;
71 for (
int i = 0; i < nStatistic-1; ++i) {
72 outStream <<
" " << upper[i] << std::endl;
74 outStream <<
" " << upper[nStatistic-1] << std::endl;
76 outStream << std::setfill(
'-') << std::setw(80) <<
"-" << std::endl;
77 outStream << std::endl;
79 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, std::char_traits< char >> nullstream