14 #include "ROL_ParameterList.hpp"
25 Smale(
const Real a = 0.,
const Real b = 1.)
26 :
a_(std::min(a,b)),
b_(std::max(a,b)) {}
28 Smale(ROL::ParameterList &parlist) {
29 a_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Smale").get(
"Lower Bound",0.);
30 b_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Smale").get(
"Upper Bound",1.);
33 b_ = std::max(
b_,tmp);
37 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
38 Real root = std::sqrt(val);
39 return 2.0*b_*b_/(val*root);
43 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
44 Real root = std::sqrt(val);
45 return 0.5*(1.0+input/root);
49 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
50 Real root = std::sqrt(val);
51 return 0.5*(input+root);
61 for (
int i = 0; i < 100; i++) {
62 if ( std::abs(fx) < ROL_EPSILON<Real>() ) {
break; }
68 while ( std::abs(fx) > (1.0 - 1.e-4*a)*std::abs(tmp) ) {
79 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
80 ">>> ERROR (ROL::Smale): Smale moment is not implemented!");
84 return ROL_NINF<Real>();
88 return ROL_INF<Real>();
91 void test(std::ostream &outStream = std::cout )
const {
93 std::vector<Real> X(size,4.*(Real)rand()/(Real)RAND_MAX - 2.);
94 std::vector<int> T(size,0);
Real upperBound(void) const
Real integrateCDF(const Real input) const
Real moment(const size_t m) const
void test(std::ostream &outStream=std::cout) const
Real evaluatePDF(const Real input) const
Real lowerBound(void) const
virtual void test(std::ostream &outStream=std::cout) const
Real evaluateCDF(const Real input) const
Real invertCDF(const Real input) const
Smale(ROL::ParameterList &parlist)
Smale(const Real a=0., const Real b=1.)