diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp new file mode 100644 index 000000000..b4a60eeaf --- /dev/null +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -0,0 +1,179 @@ +// math_fwd.hpp + +// Copyright Paul A. Bristow 2006. +// Copyright John Maddock 2006. + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Omnibus list of forward declarations of math special functions. + +// IT = Integer type. +// RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types +// AT = Integer or Real type + +#ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP +#define BOOST_MATH_SPECIAL_MATH_FWD_HPP + +#include // for argument promotion. + +namespace boost +{ + namespace math + { // Math functions (in roughly alphabetic order). + + // Beta functions. + template + RT beta(RT a, RT b); // Beta function (2 arguments). + template + RT beta(RT a, RT b, RT x);// Beta function (3 arguments). + template + RT betac(RT a, RT b, RT x); + template + RT ibeta(RT a, RT b, RT x); // Incomplete beta function. + template + RT ibetac(RT a, RT b, RT x); // Incomplete beta complement function. + template + RT ibeta_inv(RT a, RT b, RT p); // Incomplete beta inverse function. + template + RT ibetac_inv(RT a, RT b, RT q); // Incomplete beta complement inverse function. + + // Binomial distribution. + + template // Binomial distribution (k, n, x) + // Probability of number of events between 0 and k-1 inclusive, if expected probability of success events is success_fraction. + typename tools::promote_arg3::type + // Return type is the wider of the two (perhaps promoted) floating-point types. + binomial(ArithmeticType k, ArithmeticType n, RealType success_fraction); + + template // Binomial distribution complement (k, n, x) + // Probability of number of events between 0 and k-1 inclusive, if expected mean is x. + typename tools::promote_arg3::type + // Return type is the wider of the two (perhaps promoted) floating-point types. + binomial_c(ArithmeticType k, ArithmeticType n, RealType success_fraction); + + template + // success_fraction if number of events between 0 and k-1 inclusive, and probability p. + typename tools::promote_arg3::type + // Return type is the wider of the two (perhaps promoted) floating point types. + binomial_inv(ArithmeticType k, ArithmeticType n, RealType probability); // Binomial distribution inverse (k, n, p) + + // cbrt - cube root. + template + RT cbrt(RT z); + + // chi_sqr functions. + template // probability chisqr(degrees_of_freedom, chisqr) + typename tools::promote_arg2::type + // return type is the wider of the two (?promoted) floating point types. + chisqr(AT degrees_of_freedom, RT chisqr); + + template // complement probability chisqr_c(degrees_of_freedom, chisqr) + typename tools::promote_arg2::type + chisqr_c(AT degrees_of_freedom, RT chisqr); + + template // chisqr = chisqr_inv(degrees_of_freedom, probability) + typename tools::promote_arg2::type + chisqr_inv(AT degrees_of_freedom, RT probability); + + template // degrees_of_freedom = chisqr_inv_df(chisqr, probability) + typename tools::promote_arg2::type // but both RT. + chisqr_df_inv(RT chisqr, RT probability); + + // erf & erfc error functions. + template // Error function. + RT erf(RT z); + template // Error function complement. + RT erfc(RT z); + template // Error function inverse. + RT erf_inv(RT z); + template // Error function complement inverse. + RT erfc_inv(RT z); + + // Exp (x minus 1) functions. + template + T expm1(T); + + // Factorial functions. + // Note: not for integral types, at present. + template + struct max_factorial; + template + RT factorial(unsigned int); + template + RT unchecked_factorial(unsigned int); + + // Fisher-Snedecor functions. + + template + typename tools::promote_arg3::type + // return type is the wider of the three (possibly promoted) floating point types. + fisher(AT degrees_of_freedom1, AT degrees_of_freedom2, RT fisher); + + template + typename tools::promote_arg3::type + fisher_c(AT degrees_of_freedom1, AT degrees_of_freedom2, RT fisher); + + template + typename tools::promote_arg3::type + fisher_inv(AT degrees_of_freedom1, AT degrees_of_freedom2, RT fisher); + + template + typename tools::promote_arg3::type + fisher_c_inv(AT degrees_of_freedom1, AT degrees_of_freedom2, RT fisher); + + // Fpclassify - classify floating-point as NaN or infinity... + template + int fpclassify (T); + + // Gamma functions. + template + RT tgamma(RT z); + template + RT tgamma(RT a, RT z); + template + RT lgamma(RT z, int* sign); + template + RT lgamma(RT x); + template + RT tgamma_lower(RT a, RT z); + template + RT gamma_Q(RT a, RT z); + template + RT gamma_P(RT a, RT z); + // gamma inverse. + template + RT gamma_P_inv(RT a, RT p); + template + RT gamma_Q_inv(RT a, RT q); + + // Hypotenuse function sqrt(x ^ 2 + y ^ 2). + template + T hypot(T, T); + + // log1p is log(x + 1) + template + T log1p(T); + + // Power + template + T powm1(const T, const T); + + template + typename tools::promote_arg2::type + students_t(AT degrees_of_freedom1, RT probability); // probability from t. + + template + typename tools::promote_arg2::type + students_t_inv(AT degrees_of_freedom1, RT probability); // t from probability. + + // sqrt + template + T sqrtp1m1(const T&); + + } // namespace math +} // namespace boost + +#endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP