2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Integrate concept checks for mapairy/holtsmark/saspoint5.

This commit is contained in:
jzmaddock
2024-07-25 19:03:50 +01:00
parent 7b0caf58c9
commit 493626c9a3
5 changed files with 32 additions and 8 deletions

View File

@@ -24,6 +24,7 @@
#include <boost/math/distributions/fisher_f.hpp>
#include <boost/math/distributions/gamma.hpp>
#include <boost/math/distributions/geometric.hpp>
#include <boost/math/distributions/holtsmark.hpp>
#include <boost/math/distributions/hyperexponential.hpp>
#include <boost/math/distributions/hypergeometric.hpp>
#include <boost/math/distributions/inverse_chi_squared.hpp>
@@ -34,6 +35,7 @@
#include <boost/math/distributions/laplace.hpp>
#include <boost/math/distributions/logistic.hpp>
#include <boost/math/distributions/lognormal.hpp>
#include <boost/math/distributions/mapairy.hpp>
#include <boost/math/distributions/negative_binomial.hpp>
#include <boost/math/distributions/non_central_chi_squared.hpp>
#include <boost/math/distributions/non_central_beta.hpp>
@@ -43,6 +45,7 @@
#include <boost/math/distributions/pareto.hpp>
#include <boost/math/distributions/poisson.hpp>
#include <boost/math/distributions/rayleigh.hpp>
#include <boost/math/distributions/saspoint5.hpp>
#include <boost/math/distributions/skew_normal.hpp>
#include <boost/math/distributions/students_t.hpp>
#include <boost/math/distributions/triangular.hpp>

View File

@@ -69,6 +69,15 @@ class kolmogorov_smirnov_distribution;
template <class RealType, class Policy>
class landau_distribution;
template <class RealType, class Policy>
class mapairy_distribution;
template <class RealType, class Policy>
class holtsmark_distribution;
template <class RealType, class Policy>
class saspoint5_distribution;
template <class RealType, class Policy>
class laplace_distribution;
@@ -140,6 +149,9 @@ class weibull_distribution;
typedef boost::math::inverse_gaussian_distribution<Type, Policy> inverse_gaussian;\
typedef boost::math::inverse_gamma_distribution<Type, Policy> inverse_gamma;\
typedef boost::math::landau_distribution<Type, Policy> landau;\
typedef boost::math::mapairy_distribution<Type, Policy> mapairy;\
typedef boost::math::holtsmark_distribution<Type, Policy> holtsmark;\
typedef boost::math::saspoint5_distribution<Type, Policy> saspoint5;\
typedef boost::math::laplace_distribution<Type, Policy> laplace;\
typedef boost::math::logistic_distribution<Type, Policy> logistic;\
typedef boost::math::lognormal_distribution<Type, Policy> lognormal;\

View File

@@ -885,7 +885,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr
}
else {
RealType x_cube = x * x * x;
RealType t = static_cast<RealType>(isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3));
RealType t = static_cast<RealType>((boost::math::isnormal)(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3));
// Rational Approximation
// Maximum Relative Error: 4.2897e-18
@@ -1253,7 +1253,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr
}
else {
RealType x_cube = x * x * x;
RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3);
RealType t = (boost::math::isnormal)(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3);
// Rational Approximation
// Maximum Relative Error: 5.4677e-35
@@ -1597,7 +1597,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::
RealType p_square = p * p;
if (isnormal(p_square)) {
if ((boost::math::isnormal)(p_square)) {
result = 1 / (cbrt(p_square) * c);
}
else if (p > 0) {
@@ -2181,7 +2181,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::
RealType p_square = p * p;
if (isnormal(p_square)) {
if ((boost::math::isnormal)(p_square)) {
result = 1 / (cbrt(p_square) * c);
}
else if (p > 0) {

View File

@@ -1288,7 +1288,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral
}
else {
RealType x_cube = x * x * x;
RealType t = static_cast<RealType>(isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3));
RealType t = static_cast<RealType>((boost::math::isnormal)(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3));
// Rational Approximation
// Maximum Relative Error: 6.2709e-17
@@ -1598,7 +1598,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral
}
else {
RealType x_cube = x * x * x;
RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3);
RealType t = (boost::math::isnormal)(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3);
// Rational Approximation
// Maximum Relative Error: 3.5865e-37
@@ -3373,7 +3373,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in
else {
RealType p_square = p * p;
if (isnormal(p_square)) {
if ((boost::math::isnormal)(p_square)) {
result = 1 / cbrt(p_square * constants::two_pi<RealType>());
}
else if (p > 0) {
@@ -3764,7 +3764,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in
else {
RealType p_square = p * p;
if (isnormal(p_square)) {
if ((boost::math::isnormal)(p_square)) {
result = 1 / cbrt(p_square * constants::two_pi<RealType>());
}
else if (p > 0) {

View File

@@ -86,6 +86,15 @@ void instantiate_for_fixed_precision_only(RealType, const std::true_type&)
function_requires<DistributionConcept<landau_distribution<RealType> > >();
function_requires<DistributionConcept<landau_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::landau > >();
function_requires<DistributionConcept<mapairy_distribution<RealType> > >();
function_requires<DistributionConcept<mapairy_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::mapairy > >();
function_requires<DistributionConcept<holtsmark_distribution<RealType> > >();
function_requires<DistributionConcept<holtsmark_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::holtsmark> >();
function_requires<DistributionConcept<saspoint5_distribution<RealType> > >();
function_requires<DistributionConcept<saspoint5_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::saspoint5> >();
#endif
#endif
}