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!");
90 Real mean = 0.5*(
a_+
b_);
93 case 1: val = mean;
break;
94 case 2: val = std::pow(
b_-
a_,2)/8. + mean*mean;
break;
96 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
97 ">>> ERROR (ROL::Arcsine): Arcsine moment not implemented for m > 2!");
110 void test(std::ostream &outStream = std::cout )
const {
112 std::vector<Real> X(size,0.);
113 std::vector<int> T(size,0);
114 X[0] =
a_-4.*(Real)rand()/(Real)RAND_MAX;
118 X[2] = (
b_-
a_)*(Real)rand()/(Real)RAND_MAX +
a_;
122 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