10 #ifndef ROL_TRUNCATEDEXPONENTIAL_HPP
11 #define ROL_TRUNCATEDEXPONENTIAL_HPP
14 #include "ROL_ParameterList.hpp"
30 if ( k == m || m == 0 || m == 1 ) {
34 for (
size_t i = k; i < m; i++) {
42 :
a_(std::min(a,b)),
b_(std::max(a,b)),
scale_((scale>0.) ? scale : 1.) {
50 ROL::ParameterList TElist
51 = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Truncated Exponential");
52 a_ = TElist.get(
"Lower Bound",0.);
53 b_ = TElist.get(
"Upper Bound",1.);
56 b_ = std::max(
b_,tmp);
57 scale_ = TElist.get(
"Scale",1.);
66 return ((input >=
a_) ? ((input <=
b_) ?
coeff_*std::exp(-
scale_*input) : 0.) : 0.);
74 return ((input >
a_) ? ((input <
b_) ?
84 Real val = 0., coeff = 0.;
85 for (
size_t i = 0; i < m+1; i++) {
100 void test(std::ostream &outStream = std::cout )
const {
102 std::vector<Real> X(size,0.);
103 std::vector<int> T(size,0);
104 X[0] =
a_-4.0*(Real)rand()/(Real)RAND_MAX;
108 X[2] = (
b_-
a_)*(Real)rand()/(Real)RAND_MAX +
a_;
112 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