2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Merged changes from Trunk.

[SVN r45478]
This commit is contained in:
John Maddock
2008-05-18 08:29:50 +00:00
parent f66efdf48f
commit 0aa1a09902
16 changed files with 42 additions and 25 deletions

View File

@@ -71,7 +71,7 @@ on error rates.
SVN Revisions:
Sandbox and trunk last synchonised at revision: 44695.
Sandbox and trunk last synchonised at revision: 45480.
]
[/
@@ -81,3 +81,4 @@ Sandbox and trunk last synchonised at revision: 44695.
http://www.boost.org/LICENSE_1_0.txt).
]

View File

@@ -66,7 +66,10 @@ public:
real_concept(int c) : m_value(c){}
real_concept(unsigned long c) : m_value(c){}
real_concept(long c) : m_value(c){}
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
#if defined(__DECCXX) || defined(__SUNPRO_CC)
real_concept(unsigned long long c) : m_value(static_cast<real_concept_base_type>(c)){}
real_concept(long long c) : m_value(static_cast<real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_LONG_LONG)
real_concept(unsigned long long c) : m_value(static_cast<real_concept_base_type>(c)){}
real_concept(long long c) : m_value(static_cast<real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_MS_INT64)

View File

@@ -58,7 +58,10 @@ public:
std_real_concept(int c) : m_value(c){}
std_real_concept(unsigned long c) : m_value(c){}
std_real_concept(long c) : m_value(c){}
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
#if defined(__DECCXX) || defined(__SUNPRO_CC)
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_LONG_LONG)
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
#endif
@@ -79,7 +82,10 @@ public:
std_real_concept& operator=(unsigned int c) { m_value = c; return *this; }
std_real_concept& operator=(long c) { m_value = c; return *this; }
std_real_concept& operator=(unsigned long c) { m_value = c; return *this; }
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
#if defined(__DECCXX) || defined(__SUNPRO_CC)
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
#elif defined(BOOST_HAS_LONG_LONG)
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
#endif

View File

@@ -16,6 +16,8 @@
#include <boost/math/special_functions.hpp>
#include <boost/math/concepts/distributions.hpp>
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
typedef boost::math::policies::policy<> test_policy;
namespace test{
@@ -29,6 +31,7 @@ namespace dist_test{
BOOST_MATH_DECLARE_DISTRIBUTIONS(double, test_policy)
}
#endif
namespace boost{ namespace math{
//
@@ -79,7 +82,7 @@ void instantiate(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> > >();
@@ -128,7 +131,7 @@ void instantiate(RealType)
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);
@@ -242,7 +245,7 @@ void instantiate(RealType)
#ifdef BOOST_HAS_LONG_LONG
boost::math::lltrunc(v1);
boost::math::llround(v1);
long long ll;
boost::long_long_type ll;
boost::math::modf(v1, &ll);
#endif
boost::math::pow<2>(v1);
@@ -502,7 +505,7 @@ void instantiate_mixed(RealType)
{
using namespace boost;
using namespace boost::math;
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
int i = 1;
long l = 1;
short s = 1;
@@ -851,7 +854,9 @@ void instantiate_mixed(RealType)
test::sph_bessel(i, 1);
test::sph_neumann(i, lr);
test::sph_neumann(i, i);
#endif
}
#endif // BOOST_LIBS_MATH_TEST_INSTANTIATE_HPP

View File

@@ -20,7 +20,7 @@ long double lldd;
int ii;
long ll;
#ifdef BOOST_HAS_LONG_LONG
long long llll;
boost::long_long_type llll;
#endif
void check()

View File

@@ -31,10 +31,10 @@ void check()
check_result<long>(boost::math::lround<long double>(l));
#endif
#ifdef BOOST_HAS_LONG_LONG
check_result<long long>(boost::math::llround<float>(f));
check_result<long long>(boost::math::llround<double>(d));
check_result<boost::long_long_type>(boost::math::llround<float>(f));
check_result<boost::long_long_type>(boost::math::llround<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
check_result<long long>(boost::math::llround<long double>(l));
check_result<boost::long_long_type>(boost::math::llround<long double>(l));
#endif
#endif
}

View File

@@ -31,10 +31,10 @@ void check()
check_result<long>(boost::math::ltrunc<long double>(l));
#endif
#ifdef BOOST_HAS_LONG_LONG
check_result<long long>(boost::math::lltrunc<float>(f));
check_result<long long>(boost::math::lltrunc<double>(d));
check_result<boost::long_long_type>(boost::math::lltrunc<float>(f));
check_result<boost::long_long_type>(boost::math::lltrunc<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
check_result<long long>(boost::math::lltrunc<long double>(l));
check_result<boost::long_long_type>(boost::math::lltrunc<long double>(l));
#endif
#endif
}

View File

@@ -24,7 +24,7 @@ inline void check_result_imp(long double, long double){}
inline void check_result_imp(int, int){}
inline void check_result_imp(long, long){}
#ifdef BOOST_HAS_LONG_LONG
inline void check_result_imp(long long, long long){}
inline void check_result_imp(boost::long_long_type, boost::long_long_type){}
#endif
inline void check_result_imp(bool, bool){}

View File

@@ -109,7 +109,7 @@ void test_return_types()
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0l)), long double>::value));
#endif
};
}
namespace boost { namespace math { namespace policies {

View File

@@ -6,5 +6,5 @@
#include "test_rational.hpp"
#ifdef BOOST_HAS_LONG_LONG
template void do_test_spots<double, unsigned long long>(double, unsigned long long);
template void do_test_spots<double, boost::ulong_long_type>(double, boost::ulong_long_type);
#endif

View File

@@ -7,5 +7,5 @@
#include "test_rational.hpp"
#ifdef BOOST_HAS_LONG_LONG
template void do_test_spots<float, unsigned long long>(float, unsigned long long);
template void do_test_spots<float, boost::ulong_long_type>(float, boost::ulong_long_type);
#endif

View File

@@ -7,5 +7,5 @@
#include "test_rational.hpp"
#ifdef BOOST_HAS_LONG_LONG
template void do_test_spots<long double, unsigned long long>(long double, unsigned long long);
template void do_test_spots<long double, boost::ulong_long_type>(long double, boost::ulong_long_type);
#endif

View File

@@ -11,6 +11,6 @@
#include <boost/math/concepts/real_concept.hpp>
#ifdef BOOST_HAS_LONG_LONG
template void do_test_spots<boost::math::concepts::real_concept, unsigned long long>(boost::math::concepts::real_concept, unsigned long long);
template void do_test_spots<boost::math::concepts::real_concept, boost::ulong_long_type>(boost::math::concepts::real_concept, boost::ulong_long_type);
#endif
#endif

View File

@@ -20,7 +20,7 @@ void test_spots(T t, const char* n)
do_test_spots(t, int(0));
do_test_spots(t, unsigned(0));
#ifdef BOOST_HAS_LONG_LONG
do_test_spots(t, (unsigned long long)(0));
do_test_spots(t, (boost::ulong_long_type)(0));
#endif
do_test_spots(t, float(0));
do_test_spots(t, T(0));

View File

@@ -141,9 +141,9 @@ void test_round(T, const char* name)
}
#ifdef BOOST_HAS_LONG_LONG
if(abs(r) < (std::numeric_limits<long long>::max)())
if(abs(r) < (std::numeric_limits<boost::long_long_type>::max)())
{
long long ll = boost::math::llround(arg);
boost::long_long_type ll = boost::math::llround(arg);
check_within_half(arg, ll);
ll = boost::math::lltrunc(arg);
check_trunc_result(arg, ll);

View File

@@ -14,8 +14,10 @@
// as that would lead to recursive project dependencies...
//
#include "../test/compile_test/instantiate.hpp"
#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
#define BOOST_MATH_INSTANTIATE_MINIMUM
#include <boost/math/concepts/real_concept.hpp>
#include "../test/compile_test/instantiate.hpp"
void some_proc()
{