|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79724 - in sandbox/big_number: boost/multiprecision libs/multiprecision/performance libs/multiprecision/test libs/multiprecision/test/concepts
From: john_at_[hidden]
Date: 2012-07-24 14:03:55
Author: johnmaddock
Date: 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
New Revision: 79724
URL: http://svn.boost.org/trac/boost/changeset/79724
Log:
Refactor concept checks for faster compilers.
Add constexpr construction test.
Added:
sandbox/big_number/libs/multiprecision/test/concepts/
sandbox/big_number/libs/multiprecision/test/concepts/mp_number_concept_check.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp (contents, props changed)
sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp (contents, props changed)
Removed:
sandbox/big_number/libs/multiprecision/test/mp_number_concept_check.cpp
Text files modified:
sandbox/big_number/boost/multiprecision/cpp_int.hpp | 58 ++++++++++--------
sandbox/big_number/libs/multiprecision/performance/performance_test.cpp | 5 +
sandbox/big_number/libs/multiprecision/test/Jamfile.v2 | 121 +++++++++++++++++----------------------
3 files changed, 91 insertions(+), 93 deletions(-)
Modified: sandbox/big_number/boost/multiprecision/cpp_int.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_int.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_int.hpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -236,11 +236,15 @@
BOOST_STATIC_ASSERT_MSG(internal_limb_count >= 2, "A fixed precision integer type must have at least 2 limbs");
private:
- union{
+ union data_type{
limb_type m_data[internal_limb_count];
limb_type m_first_limb;
double_limb_type m_double_first_limb;
- };
+
+ BOOST_CONSTEXPR data_type(){}
+ BOOST_CONSTEXPR data_type(limb_type i) : m_first_limb(i) {}
+ BOOST_CONSTEXPR data_type(double_limb_type i) : m_double_first_limb(i) {}
+ } m_wrapper;
boost::uint16_t m_limbs;
bool m_sign;
@@ -249,21 +253,21 @@
// Direct construction:
//
BOOST_CONSTEXPR cpp_int_base(limb_type i)BOOST_NOEXCEPT
- : m_first_limb(i), m_limbs(1), m_sign(false) {}
+ : m_wrapper(i), m_limbs(1), m_sign(false) {}
BOOST_CONSTEXPR cpp_int_base(signed_limb_type i)BOOST_NOEXCEPT
- : m_first_limb(std::abs(i)), m_limbs(1), m_sign(i < 0) {}
+ : m_wrapper(limb_type(i < 0 ? -i : i)), m_limbs(1), m_sign(i < 0) {}
#if defined(BOOST_LITTLE_ENDIAN)
BOOST_CONSTEXPR cpp_int_base(double_limb_type i)BOOST_NOEXCEPT
- : m_double_first_limb(i), m_limbs(i > max_limb_value ? 2 : 1), m_sign(false) {}
+ : m_wrapper(i), m_limbs(i > max_limb_value ? 2 : 1), m_sign(false) {}
BOOST_CONSTEXPR cpp_int_base(signed_double_limb_type i)BOOST_NOEXCEPT
- : m_double_first_limb(i < 0 ? -i : i), m_limbs(i < 0 ? (-i > max_limb_value ? 2 : 1) : (i > max_limb_value ? 2 : 1)), m_sign(i < 0) {}
+ : m_wrapper(double_limb_type(i < 0 ? -i : i)), m_limbs(i < 0 ? (-i > max_limb_value ? 2 : 1) : (i > max_limb_value ? 2 : 1)), m_sign(i < 0) {}
#endif
//
// Helper functions for getting at our internal data, and manipulating storage:
//
unsigned size()const BOOST_NOEXCEPT { return m_limbs; }
- limb_pointer limbs() BOOST_NOEXCEPT { return m_data; }
- const_limb_pointer limbs()const BOOST_NOEXCEPT { return m_data; }
+ limb_pointer limbs() BOOST_NOEXCEPT { return m_wrapper.m_data; }
+ const_limb_pointer limbs()const BOOST_NOEXCEPT { return m_wrapper.m_data; }
bool sign()const BOOST_NOEXCEPT { return m_sign; }
void sign(bool b) BOOST_NOEXCEPT
{
@@ -287,7 +291,7 @@
if((m_limbs == 1) && (!*p)) m_sign = false; // zero is always unsigned
}
- BOOST_CONSTEXPR cpp_int_base() : m_first_limb(0), m_limbs(1), m_sign(false) {}
+ BOOST_CONSTEXPR cpp_int_base() : m_wrapper(limb_type(0u)), m_limbs(1), m_sign(false) {}
cpp_int_base(const cpp_int_base& o) BOOST_NOEXCEPT : m_limbs(o.m_limbs), m_sign(o.m_sign)
{
std::copy(o.limbs(), o.limbs() + o.size(), limbs());
@@ -298,7 +302,7 @@
if(this != &o)
{
resize(o.size());
- std::memcpy(limbs(), o.limbs(), size() * sizeof(limb_type));
+ std::copy(o.limbs(), o.limbs() + o.size(), limbs());
m_sign = o.m_sign;
}
}
@@ -319,7 +323,7 @@
void do_swap(cpp_int_base& o) BOOST_NOEXCEPT
{
for(unsigned i = 0; i < (std::max)(size(), o.size()); ++i)
- std::swap(m_data[i], o.m_data[i]);
+ std::swap(m_wrapper.m_data[i], o.m_wrapper.m_data[i]);
std::swap(m_sign, o.m_sign);
std::swap(m_limbs, o.m_limbs);
}
@@ -346,11 +350,15 @@
BOOST_STATIC_ASSERT_MSG(internal_limb_count >= 2, "A fixed precision integer type must have at least 2 limbs");
private:
- union{
+ union data_type{
limb_type m_data[internal_limb_count];
limb_type m_first_limb;
double_limb_type m_double_first_limb;
- };
+
+ BOOST_CONSTEXPR data_type() {}
+ BOOST_CONSTEXPR data_type(limb_type i) : m_first_limb(i) {}
+ BOOST_CONSTEXPR data_type(double_limb_type i) : m_double_first_limb(i) {}
+ } m_wrapper;
limb_type m_limbs;
public:
@@ -358,21 +366,21 @@
// Direct construction:
//
BOOST_CONSTEXPR cpp_int_base(limb_type i)BOOST_NOEXCEPT
- : m_first_limb(i), m_limbs(1) {}
+ : m_wrapper(i), m_limbs(1) {}
cpp_int_base(signed_limb_type i)BOOST_NOEXCEPT
- : m_first_limb(i < 0 ? -i : i), m_limbs(1) { if(i < 0) negate(); }
+ : m_wrapper(limb_type(i < 0 ? -i : i)), m_limbs(1) { if(i < 0) negate(); }
#ifdef BOOST_LITTLE_ENDIAN
BOOST_CONSTEXPR cpp_int_base(double_limb_type i)BOOST_NOEXCEPT
- : m_double_first_limb(i), m_limbs(i > max_limb_value ? 2 : 1) {}
+ : m_wrapper(i), m_limbs(i > max_limb_value ? 2 : 1) {}
cpp_int_base(signed_double_limb_type i)BOOST_NOEXCEPT
- : m_double_first_limb(i < 0 ? -i : i), m_limbs(i < 0 ? (-i > max_limb_value ? 2 : 1) : (i > max_limb_value ? 2 : 1)) { if(i < 0) negate(); }
+ : m_wrapper(double_limb_type(i < 0 ? -i : i)), m_limbs(i < 0 ? (-i > max_limb_value ? 2 : 1) : (i > max_limb_value ? 2 : 1)) { if(i < 0) negate(); }
#endif
//
// Helper functions for getting at our internal data, and manipulating storage:
//
unsigned size()const BOOST_NOEXCEPT { return m_limbs; }
- limb_pointer limbs() BOOST_NOEXCEPT { return m_data; }
- const_limb_pointer limbs()const BOOST_NOEXCEPT { return m_data; }
+ limb_pointer limbs() BOOST_NOEXCEPT { return m_wrapper.m_data; }
+ const_limb_pointer limbs()const BOOST_NOEXCEPT { return m_wrapper.m_data; }
BOOST_CONSTEXPR bool sign()const BOOST_NOEXCEPT { return false; }
void sign(bool b) BOOST_NOEXCEPT { if(b) negate(); }
void resize(unsigned new_size) BOOST_NOEXCEPT
@@ -386,7 +394,7 @@
while((m_limbs-1) && !p[m_limbs - 1])--m_limbs;
}
- BOOST_CONSTEXPR cpp_int_base() BOOST_NOEXCEPT : m_first_limb(0), m_limbs(1) {}
+ BOOST_CONSTEXPR cpp_int_base() BOOST_NOEXCEPT : m_wrapper(limb_type(0u)), m_limbs(1) {}
cpp_int_base(const cpp_int_base& o) BOOST_NOEXCEPT : m_limbs(o.m_limbs)
{
std::copy(o.limbs(), o.limbs() + o.size(), limbs());
@@ -397,7 +405,7 @@
if(this != &o)
{
resize(o.size());
- std::memcpy(limbs(), o.limbs(), size() * sizeof(limb_type));
+ std::copy(o.limbs(), o.limbs() + o.size(), limbs());
}
}
void negate() BOOST_NOEXCEPT
@@ -406,10 +414,10 @@
// would result in a "negative" number:
unsigned i;
for(i = m_limbs; i < internal_limb_count; ++i)
- m_data[i] = 0;
+ m_wrapper.m_data[i] = 0;
m_limbs = internal_limb_count;
for(i = 0; i < internal_limb_count; ++i)
- m_data[i] = ~m_data[i];
+ m_wrapper.m_data[i] = ~m_wrapper.m_data[i];
normalize();
eval_increment(static_cast<cpp_int_backend<MinBits, false, void>& >(*this));
}
@@ -420,7 +428,7 @@
void do_swap(cpp_int_base& o) BOOST_NOEXCEPT
{
for(unsigned i = 0; i < (std::max)(size(), o.size()); ++i)
- std::swap(m_data[i], o.m_data[i]);
+ std::swap(m_wrapper.m_data[i], o.m_wrapper.m_data[i]);
std::swap(m_limbs, o.m_limbs);
}
};
@@ -442,7 +450,7 @@
#ifdef BOOST_MSVC
#pragma warning(push)
-#pragma warning(disable:4244) // loss of data in initialization
+#pragma warning(disable:4244 4293) // loss of data in initialization, shift count too large
#endif
template <unsigned MinBits>
Modified: sandbox/big_number/libs/multiprecision/performance/performance_test.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/performance/performance_test.cpp (original)
+++ sandbox/big_number/libs/multiprecision/performance/performance_test.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -88,6 +88,8 @@
template<>
class number_category<boost::int64_t> : public mpl::int_<number_kind_integer>{};
+template<>
+class number_category<boost::uint64_t> : public mpl::int_<number_kind_integer>{};
}}
@@ -638,7 +640,7 @@
int main()
{
#ifdef TEST_INT64
- test<boost::int64_t>("boost::int64_t", 64);
+ test<boost::uint64_t>("boost::uint64_t", 64);
#endif
#ifdef TEST_MPF
test<boost::multiprecision::mpf_float_50>("gmp_float", 50);
@@ -652,6 +654,7 @@
test<boost::multiprecision::mpz_int>("gmp_int", 1024);
#endif
#ifdef TEST_CPP_INT
+ test<boost::multiprecision::mp_number<boost::multiprecision::cpp_int_backend<64, false, void>, false > >("cpp_int(unsigned, fixed)", 64);
test<boost::multiprecision::mp_number<boost::multiprecision::cpp_int_backend<64, true, void>, false > >("cpp_int(fixed)", 64);
test<boost::multiprecision::mp_number<boost::multiprecision::cpp_int_backend<128, true, void>, false > >("cpp_int(fixed)", 128);
test<boost::multiprecision::mp_number<boost::multiprecision::cpp_int_backend<256, true, void>, false > >("cpp_int(fixed)", 256);
Modified: sandbox/big_number/libs/multiprecision/test/Jamfile.v2
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/Jamfile.v2 (original)
+++ sandbox/big_number/libs/multiprecision/test/Jamfile.v2 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -610,6 +610,7 @@
: test_move_cpp_int ;
run test_test.cpp ;
+compile test_constexpr.cpp ;
run test_float_io.cpp
: # command line
@@ -772,73 +773,59 @@
if ! $(disable-concepts)
{
- run mp_number_concept_check.cpp mpfr
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPFR_50
- [ check-target-builds ../config//has_mpfr : : <build>no ]
- : mp_number_concept_check_mpfr_50 ;
-
- run mp_number_concept_check.cpp mpfr
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPFR_6
- [ check-target-builds ../config//has_mpfr : : <build>no ]
- : mp_number_concept_check_mpfr_6 ;
-
- run mp_number_concept_check.cpp mpfr
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPFR_15
- [ check-target-builds ../config//has_mpfr : : <build>no ]
- : mp_number_concept_check_mpfr_15 ;
-
- run mp_number_concept_check.cpp mpfr
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPFR_17
- [ check-target-builds ../config//has_mpfr : : <build>no ]
- : mp_number_concept_check_mpfr_17 ;
-
- run mp_number_concept_check.cpp mpfr
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPFR_30
- [ check-target-builds ../config//has_mpfr : : <build>no ]
- : mp_number_concept_check_mpfr_30 ;
-
- run mp_number_concept_check.cpp gmp
- : # command line
- : # input files
- : # requirements
- <define>TEST_MPF_50
- [ check-target-builds ../config//has_gmp : : <build>no ]
- : mp_number_concept_check_mpf50 ;
-
- run mp_number_concept_check.cpp
- : # command line
- : # input files
- : # requirements
- <define>TEST_CPP_DEC_FLOAT
- : mp_number_concept_check_cpp_dec_float ;
- run mp_number_concept_check.cpp
- : # command line
- : # input files
- : # requirements
- <define>TEST_CPP_DEC_FLOAT_NO_ET
- : mp_number_concept_check_cpp_dec_float_no_et ;
-
- run mp_number_concept_check.cpp
- : # command line
- : # input files
- : # requirements
- <define>TEST_BACKEND
- : mp_number_concept_check_backend_concept ;
+ for local source in [ glob concepts/*.cpp ]
+ {
+ compile $(source) mpfr
+ : # requirements
+ <define>TEST_MPFR_50
+ [ check-target-builds ../config//has_mpfr : : <build>no ]
+ : $(source:B)_mpfr_50 ;
+
+ compile $(source) mpfr
+ : # requirements
+ <define>TEST_MPFR_6
+ [ check-target-builds ../config//has_mpfr : : <build>no ]
+ : $(source:B)_mpfr_6 ;
+
+ compile $(source) mpfr
+ : # requirements
+ <define>TEST_MPFR_15
+ [ check-target-builds ../config//has_mpfr : : <build>no ]
+ : $(source:B)_mpfr_15 ;
+
+ compile $(source) mpfr
+ : # requirements
+ <define>TEST_MPFR_17
+ [ check-target-builds ../config//has_mpfr : : <build>no ]
+ : $(source:B)_mpfr_17 ;
+
+ compile $(source) mpfr
+ : # requirements
+ <define>TEST_MPFR_30
+ [ check-target-builds ../config//has_mpfr : : <build>no ]
+ : $(source:B)_mpfr_30 ;
+
+ compile $(source) gmp
+ : # requirements
+ <define>TEST_MPF_50
+ [ check-target-builds ../config//has_gmp : : <build>no ]
+ : $(source:B)_mpf50 ;
+
+ compile $(source)
+ : # requirements
+ <define>TEST_CPP_DEC_FLOAT
+ : $(source:B)_cpp_dec_float ;
+
+ compile $(source)
+ : # requirements
+ <define>TEST_CPP_DEC_FLOAT_NO_ET
+ : $(source:B)_cpp_dec_float_no_et ;
+
+ compile $(source)
+ : # requirements
+ <define>TEST_BACKEND
+ : $(source:B)_backend_concept ;
+ }
}
Added: sandbox/big_number/libs/multiprecision/test/concepts/mp_number_concept_check.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/mp_number_concept_check.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,223 @@
+// Copyright John Maddock 2011.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/concepts/real_type_concept.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T t = 1;
+ t = abs(t);
+ t = abs(t*t);
+
+ t = fabs(t);
+ t = fabs(t*t);
+
+ t = sqrt(t);
+ t = sqrt(t*t);
+
+ t = floor(t);
+ t = floor(t*t);
+
+ t = ceil(t);
+ t = ceil(t*t);
+
+ t = trunc(t);
+ t = trunc(t*t);
+
+ t = round(t);
+ t = round(t*t);
+
+ t = exp(t);
+ t = exp(t*t);
+
+ t = log(t);
+ t = log(t*t);
+
+ t = log10(t);
+ t = log10(t*t);
+
+ t = cos(t);
+ t = cos(t*t);
+
+ t = sin(t);
+ t = sin(t*t);
+
+ t = tan(t);
+ t = tan(t*t);
+
+ t = asin(t);
+ t = asin(t*t);
+
+ t = atan(t);
+ t = atan(t*t);
+
+ t = acos(t);
+ t = acos(t*t);
+
+ t = cosh(t);
+ t = cosh(t*t);
+
+ t = sinh(t);
+ t = sinh(t*t);
+
+ t = tanh(t);
+ t = tanh(t*t);
+
+ double dval = 2;
+ t = pow(t, t);
+ t = pow(t, t*t);
+ t = pow(t, dval);
+ t = pow(t*t, t);
+ t = pow(t*t, t*t);
+ t = pow(t*t, dval);
+ t = pow(dval, t);
+ t = pow(dval, t*t);
+
+ t = atan2(t, t);
+ t = atan2(t, t*t);
+ t = atan2(t, dval);
+ t = atan2(t*t, t);
+ t = atan2(t*t, t*t);
+ t = atan2(t*t, dval);
+ t = atan2(dval, t);
+ t = atan2(dval, t*t);
+
+ t = fmod(t, t);
+ t = fmod(t, t*t);
+ t = fmod(t, dval);
+ t = fmod(t*t, t);
+ t = fmod(t*t, t*t);
+ t = fmod(t*t, dval);
+ t = fmod(dval, t);
+ t = fmod(dval, t*t);
+
+ typedef typename T::backend_type backend_type;
+ typedef typename backend_type::exponent_type exp_type;
+ exp_type e = 0;
+ int i = 0;
+
+ t = ldexp(t, i);
+ t = ldexp(t*t, i);
+ t = ldexp(t, e);
+ t = ldexp(t*t, e);
+
+ t = frexp(t, &i);
+ t = frexp(t*t, &i);
+ t = frexp(t, &e);
+ t = frexp(t*t, &e);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+#ifdef TEST_BACKEND
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::concepts::mp_number_float_architype>));
+#endif
+#ifdef TEST_MPF_50
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpf_float_50>));
+#endif
+#ifdef TEST_MPFR_50
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpfr_float_50>));
+#endif
+#ifdef TEST_MPFR_6
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> > >));
+#endif
+#ifdef TEST_MPFR_15
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> > >));
+#endif
+#ifdef TEST_MPFR_17
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> > >));
+#endif
+#ifdef TEST_MPFR_30
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> > >));
+#endif
+#ifdef TEST_MPFR_50
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpfr_float_50>));
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::cpp_dec_float_50>));
+#endif
+
+}
Added: sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_basic.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,149 @@
+// Copyright John Maddock 2012.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements when used with Boost.Math.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/special_functions.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T v1, v2, v3;
+ int i;
+ (boost::math::fpclassify)(v1);
+ (boost::math::isfinite)(v1);
+ (boost::math::isnormal)(v1);
+ (boost::math::isnan)(v1);
+ (boost::math::isinf)(v1);
+ (boost::math::signbit)(v1);
+ (boost::math::copysign)(v1, v2);
+ (boost::math::changesign)(v1);
+ (boost::math::sign)(v1);
+ boost::math::log1p(v1);
+ boost::math::expm1(v1);
+ boost::math::cbrt(v1);
+ boost::math::sqrt1pm1(v1);
+ boost::math::powm1(v1, v2);
+ boost::math::hypot(v1, v2);
+ boost::math::sinc_pi(v1);
+ boost::math::sinhc_pi(v1);
+ boost::math::asinh(v1);
+ boost::math::acosh(v1);
+ boost::math::atanh(v1);
+ boost::math::sin_pi(v1);
+ boost::math::cos_pi(v1);
+ 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);
+ boost::math::nextafter(v1, v1);
+ boost::math::float_next(v1);
+ boost::math::float_prior(v1);
+ boost::math::float_distance(v1, v1);
+ // Misc functions that don't fit elsewhere:
+ 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::owens_t(v1, v2);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+ foo();
+}
Added: sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_bessel.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,114 @@
+// Copyright John Maddock 2012.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements when used with Boost.Math.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/special_functions.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T v1, v2, v3;
+ int i(0);
+ boost::math::cyl_neumann(v1, v2);
+ boost::math::cyl_neumann(i, v2);
+ boost::math::cyl_bessel_j(v1, v2);
+ boost::math::cyl_bessel_j(i, v2);
+ boost::math::cyl_bessel_i(v1, v2);
+ boost::math::cyl_bessel_i(i, v2);
+ boost::math::cyl_bessel_k(v1, v2);
+ boost::math::cyl_bessel_k(i, v2);
+ boost::math::sph_bessel(i, v2);
+ boost::math::sph_bessel(i, 1);
+ boost::math::sph_neumann(i, v2);
+ boost::math::sph_neumann(i, i);
+ boost::math::airy_ai(v1);
+ boost::math::airy_bi(v1);
+ boost::math::airy_ai_prime(v1);
+ boost::math::airy_bi_prime(v1);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+ foo();
+}
Added: sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_elliptic.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,120 @@
+// Copyright John Maddock 2012.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements when used with Boost.Math.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/special_functions.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T v1, v2, v3;
+ boost::math::ellint_1(v1);
+ boost::math::ellint_1(v1, v2);
+ boost::math::ellint_2(v1);
+ boost::math::ellint_2(v1, v2);
+ boost::math::ellint_3(v1, v2);
+ boost::math::ellint_3(v1, v2, v3);
+ boost::math::ellint_rc(v1, v2);
+ boost::math::ellint_rd(v1, v2, v3);
+ boost::math::ellint_rf(v1, v2, v3);
+ boost::math::ellint_rj(v1, v2, v3, v1);
+ boost::math::jacobi_elliptic(v1, v2, &v1, &v2);
+ boost::math::jacobi_cd(v1, v2);
+ boost::math::jacobi_cn(v1, v2);
+ boost::math::jacobi_cs(v1, v2);
+ boost::math::jacobi_dc(v1, v2);
+ boost::math::jacobi_dn(v1, v2);
+ boost::math::jacobi_ds(v1, v2);
+ boost::math::jacobi_nc(v1, v2);
+ boost::math::jacobi_nd(v1, v2);
+ boost::math::jacobi_ns(v1, v2);
+ boost::math::jacobi_sc(v1, v2);
+ boost::math::jacobi_sd(v1, v2);
+ boost::math::jacobi_sn(v1, v2);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+ foo();
+}
Added: sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,136 @@
+// Copyright John Maddock 2012.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements when used with Boost.Math.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/special_functions.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T v1, v2, v3;
+ int i;
+ boost::math::tgamma(v1);
+ boost::math::tgamma1pm1(v1);
+ boost::math::lgamma(v1);
+ boost::math::lgamma(v1, &i);
+ boost::math::digamma(v1);
+ boost::math::tgamma_ratio(v1, v2);
+ boost::math::tgamma_delta_ratio(v1, v2);
+ boost::math::factorial<T>(i);
+ boost::math::unchecked_factorial<T>(i);
+ i = boost::math::max_factorial<T>::value;
+ boost::math::double_factorial<T>(i);
+ boost::math::rising_factorial(v1, i);
+ boost::math::falling_factorial(v1, i);
+ boost::math::tgamma(v1, v2);
+ boost::math::tgamma_lower(v1, v2);
+ boost::math::gamma_p(v1, v2);
+ boost::math::gamma_q(v1, v2);
+ boost::math::gamma_p_inv(v1, v2);
+ boost::math::gamma_q_inv(v1, v2);
+ boost::math::gamma_p_inva(v1, v2);
+ boost::math::gamma_q_inva(v1, v2);
+ boost::math::erf(v1);
+ boost::math::erfc(v1);
+ boost::math::erf_inv(v1);
+ boost::math::erfc_inv(v1);
+ boost::math::beta(v1, v2);
+ boost::math::beta(v1, v2, v3);
+ boost::math::betac(v1, v2, v3);
+ boost::math::ibeta(v1, v2, v3);
+ boost::math::ibetac(v1, v2, v3);
+ boost::math::ibeta_inv(v1, v2, v3);
+ boost::math::ibetac_inv(v1, v2, v3);
+ boost::math::ibeta_inva(v1, v2, v3);
+ boost::math::ibetac_inva(v1, v2, v3);
+ boost::math::ibeta_invb(v1, v2, v3);
+ boost::math::ibetac_invb(v1, v2, v3);
+ boost::math::gamma_p_derivative(v2, v3);
+ boost::math::ibeta_derivative(v1, v2, v3);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+ foo();
+}
Added: sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/concepts/sf_concept_check_poly.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,111 @@
+// Copyright John Maddock 2012.
+// 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)
+
+//
+// This tests that cpp_dec_float_50 meets our
+// conceptual requirements when used with Boost.Math.
+//
+#ifdef _MSC_VER
+# define _SCL_SECURE_NO_WARNINGS
+# pragma warning(disable:4800)
+# pragma warning(disable:4512)
+# pragma warning(disable:4127)
+# pragma warning(disable:4512)
+# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
+#endif
+
+#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
+ && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
+ && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
+# define TEST_MPF_50
+# define TEST_BACKEND
+# define TEST_MPZ
+# define TEST_MPFR_50
+# define TEST_MPFR_6
+# define TEST_MPFR_15
+# define TEST_MPFR_17
+# define TEST_MPFR_30
+# define TEST_CPP_DEC_FLOAT
+# define TEST_CPP_DEC_FLOAT_NO_ET
+
+#ifdef _MSC_VER
+#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
+#endif
+#ifdef __GNUC__
+#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
+#endif
+
+#endif
+
+#if defined(TEST_MPF_50) || defined(TEST_MPZ)
+#include <boost/multiprecision/gmp.hpp>
+#endif
+#ifdef TEST_BACKEND
+#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
+#endif
+#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#endif
+#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
+#include <boost/multiprecision/mpfr.hpp>
+#endif
+
+#include <boost/math/special_functions.hpp>
+
+template <class T>
+void test_extra(T)
+{
+ T v1, v2, v3;
+ boost::math::legendre_p(1, v1);
+ boost::math::legendre_p(1, 0, v1);
+ boost::math::legendre_q(1, v1);
+ boost::math::legendre_next(2, v1, v2, v3);
+ boost::math::legendre_next(2, 2, v1, v2, v3);
+ boost::math::laguerre(1, v1);
+ boost::math::laguerre(2, 1, v1);
+ boost::math::laguerre(2u, 1u, v1);
+ boost::math::laguerre_next(2, v1, v2, v3);
+ boost::math::laguerre_next(2, 1, v1, v2, v3);
+ boost::math::hermite(1, v1);
+ boost::math::hermite_next(2, v1, v2, v3);
+ boost::math::spherical_harmonic_r(2, 1, v1, v2);
+ boost::math::spherical_harmonic_i(2, 1, v1, v2);
+}
+
+void foo()
+{
+#ifdef TEST_BACKEND
+ test_extra(boost::multiprecision::concepts::mp_number_float_architype());
+#endif
+#ifdef TEST_MPF_50
+ test_extra(boost::multiprecision::mpf_float_50());
+#endif
+#ifdef TEST_MPFR_50
+ test_extra(boost::multiprecision::mpfr_float_50());
+#endif
+#ifdef TEST_MPFR_6
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
+#endif
+#ifdef TEST_MPFR_15
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
+#endif
+#ifdef TEST_MPFR_17
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
+#endif
+#ifdef TEST_MPFR_30
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT
+ test_extra(boost::multiprecision::cpp_dec_float_50());
+#endif
+#ifdef TEST_CPP_DEC_FLOAT_NO_ET
+ test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
+#endif
+}
+
+int main()
+{
+ foo();
+}
Deleted: sandbox/big_number/libs/multiprecision/test/mp_number_concept_check.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/mp_number_concept_check.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
+++ (empty file)
@@ -1,237 +0,0 @@
-// Copyright John Maddock 2011.
-// 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)
-
-//
-// This tests two things: that cpp_dec_float_50 meets our
-// conceptual requirements, and that we can instantiate
-// all our distributions and special functions on this type.
-//
-#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
-#define BOOST_MATH_INSTANTIATE_MINIMUM
-
-#ifdef _MSC_VER
-# define _SCL_SECURE_NO_WARNINGS
-# pragma warning(disable:4800)
-# pragma warning(disable:4512)
-# pragma warning(disable:4127)
-# pragma warning(disable:4512)
-# pragma warning(disable:4503) // decorated name length exceeded, name was truncated
-#endif
-
-#if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
- && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
- && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET)
-# define TEST_MPF_50
-# define TEST_BACKEND
-# define TEST_MPZ
-# define TEST_MPFR_50
-# define TEST_MPFR_6
-# define TEST_MPFR_15
-# define TEST_MPFR_17
-# define TEST_MPFR_30
-# define TEST_CPP_DEC_FLOAT
-# define TEST_CPP_DEC_FLOAT_NO_ET
-
-#ifdef _MSC_VER
-#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
-#endif
-#ifdef __GNUC__
-#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
-#endif
-
-#endif
-
-#if defined(TEST_MPF_50) || defined(TEST_MPZ)
-#include <boost/multiprecision/gmp.hpp>
-#endif
-#ifdef TEST_BACKEND
-#include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
-#endif
-#if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET)
-#include <boost/multiprecision/cpp_dec_float.hpp>
-#endif
-#if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
-#include <boost/multiprecision/mpfr.hpp>
-#endif
-
-#include <boost/math/concepts/real_type_concept.hpp>
-#include "libs/math/test/compile_test/instantiate.hpp"
-
-template <class T>
-void test_extra(T)
-{
- T t = 1;
- t = abs(t);
- t = abs(t*t);
-
- t = fabs(t);
- t = fabs(t*t);
-
- t = sqrt(t);
- t = sqrt(t*t);
-
- t = floor(t);
- t = floor(t*t);
-
- t = ceil(t);
- t = ceil(t*t);
-
- t = trunc(t);
- t = trunc(t*t);
-
- t = round(t);
- t = round(t*t);
-
- t = exp(t);
- t = exp(t*t);
-
- t = log(t);
- t = log(t*t);
-
- t = log10(t);
- t = log10(t*t);
-
- t = cos(t);
- t = cos(t*t);
-
- t = sin(t);
- t = sin(t*t);
-
- t = tan(t);
- t = tan(t*t);
-
- t = asin(t);
- t = asin(t*t);
-
- t = atan(t);
- t = atan(t*t);
-
- t = acos(t);
- t = acos(t*t);
-
- t = cosh(t);
- t = cosh(t*t);
-
- t = sinh(t);
- t = sinh(t*t);
-
- t = tanh(t);
- t = tanh(t*t);
-
- double dval = 2;
- t = pow(t, t);
- t = pow(t, t*t);
- t = pow(t, dval);
- t = pow(t*t, t);
- t = pow(t*t, t*t);
- t = pow(t*t, dval);
- t = pow(dval, t);
- t = pow(dval, t*t);
-
- t = atan2(t, t);
- t = atan2(t, t*t);
- t = atan2(t, dval);
- t = atan2(t*t, t);
- t = atan2(t*t, t*t);
- t = atan2(t*t, dval);
- t = atan2(dval, t);
- t = atan2(dval, t*t);
-
- t = fmod(t, t);
- t = fmod(t, t*t);
- t = fmod(t, dval);
- t = fmod(t*t, t);
- t = fmod(t*t, t*t);
- t = fmod(t*t, dval);
- t = fmod(dval, t);
- t = fmod(dval, t*t);
-
- typedef typename T::backend_type backend_type;
- typedef typename backend_type::exponent_type exp_type;
- exp_type e = 0;
- int i = 0;
-
- t = ldexp(t, i);
- t = ldexp(t*t, i);
- t = ldexp(t, e);
- t = ldexp(t*t, e);
-
- t = frexp(t, &i);
- t = frexp(t*t, &i);
- t = frexp(t, &e);
- t = frexp(t*t, &e);
-}
-
-void foo()
-{
-#ifdef TEST_BACKEND
- instantiate(boost::multiprecision::concepts::mp_number_float_architype());
- test_extra(boost::multiprecision::concepts::mp_number_float_architype());
-#endif
-#ifdef TEST_MPF_50
- instantiate(boost::multiprecision::mpf_float_50());
- test_extra(boost::multiprecision::mpf_float_50());
-#endif
-#ifdef TEST_MPFR_50
- instantiate(boost::multiprecision::mpfr_float_50());
- test_extra(boost::multiprecision::mpfr_float_50());
-#endif
-#ifdef TEST_MPFR_6
- instantiate(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
- test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> >());
-#endif
-#ifdef TEST_MPFR_15
- instantiate(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
- test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> >());
-#endif
-#ifdef TEST_MPFR_17
- instantiate(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
- test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> >());
-#endif
-#ifdef TEST_MPFR_30
- instantiate(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
- test_extra(boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> >());
-#endif
-#ifdef TEST_CPP_DEC_FLOAT
- instantiate(boost::multiprecision::cpp_dec_float_50());
- test_extra(boost::multiprecision::cpp_dec_float_50());
-#endif
-#ifdef TEST_CPP_DEC_FLOAT_NO_ET
- instantiate(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
- test_extra(boost::multiprecision::mp_number<boost::multiprecision::cpp_dec_float<100>, false>());
-#endif
-}
-
-int main()
-{
-#ifdef TEST_BACKEND
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::concepts::mp_number_float_architype>));
-#endif
-#ifdef TEST_MPF_50
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpf_float_50>));
-#endif
-#ifdef TEST_MPFR_50
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpfr_float_50>));
-#endif
-#ifdef TEST_MPFR_6
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<6> > >));
-#endif
-#ifdef TEST_MPFR_15
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<15> > >));
-#endif
-#ifdef TEST_MPFR_17
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<17> > >));
-#endif
-#ifdef TEST_MPFR_30
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mp_number<boost::multiprecision::mpfr_float_backend<30> > >));
-#endif
-#ifdef TEST_MPFR_50
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::mpfr_float_50>));
-#endif
-#ifdef TEST_CPP_DEC_FLOAT
- BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept<boost::multiprecision::cpp_dec_float_50>));
-#endif
-
-}
Added: sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp 2012-07-24 14:03:54 EDT (Tue, 24 Jul 2012)
@@ -0,0 +1,39 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright 2012 John Maddock. Distributed under 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)
+
+#include <boost/multiprecision/cpp_int.hpp>
+
+#ifndef BOOST_NO_CONSTEXPR
+
+template <class T>
+void test1()
+{
+ constexpr T i1 = 2u;
+ constexpr T i2;
+ constexpr T i3 = -3;
+ constexpr T i4(i1);
+}
+template <class T>
+void test2()
+{
+ constexpr T i1 = 2u;
+ constexpr T i2;
+ constexpr T i3 = -3;
+}
+template <class T>
+void test3()
+{
+ constexpr T i1 = 2u;
+ constexpr T i2;
+}
+
+using namespace boost::multiprecision;
+
+template void test1<mp_number<backends::cpp_int_backend<64, false, void, true>, false> >();
+template void test1<mp_number<backends::cpp_int_backend<64, true, void, true>, false> >();
+template void test3<mp_number<backends::cpp_int_backend<2048, false, void>, false> >();
+template void test2<mp_number<backends::cpp_int_backend<2048, true, void>, false> >();
+
+#endif
\ No newline at end of file
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