48 #include "ROL_ParameterList.hpp"
59 Smale(
const Real a = 0.,
const Real b = 1.)
60 :
a_(std::min(a,b)),
b_(std::max(a,b)) {}
62 Smale(ROL::ParameterList &parlist) {
63 a_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Smale").get(
"Lower Bound",0.);
64 b_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Smale").get(
"Upper Bound",1.);
67 b_ = std::max(
b_,tmp);
71 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
72 Real root = std::sqrt(val);
73 return 2.0*b_*b_/(val*root);
77 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
78 Real root = std::sqrt(val);
79 return 0.5*(1.0+input/root);
83 Real val = std::pow(input-
a_,2)+4.*
b_*
b_;
84 Real root = std::sqrt(val);
85 return 0.5*(input+root);
95 for (
int i = 0; i < 100; i++) {
96 if ( std::abs(fx) < ROL_EPSILON<Real>() ) {
break; }
102 while ( std::abs(fx) > (1.0 - 1.e-4*a)*std::abs(tmp) ) {
113 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
114 ">>> ERROR (ROL::Smale): Smale moment is not implemented!");
118 return ROL_NINF<Real>();
122 return ROL_INF<Real>();
125 void test(std::ostream &outStream = std::cout )
const {
127 std::vector<Real> X(size,4.*(Real)rand()/(Real)RAND_MAX - 2.);
128 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.)