44 #ifndef ROL_EXPONENTIAL_HPP
45 #define ROL_EXPONENTIAL_HPP
48 #include "ROL_ParameterList.hpp"
59 if ( k == 0 || m == 0 || m == 1 ) {
63 for (
size_t i = m-k; i < m; i++) {
71 :
loc_(loc),
scale_((scale>0.) ? scale : 1.) {}
74 loc_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Exponential").get(
"Location",0.);
75 scale_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Exponential").get(
"Scale",1.);
88 return ((input >=
loc_) ?
93 return -std::log(1.-input)/
scale_;
97 Real val = 0., coeff = 0.;
98 for (
size_t i = 0; i < m+1; i++) {
100 val += coeff*std::pow(
loc_,(Real)(m-i))/std::pow(
scale_,(Real)i);
110 return ROL_INF<Real>();
113 void test(std::ostream &outStream = std::cout )
const {
115 std::vector<Real> X(size,0.);
116 std::vector<int> T(size,0);
117 X[0] =
loc_-4.0*(Real)rand()/(Real)RAND_MAX;
121 X[2] =
loc_+4.0*(Real)rand()/(Real)RAND_MAX;
Real integrateCDF(const Real input) const
Exponential(ROL::ParameterList &parlist)
Real invertCDF(const Real input) const
Real upperBound(void) const
Real evaluatePDF(const Real input) const
Real evaluateCDF(const Real input) const
size_t compute_coeff(const size_t m, const size_t k) const
Real moment(const size_t m) const
virtual void test(std::ostream &outStream=std::cout) const
Exponential(const Real loc=0., const Real scale=1.)
Real lowerBound(void) const
void test(std::ostream &outStream=std::cout) const