|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50658 - in sandbox/math_toolkit: boost/math/concepts boost/math/distributions libs/math/test libs/math/test/compile_test
From: john_at_[hidden]
Date: 2009-01-17 13:14:04
Author: johnmaddock
Date: 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
New Revision: 50658
URL: http://svn.boost.org/trac/boost/changeset/50658
Log:
Add some previously missing tests, and fix up the remaining concept failures for the new distributions.
Added:
sandbox/math_toolkit/libs/math/test/compile_test/dist_hypergeo_incl_test.cpp (contents, props changed)
sandbox/math_toolkit/libs/math/test/compile_test/dist_laplace_incl_test.cpp (contents, props changed)
sandbox/math_toolkit/libs/math/test/compile_test/dist_logistic_incl_test.cpp (contents, props changed)
Text files modified:
sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp | 6 +++++-
sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp | 4 ++--
sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 3 +++
3 files changed, 10 insertions(+), 3 deletions(-)
Modified: sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp (original)
+++ sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -18,7 +18,6 @@
#include <boost/config.hpp>
#include <boost/limits.hpp>
-#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
@@ -227,6 +226,11 @@
} // namespace std
+#include <boost/math/special_functions/round.hpp>
+#include <boost/math/special_functions/trunc.hpp>
+#include <boost/math/special_functions/modf.hpp>
+#include <boost/math/tools/precision.hpp>
+
namespace boost{ namespace math{ namespace concepts{
//
Modified: sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -27,7 +27,7 @@
typedef Policy policy_type;
hypergeometric_distribution(unsigned r, unsigned n, unsigned N) // Constructor.
- : m_r(r), m_n(n), m_N(N)
+ : m_n(n), m_N(N), m_r(r)
{
static const char* function = "boost::math::hypergeometric_distribution<%1%>::hypergeometric_distribution";
RealType ret;
@@ -111,7 +111,7 @@
}
template <class RealType, class Policy>
- inline const std::pair<RealType, RealType> support(const hypergeometric_distribution<RealType, Policy>& d)
+ inline const std::pair<unsigned, unsigned> support(const hypergeometric_distribution<RealType, Policy>& d)
{
return range(d);
}
Modified: sandbox/math_toolkit/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/test/Jamfile.v2 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -434,6 +434,9 @@
compile compile_test/dist_find_scale_incl_test.cpp ;
compile compile_test/dist_fisher_f_incl_test.cpp ;
compile compile_test/dist_gamma_incl_test.cpp ;
+compile compile_test/dist_hypergeo_incl_test.cpp ;
+compile compile_test/dist_laplace_incl_test.cpp ;
+compile compile_test/dist_logistic_incl_test.cpp ;
compile compile_test/dist_lognormal_incl_test.cpp ;
compile compile_test/dist_neg_binom_incl_test.cpp ;
compile compile_test/dist_nc_chi_squ_incl_test.cpp ;
Added: sandbox/math_toolkit/libs/math/test/compile_test/dist_hypergeo_incl_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/compile_test/dist_hypergeo_incl_test.cpp 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -0,0 +1,25 @@
+// Copyright John Maddock 2008.
+// 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)
+//
+// Basic sanity check that header <boost/math/distributions/hypergeometric.hpp>
+// #includes all the files that it needs to.
+//
+#include <boost/math/distributions/hypergeometric.hpp>
+//
+// Note this header includes no other headers, this is
+// important if this test is to be meaningful:
+//
+#include "test_compile_result.hpp"
+
+void check()
+{
+ TEST_DIST_FUNC(hypergeometric)
+}
+
+template class boost::math::hypergeometric_distribution<float, boost::math::policies::policy<> >;
+template class boost::math::hypergeometric_distribution<double, boost::math::policies::policy<> >;
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template class boost::math::hypergeometric_distribution<long double, boost::math::policies::policy<> >;
+#endif
Added: sandbox/math_toolkit/libs/math/test/compile_test/dist_laplace_incl_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/compile_test/dist_laplace_incl_test.cpp 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -0,0 +1,25 @@
+// Copyright John Maddock 2008.
+// 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)
+//
+// Basic sanity check that header <boost/math/distributions/laplace.hpp>
+// #includes all the files that it needs to.
+//
+#include <boost/math/distributions/laplace.hpp>
+//
+// Note this header includes no other headers, this is
+// important if this test is to be meaningful:
+//
+#include "test_compile_result.hpp"
+
+void check()
+{
+ TEST_DIST_FUNC(laplace)
+}
+
+template class boost::math::laplace_distribution<float, boost::math::policies::policy<> >;
+template class boost::math::laplace_distribution<double, boost::math::policies::policy<> >;
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template class boost::math::laplace_distribution<long double, boost::math::policies::policy<> >;
+#endif
Added: sandbox/math_toolkit/libs/math/test/compile_test/dist_logistic_incl_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/compile_test/dist_logistic_incl_test.cpp 2009-01-17 13:14:03 EST (Sat, 17 Jan 2009)
@@ -0,0 +1,25 @@
+// Copyright John Maddock 2008.
+// 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)
+//
+// Basic sanity check that header <boost/math/distributions/logistic.hpp>
+// #includes all the files that it needs to.
+//
+#include <boost/math/distributions/logistic.hpp>
+//
+// Note this header includes no other headers, this is
+// important if this test is to be meaningful:
+//
+#include "test_compile_result.hpp"
+
+void check()
+{
+ TEST_DIST_FUNC(logistic)
+}
+
+template class boost::math::logistic_distribution<float, boost::math::policies::policy<> >;
+template class boost::math::logistic_distribution<double, boost::math::policies::policy<> >;
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template class boost::math::logistic_distribution<long double, boost::math::policies::policy<> >;
+#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