10 #ifndef ROL_ARCSINE_HPP
11 #define ROL_ARCSINE_HPP
14 #include "ROL_ParameterList.hpp"
25 Arcsine(
const Real a = 0.,
const Real b = 1.)
26 :
a_(std::min(a,b)),
b_(std::max(a,b)) {}
29 a_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Arcsine").get(
"Lower Bound",0.);
30 b_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Arcsine").get(
"Upper Bound",1.);
33 b_ = std::max(
b_,tmp);
37 return ((input <=
a_) ? 0. : ((input >=
b_) ? 0. :
42 return ((input <=
a_) ? 0. : ((input >=
b_) ? 1. :
46 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
47 ">>> ERROR (ROL::Arcsine): Arcsine integrateCDF not implemented!");
56 Real mean = 0.5*(
a_+
b_);
59 case 1: val = mean;
break;
60 case 2: val = std::pow(
b_-
a_,2)/8. + mean*mean;
break;
62 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
63 ">>> ERROR (ROL::Arcsine): Arcsine moment not implemented for m > 2!");
76 void test(std::ostream &outStream = std::cout )
const {
78 std::vector<Real> X(size,0.);
79 std::vector<int> T(size,0);
80 X[0] =
a_-4.*(Real)rand()/(Real)RAND_MAX;
84 X[2] = (
b_-
a_)*(Real)rand()/(Real)RAND_MAX +
a_;
88 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