10 #ifndef ROL_PLUSFUNCTION_HPP
11 #define ROL_PLUSFUNCTION_HPP
23 ROL::Ptr<Distribution<Real> >
dist_;
28 param_ = ((param <= 0) ? 1.e-2 : param);
32 Real param(1.e-1),
zero(0), one(1);
33 ROL::ParameterList pfList;
34 if (parlist.isSublist(
"Plus Function")) {
35 param = parlist.sublist(
"Plus Function").get(
"Smoothing Parameter",1.);
36 pfList = parlist.sublist(
"Plus Function");
39 param = parlist.get(
"Smoothing Parameter",1.);
43 dist_ = DistributionFactory<Real>(pfList);
50 case 1: val =
dist_->evaluateCDF(input/
param_);
break;
64 std::cout << std::right << std::setw(20) <<
"CHECK PLUS FUNCTION: p'(x) with x = "
65 << x <<
" is correct?\n";
66 std::cout << std::right << std::setw(20) <<
"t"
67 << std::setw(20) <<
"p'(x)"
68 << std::setw(20) <<
"(p(x+t)-p(x))/t"
69 << std::setw(20) <<
"Error"
71 for (
int i = 0; i < 13; i++) {
74 err = std::abs(diff-dv);
75 std::cout << std::scientific << std::setprecision(11) << std::right
77 << std::setw(20) << dv
78 << std::setw(20) << diff
79 << std::setw(20) << err
91 std::cout << std::right << std::setw(20) <<
"CHECK PLUS FUNCTION: p''(x) with x = "
92 << x <<
" is correct?\n";
93 std::cout << std::right << std::setw(20) <<
"t"
94 << std::setw(20) <<
"p''(x)"
95 << std::setw(20) <<
"(p'(x+t)-p'(x))/t"
96 << std::setw(20) <<
"Error"
98 for (
int i = 0; i < 13; i++) {
101 err = std::abs(diff-dv);
102 std::cout << std::scientific << std::setprecision(11) << std::right
103 << std::setw(20) << t
104 << std::setw(20) << dv
105 << std::setw(20) << diff
106 << 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.)