44 #ifndef ROL_LAPLACE_HPP
45 #define ROL_LAPLACE_HPP
48 #include "ROL_ParameterList.hpp"
59 if ( k == 0 || m == 0 || m == 1 ) {
63 for (
size_t i = m-k; i < m; i++) {
70 Laplace(
const Real mean = 0.,
const Real scale = 1.)
74 mean_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Laplace").get(
"Mean",0.);
75 scale_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Laplace").get(
"Scale",1.);
94 Real sgn = ((input < 0.5) ? -1. : ((input > 0.5) ? 1. : 0.0));
95 return mean_ -
scale_*sgn*std::log(1.-2.*std::abs(input-0.5));
105 Real coeff = 0., val = 0.;
106 for (
size_t k = 0; k < m+1; k++) {
109 val += coeff*std::pow(
scale_,k)*std::pow(
mean_,m-k);
116 return ROL_NINF<Real>();
120 return ROL_INF<Real>();
123 void test(std::ostream &outStream = std::cout )
const {
125 std::vector<Real> X(size,4.*(Real)rand()/(Real)RAND_MAX - 2.);
126 std::vector<int> T(size,0);
void test(std::ostream &outStream=std::cout) const
Laplace(ROL::ParameterList &parlist)
Real evaluatePDF(const Real input) const
Real invertCDF(const Real input) const
Real moment(const size_t m) const
Laplace(const Real mean=0., const Real scale=1.)
Real integrateCDF(const Real input) const
Real upperBound(void) const
size_t compute_coeff(const size_t m, const size_t k) const
Real evaluateCDF(const Real input) const
Real lowerBound(void) const
virtual void test(std::ostream &outStream=std::cout) const