44 #ifndef ROL_ARCSINE_HPP
45 #define ROL_ARCSINE_HPP
48 #include "ROL_ParameterList.hpp"
59 Arcsine(
const Real a = 0.,
const Real b = 1.)
60 :
a_(std::min(a,b)),
b_(std::max(a,b)) {}
63 a_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Arcsine").get(
"Lower Bound",0.);
64 b_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Arcsine").get(
"Upper Bound",1.);
67 b_ = std::max(
b_,tmp);
71 return ((input <=
a_) ? 0. : ((input >=
b_) ? 0. :
76 return ((input <=
a_) ? 0. : ((input >=
b_) ? 1. :
80 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
81 ">>> ERROR (ROL::Arcsine): Arcsine integrateCDF not implemented!");
82 return ((input < 0.5*(
a_+
b_)) ? 0.0 : input);
91 Real mean = 0.5*(
a_+
b_);
94 case 1: val = mean;
break;
95 case 2: val = std::pow(
b_-
a_,2)/8. + mean*mean;
break;
97 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
98 ">>> ERROR (ROL::Arcsine): Arcsine moment not implemented for m > 2!");
111 void test(std::ostream &outStream = std::cout )
const {
113 std::vector<Real> X(size,0.);
114 std::vector<int> T(size,0);
115 X[0] =
a_-4.*(Real)rand()/(Real)RAND_MAX;
119 X[2] = (
b_-
a_)*(Real)rand()/(Real)RAND_MAX +
a_;
123 X[4] =
b_+4.*(Real)rand()/(Real)RAND_MAX;
Arcsine(ROL::ParameterList &parlist)
Arcsine(const Real a=0., const Real b=1.)
Real evaluateCDF(const Real input) const
Real lowerBound(void) const
void test(std::ostream &outStream=std::cout) const
Real integrateCDF(const Real input) const
Real evaluatePDF(const Real input) const
Real moment(const size_t m) const
virtual void test(std::ostream &outStream=std::cout) const
Real upperBound(void) const
Real invertCDF(const Real input) const