|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48656 - sandbox/SOC/2008/parrallel_math/libs/math/test/compile_test
From: gautamcool88_at_[hidden]
Date: 2008-09-07 17:45:24
Author: s.gautam
Date: 2008-09-07 17:45:23 EDT (Sun, 07 Sep 2008)
New Revision: 48656
URL: http://svn.boost.org/trac/boost/changeset/48656
Log:
made changes to a copy containing newer distributions
Text files modified:
sandbox/SOC/2008/parrallel_math/libs/math/test/compile_test/instantiate.hpp | 117 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 113 insertions(+), 4 deletions(-)
Modified: sandbox/SOC/2008/parrallel_math/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- sandbox/SOC/2008/parrallel_math/libs/math/test/compile_test/instantiate.hpp (original)
+++ sandbox/SOC/2008/parrallel_math/libs/math/test/compile_test/instantiate.hpp 2008-09-07 17:45:23 EDT (Sun, 07 Sep 2008)
@@ -16,7 +16,9 @@
#include <boost/math/special_functions.hpp>
#include <boost/math/concepts/distributions.hpp>
-typedef boost::math::policies::policy<> test_policy;
+#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
+
+typedef boost::math::policies::policy<> test_policy;
namespace test{
@@ -29,6 +31,26 @@
BOOST_MATH_DECLARE_DISTRIBUTIONS(double, test_policy)
}
+#endif
+
+namespace boost{ namespace math{
+//
+// The non central beta doesn't define some properties,
+// define some stub methods here so that we can concept
+// check everything else:
+//
+template <class T, class Policy>
+inline T mean(const non_central_beta_distribution<T, Policy>&){ return 0; }
+template <class T, class Policy>
+inline T variance(const non_central_beta_distribution<T, Policy>&){ return 0; }
+template <class T, class Policy>
+inline T skewness(const non_central_beta_distribution<T, Policy>&){ return 0; }
+template <class T, class Policy>
+inline T kurtosis_excess(const non_central_beta_distribution<T, Policy>&){ return 0; }
+template <class T, class Policy>
+inline T kurtosis(const non_central_beta_distribution<T, Policy>&){ return 0; }
+
+}} // namespaces
template <class RealType>
void instantiate(RealType)
@@ -57,7 +79,11 @@
function_requires<DistributionConcept<uniform_distribution<RealType> > >();
function_requires<DistributionConcept<weibull_distribution<RealType> > >();
function_requires<DistributionConcept<logistic_distribution<RealType> > >();
-
+ function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_beta_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_f_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_t_distribution<RealType> > >();
+#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
function_requires<DistributionConcept<bernoulli_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<beta_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<binomial_distribution<RealType, test_policy> > >();
@@ -68,6 +94,7 @@
function_requires<DistributionConcept<fisher_f_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<gamma_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<lognormal_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<negative_binomial_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<normal_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<rayleigh_distribution<RealType, test_policy> > >();
@@ -78,6 +105,10 @@
function_requires<DistributionConcept<uniform_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<weibull_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<logistic_distribution<RealType,test_policy> > >();
+ function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_beta_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_f_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_t_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::bernoulli > >();
function_requires<DistributionConcept<dist_test::beta > >();
@@ -99,7 +130,11 @@
function_requires<DistributionConcept<dist_test::uniform > >();
function_requires<DistributionConcept<dist_test::weibull > >();
function_requires<DistributionConcept<dist_test::logistic> >();
-
+ function_requires<DistributionConcept<dist_test::non_central_chi_squared > >();
+ function_requires<DistributionConcept<dist_test::non_central_beta > >();
+ function_requires<DistributionConcept<dist_test::non_central_f > >();
+ function_requires<DistributionConcept<dist_test::non_central_t > >();
+#endif
int i;
RealType v1(0.5), v2(0.5), v3(0.5);
boost::math::tgamma(v1);
@@ -194,6 +229,30 @@
boost::math::sph_bessel(i, 1);
boost::math::sph_neumann(i, v2);
boost::math::sph_neumann(i, i);
+ boost::math::expint(v1);
+ boost::math::expint(i);
+ boost::math::expint(i, v2);
+ boost::math::expint(i, i);
+ boost::math::zeta(v1);
+ boost::math::zeta(i);
+ boost::math::trunc(v1);
+ boost::math::itrunc(v1);
+ boost::math::ltrunc(v1);
+ boost::math::round(v1);
+ boost::math::iround(v1);
+ boost::math::lround(v1);
+ boost::math::modf(v1, &v1);
+ boost::math::modf(v1, &i);
+ long l;
+ boost::math::modf(v1, &l);
+#ifdef BOOST_HAS_LONG_LONG
+ boost::math::lltrunc(v1);
+ boost::math::llround(v1);
+ boost::long_long_type ll;
+ boost::math::modf(v1, &ll);
+#endif
+ boost::math::pow<2>(v1);
+#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
//
// All over again, with a policy this time:
//
@@ -289,6 +348,33 @@
boost::math::sph_bessel(i, 1, pol);
boost::math::sph_neumann(i, v2, pol);
boost::math::sph_neumann(i, i, pol);
+ boost::math::expint(v1, pol);
+ boost::math::expint(i, pol);
+ boost::math::expint(i, v2, pol);
+ boost::math::expint(i, i, pol);
+ boost::math::zeta(v1, pol);
+ boost::math::zeta(i, pol);
+ //
+ // These next functions are intended to be found via ADL:
+ //
+ BOOST_MATH_STD_USING
+ trunc(v1, pol);
+ itrunc(v1, pol);
+ ltrunc(v1, pol);
+ round(v1, pol);
+ iround(v1, pol);
+ lround(v1, pol);
+ modf(v1, &v1, pol);
+ modf(v1, &i, pol);
+ modf(v1, &l, pol);
+#ifdef BOOST_HAS_LONG_LONG
+ using boost::math::lltrunc;
+ using boost::math::llround;
+ lltrunc(v1, pol);
+ llround(v1, pol);
+ modf(v1, &ll, pol);
+#endif
+ boost::math::pow<2>(v1, pol);
//
// All over again with the versions in test::
//
@@ -383,6 +469,28 @@
test::sph_bessel(i, 1);
test::sph_neumann(i, v2);
test::sph_neumann(i, i);
+ test::expint(v1);
+ test::expint(i);
+ test::expint(i, v2);
+ test::expint(i, i);
+ test::zeta(v1);
+ test::zeta(i);
+ test::trunc(v1);
+ test::itrunc(v1);
+ test::ltrunc(v1);
+ test::round(v1);
+ test::iround(v1);
+ test::lround(v1);
+ test::modf(v1, &v1);
+ test::modf(v1, &i);
+ test::modf(v1, &l);
+#ifdef BOOST_HAS_LONG_LONG
+ test::lltrunc(v1);
+ test::llround(v1);
+ test::modf(v1, &ll);
+#endif
+ test::pow<2>(v1);
+#endif
}
template <class RealType>
@@ -390,7 +498,7 @@
{
using namespace boost;
using namespace boost::math;
-
+#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
int i = 1;
long l = 1;
short s = 1;
@@ -739,6 +847,7 @@
test::sph_bessel(i, 1);
test::sph_neumann(i, lr);
test::sph_neumann(i, i);
+#endif
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk