12 #include "Distribution.h"
14 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
15 #include "libmesh/ignore_warnings.h"
16 #pragma GCC diagnostic ignored "-Wparentheses"
17 #include <boost/math/distributions.hpp>
18 #include "libmesh/restore_warnings.h"
47 template <
typename T = Real>
53 virtual Real
pdf(
const Real & x)
const override;
54 virtual Real
cdf(
const Real & x)
const override;
55 virtual Real
quantile(
const Real & y)
const override;
56 virtual Real
median()
const override;
65 : Distribution(parameters)
67 #ifndef LIBMESH_HAVE_EXTERNAL_BOOST
69 getParam<std::string>(
"type"),
70 " distribution named '",
72 "' requires that libMesh be compiled with an external Boost library, this may be done "
73 "using the --with-boost configure option.");
81 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
82 mooseAssert(_distribution_unique_ptr,
"Boost distribution pointer not defined.");
83 TIME_SECTION(_perf_pdf);
84 return boost::math::pdf(*_distribution_unique_ptr, x);
94 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
95 mooseAssert(_distribution_unique_ptr,
"Boost distribution pointer not defined.");
96 TIME_SECTION(_perf_cdf);
97 return boost::math::cdf(*_distribution_unique_ptr, x);
103 template <
typename T>
107 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
108 mooseAssert(_distribution_unique_ptr,
"Boost distribution pointer not defined.");
109 TIME_SECTION(_perf_quantile);
110 return boost::math::quantile(*_distribution_unique_ptr, y);
116 template <
typename T>
120 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
121 mooseAssert(_distribution_unique_ptr,
"Boost distribution pointer not defined.");
122 TIME_SECTION(_perf_median);
123 return boost::math::median(*_distribution_unique_ptr);