44 #ifndef ROL_TRUNCATEDEXPONENTIAL_HPP
45 #define ROL_TRUNCATEDEXPONENTIAL_HPP
48 #include "ROL_ParameterList.hpp"
64 if ( k == m || m == 0 || m == 1 ) {
68 for (
size_t i = k; i < m; i++) {
76 :
a_(std::min(a,b)),
b_(std::max(a,b)),
scale_((scale>0.) ? scale : 1.) {
84 ROL::ParameterList TElist
85 = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Truncated Exponential");
86 a_ = TElist.get(
"Lower Bound",0.);
87 b_ = TElist.get(
"Upper Bound",1.);
90 b_ = std::max(
b_,tmp);
91 scale_ = TElist.get(
"Scale",1.);
100 return ((input >=
a_) ? ((input <=
b_) ?
coeff_*std::exp(-
scale_*input) : 0.) : 0.);
108 return ((input >
a_) ? ((input <
b_) ?
118 Real val = 0., coeff = 0.;
119 for (
size_t i = 0; i < m+1; i++) {
134 void test(std::ostream &outStream = std::cout )
const {
136 std::vector<Real> X(size,0.);
137 std::vector<int> T(size,0);
138 X[0] =
a_-4.0*(Real)rand()/(Real)RAND_MAX;
142 X[2] = (
b_-
a_)*(Real)rand()/(Real)RAND_MAX +
a_;
146 X[4] =
b_+4.0*(Real)rand()/(Real)RAND_MAX;
Real invertCDF(const Real input) const
TruncatedExponential(const Real a=0., const Real b=1., const Real scale=1.)
Real evaluateCDF(const Real input) const
size_t compute_coeff(const size_t m, const size_t k) const
void test(std::ostream &outStream=std::cout) const
Real lowerBound(void) const
virtual void test(std::ostream &outStream=std::cout) const
Real moment(const size_t m) const
TruncatedExponential(ROL::ParameterList &parlist)
Real upperBound(void) const
Real integrateCDF(const Real input) const
Real evaluatePDF(const Real input) const