|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50653 - in sandbox/math_toolkit: boost/math boost/math/bindings boost/math/distributions libs/math libs/math/config libs/math/test libs/math/test/compile_test
From: john_at_[hidden]
Date: 2009-01-17 10:47:51
Author: johnmaddock
Date: 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
New Revision: 50653
URL: http://svn.boost.org/trac/boost/changeset/50653
Log:
Add easier support for mpfr and ntl.
Add laplace to concept tests.
Fix misc. bugs and warnings, from concept tests.
Text files modified:
sandbox/math_toolkit/boost/math/bindings/rr.hpp | 2 +-
sandbox/math_toolkit/boost/math/distributions.hpp | 1 +
sandbox/math_toolkit/boost/math/distributions/fwd.hpp | 4 ++++
sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp | 4 ++--
sandbox/math_toolkit/libs/math/config/Jamfile.v2 | 12 ++++++++++--
sandbox/math_toolkit/libs/math/project-root.jam | 1 +
sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 9 ++++++++-
sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp | 1 +
sandbox/math_toolkit/libs/math/test/mpfr_concept_check.cpp | 2 ++
9 files changed, 30 insertions(+), 6 deletions(-)
Modified: sandbox/math_toolkit/boost/math/bindings/rr.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/bindings/rr.hpp (original)
+++ sandbox/math_toolkit/boost/math/bindings/rr.hpp 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -827,7 +827,7 @@
namespace detail{
template <class Policy>
-ntl::RR digamma_imp(ntl::RR x, const mpl::int_<0>* t, const Policy& pol)
+ntl::RR digamma_imp(ntl::RR x, const mpl::int_<0>* , const Policy& pol)
{
//
// This handles reflection of negative arguments, and all our
Modified: sandbox/math_toolkit/boost/math/distributions.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions.hpp 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -23,6 +23,7 @@
#include <boost/math/distributions/fisher_f.hpp>
#include <boost/math/distributions/gamma.hpp>
#include <boost/math/distributions/hypergeometric.hpp>
+#include <boost/math/distributions/laplace.hpp>
#include <boost/math/distributions/logistic.hpp>
#include <boost/math/distributions/lognormal.hpp>
#include <boost/math/distributions/negative_binomial.hpp>
Modified: sandbox/math_toolkit/boost/math/distributions/fwd.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/fwd.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/fwd.hpp 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -42,6 +42,9 @@
class hypergeometric_distribution;
template <class RealType, class Policy>
+class laplace_distribution;
+
+template <class RealType, class Policy>
class logistic_distribution;
template <class RealType, class Policy>
@@ -98,6 +101,7 @@
typedef boost::math::extreme_value_distribution<Type, Policy> extreme_value;\
typedef boost::math::fisher_f_distribution<Type, Policy> fisher_f;\
typedef boost::math::gamma_distribution<Type, Policy> gamma;\
+ typedef boost::math::laplace_distribution<Type, Policy> laplace;\
typedef boost::math::logistic_distribution<Type, Policy> logistic;\
typedef boost::math::lognormal_distribution<Type, Policy> lognormal;\
typedef boost::math::negative_binomial_distribution<Type, Policy> negative_binomial;\
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 10:47:50 EST (Sat, 17 Jan 2009)
@@ -211,7 +211,7 @@
if (false == dist.check_params(function, &result)) return result;
if(false == detail::check_probability(function, p, &result, Policy())) return result;
- return static_cast<RealType>(detail::hypergeometric_quantile(p, 1 - p, dist.sample_count(), dist.defective(), dist.total(), Policy()));
+ return static_cast<RealType>(detail::hypergeometric_quantile(p, RealType(1 - p), dist.sample_count(), dist.defective(), dist.total(), Policy()));
} // quantile
template <class RealType, class Policy>
@@ -225,7 +225,7 @@
if (false == c.dist.check_params(function, &result)) return result;
if(false == detail::check_probability(function, c.param, &result, Policy())) return result;
- return static_cast<RealType>(detail::hypergeometric_quantile(1 - c.param, c.param, c.dist.sample_count(), c.dist.defective(), c.dist.total(), Policy()));
+ return static_cast<RealType>(detail::hypergeometric_quantile(RealType(1 - c.param), c.param, c.dist.sample_count(), c.dist.defective(), c.dist.total(), Policy()));
} // quantile
template <class RealType, class Policy>
Modified: sandbox/math_toolkit/libs/math/config/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/config/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/config/Jamfile.v2 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -3,9 +3,17 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt.
+import modules ;
+import path ;
+
+local ntl-path = [ modules.peek : NTL_PATH ] ;
+local gmp_path = [ modules.peek : GMP_PATH ] ;
+
obj has_long_double_support : has_long_double_support.cpp ;
-obj has_mpfr_class : has_mpfr_class.cpp ;
-obj has_ntl_rr : has_ntl_rr.cpp ;
+obj has_mpfr_class : has_mpfr_class.cpp :
+ <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx ;
+obj has_ntl_rr : has_ntl_rr.cpp : <include>$(ntl-path)/include ;
+
Modified: sandbox/math_toolkit/libs/math/project-root.jam
==============================================================================
--- sandbox/math_toolkit/libs/math/project-root.jam (original)
+++ sandbox/math_toolkit/libs/math/project-root.jam 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -59,3 +59,4 @@
}
+
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 10:47:50 EST (Sat, 17 Jan 2009)
@@ -7,6 +7,11 @@
# bring in the rules for testing
import testing ;
+import modules ;
+import path ;
+
+local ntl-path = [ modules.peek : NTL_PATH ] ;
+local gmp_path = [ modules.peek : GMP_PATH ] ;
project
: requirements
@@ -35,6 +40,8 @@
<toolset>sun:<link>static
<define>BOOST_ALL_NO_LIB=1
<include>.
+ <include>$(ntl-path)/include
+ <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx
;
cpp-pch pch : pch.hpp ;
@@ -499,4 +506,4 @@
compile ntl_concept_check.cpp : <dependency>../config//has_ntl_rr ;
compile mpfr_concept_check.cpp : <dependency>../config//has_mpfr_class ;
-build-project ../example ;
\ No newline at end of file
+build-project ../example ;
Modified: sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -68,6 +68,7 @@
function_requires<DistributionConcept<extreme_value_distribution<RealType> > >();
function_requires<DistributionConcept<fisher_f_distribution<RealType> > >();
function_requires<DistributionConcept<gamma_distribution<RealType> > >();
+ function_requires<DistributionConcept<laplace_distribution<RealType> > >();
function_requires<DistributionConcept<logistic_distribution<RealType> > >();
function_requires<DistributionConcept<lognormal_distribution<RealType> > >();
function_requires<DistributionConcept<negative_binomial_distribution<RealType> > >();
Modified: sandbox/math_toolkit/libs/math/test/mpfr_concept_check.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/mpfr_concept_check.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/mpfr_concept_check.cpp 2009-01-17 10:47:50 EST (Sat, 17 Jan 2009)
@@ -1,3 +1,4 @@
+
// Copyright John Maddock 2007-8.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
@@ -15,6 +16,7 @@
# pragma warning(disable:4800)
# pragma warning(disable:4512)
# pragma warning(disable:4127)
+# pragma warning(disable:4512)
#endif
#include <boost/math/bindings/mpfr.hpp>
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