44 #ifndef ROL_PLUSFUNCTION_HPP
45 #define ROL_PLUSFUNCTION_HPP
57 ROL::Ptr<Distribution<Real> >
dist_;
62 param_ = ((param <= 0) ? 1.e-2 : param);
66 Real param(1.e-1),
zero(0), one(1);
67 ROL::ParameterList pfList;
68 if (parlist.isSublist(
"Plus Function")) {
69 param = parlist.sublist(
"Plus Function").get(
"Smoothing Parameter",1.);
70 pfList = parlist.sublist(
"Plus Function");
73 param = parlist.get(
"Smoothing Parameter",1.);
77 dist_ = DistributionFactory<Real>(pfList);
84 case 1: val =
dist_->evaluateCDF(input/
param_);
break;
98 std::cout << std::right << std::setw(20) <<
"CHECK PLUS FUNCTION: p'(x) with x = "
99 << x <<
" is correct?\n";
100 std::cout << std::right << std::setw(20) <<
"t"
101 << std::setw(20) <<
"p'(x)"
102 << std::setw(20) <<
"(p(x+t)-p(x))/t"
103 << std::setw(20) <<
"Error"
105 for (
int i = 0; i < 13; i++) {
108 err = std::abs(diff-dv);
109 std::cout << std::scientific << std::setprecision(11) << std::right
110 << std::setw(20) << t
111 << std::setw(20) << dv
112 << std::setw(20) << diff
113 << std::setw(20) << err
125 std::cout << std::right << std::setw(20) <<
"CHECK PLUS FUNCTION: p''(x) with x = "
126 << x <<
" is correct?\n";
127 std::cout << std::right << std::setw(20) <<
"t"
128 << std::setw(20) <<
"p''(x)"
129 << std::setw(20) <<
"(p'(x+t)-p'(x))/t"
130 << std::setw(20) <<
"Error"
132 for (
int i = 0; i < 13; i++) {
135 err = std::abs(diff-dv);
136 std::cout << std::scientific << std::setprecision(11) << std::right
137 << std::setw(20) << t
138 << std::setw(20) << dv
139 << std::setw(20) << diff
140 << std::setw(20) << err
ROL::Ptr< Distribution< Real > > dist_
Contains definitions of custom data types in ROL.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
PlusFunction(ROL::ParameterList &parlist)
Real evaluate(Real input, int deriv)
PlusFunction(ROL::Ptr< Distribution< Real > > &dist, Real param=1.)