10 #ifndef ROL_LAPLACE_HPP
11 #define ROL_LAPLACE_HPP
14 #include "ROL_ParameterList.hpp"
25 if ( k == 0 || m == 0 || m == 1 ) {
29 for (
size_t i = m-k; i < m; i++) {
36 Laplace(
const Real mean = 0.,
const Real scale = 1.)
40 mean_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Laplace").get(
"Mean",0.);
41 scale_ = parlist.sublist(
"SOL").sublist(
"Distribution").sublist(
"Laplace").get(
"Scale",1.);
60 Real sgn = ((input < 0.5) ? -1. : ((input > 0.5) ? 1. : 0.0));
61 return mean_ -
scale_*sgn*std::log(1.-2.*std::abs(input-0.5));
71 Real coeff = 0., val = 0.;
72 for (
size_t k = 0; k < m+1; k++) {
75 val += coeff*std::pow(
scale_,k)*std::pow(
mean_,m-k);
82 return ROL_NINF<Real>();
86 return ROL_INF<Real>();
89 void test(std::ostream &outStream = std::cout )
const {
91 std::vector<Real> X(size,4.*(Real)rand()/(Real)RAND_MAX - 2.);
92 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