Changeset 44695


Ignore:
Timestamp:
Apr 21, 2008, 1:04:30 PM (10 years ago)
Author:
John Maddock
Message:

Merged patches from Trunk.

Location:
sandbox/math_toolkit
Files:
23 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sandbox/math_toolkit/boost/math/concepts/real_concept.hpp

    r44090 r44695  
    2828#include <boost/math/tools/precision.hpp>
    2929#include <boost/math/policies/policy.hpp>
     30#if defined(__SGI_STL_PORT)
     31#  include <boost/math/tools/real_cast.hpp>
     32#endif
    3033#include <ostream>
    3134#include <istream>
     
    234237inline real_concept tanh(real_concept a)
    235238{ return std::tanh(a.value()); }
     239
     240//
     241// Conversion and truncation routines:
     242//
     243template <class Policy>
     244inline int iround(const concepts::real_concept& v, const Policy& pol)
     245{ return boost::math::iround(v.value(), pol); }
     246inline int iround(const concepts::real_concept& v)
     247{ return boost::math::iround(v.value(), policies::policy<>()); }
     248template <class Policy>
     249inline long lround(const concepts::real_concept& v, const Policy& pol)
     250{ return boost::math::lround(v.value(), pol); }
     251inline long lround(const concepts::real_concept& v)
     252{ return boost::math::lround(v.value(), policies::policy<>()); }
     253
     254#ifdef BOOST_HAS_LONG_LONG
     255template <class Policy>
     256inline long long llround(const concepts::real_concept& v, const Policy& pol)
     257{ return boost::math::llround(v.value(), pol); }
     258inline long long llround(const concepts::real_concept& v)
     259{ return boost::math::llround(v.value(), policies::policy<>()); }
     260#endif
     261
     262template <class Policy>
     263inline int itrunc(const concepts::real_concept& v, const Policy& pol)
     264{ return boost::math::itrunc(v.value(), pol); }
     265inline int itrunc(const concepts::real_concept& v)
     266{ return boost::math::itrunc(v.value(), policies::policy<>()); }
     267template <class Policy>
     268inline long ltrunc(const concepts::real_concept& v, const Policy& pol)
     269{ return boost::math::ltrunc(v.value(), pol); }
     270inline long ltrunc(const concepts::real_concept& v)
     271{ return boost::math::ltrunc(v.value(), policies::policy<>()); }
     272
     273#ifdef BOOST_HAS_LONG_LONG
     274template <class Policy>
     275inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
     276{ return boost::math::lltrunc(v.value(), pol); }
     277inline long long lltrunc(const concepts::real_concept& v)
     278{ return boost::math::lltrunc(v.value(), policies::policy<>()); }
     279#endif
    236280
    237281// Streaming:
     
    322366} // namespace tools
    323367
    324 //
    325 // Conversion and truncation routines:
    326 //
    327 template <class Policy>
    328 inline int iround(const concepts::real_concept& v, const Policy& pol)
    329 {
    330    return iround(v.value(), pol);
    331 }
    332 inline int iround(const concepts::real_concept& v)
    333 {
    334    return iround(v.value(), policies::policy<>());
    335 }
    336 
    337 template <class Policy>
    338 inline long lround(const concepts::real_concept& v, const Policy& pol)
    339 {
    340    return lround(v.value(), pol);
    341 }
    342 inline long lround(const concepts::real_concept& v)
    343 {
    344    return lround(v.value(), policies::policy<>());
    345 }
    346 
    347 #ifdef BOOST_HAS_LONG_LONG
    348 
    349 template <class Policy>
    350 inline long long llround(const concepts::real_concept& v, const Policy& pol)
    351 {
    352    return llround(v.value(), pol);
    353 }
    354 inline long long llround(const concepts::real_concept& v)
    355 {
    356    return llround(v.value(), policies::policy<>());
    357 }
    358 
    359 #endif
    360 
    361 template <class Policy>
    362 inline int itrunc(const concepts::real_concept& v, const Policy& pol)
    363 {
    364    return itrunc(v.value(), pol);
    365 }
    366 inline int itrunc(const concepts::real_concept& v)
    367 {
    368    return itrunc(v.value(), policies::policy<>());
    369 }
    370 
    371 template <class Policy>
    372 inline long ltrunc(const concepts::real_concept& v, const Policy& pol)
    373 {
    374    return ltrunc(v.value(), pol);
    375 }
    376 inline long ltrunc(const concepts::real_concept& v)
    377 {
    378    return ltrunc(v.value(), policies::policy<>());
    379 }
    380 
    381 #ifdef BOOST_HAS_LONG_LONG
    382 
    383 template <class Policy>
    384 inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
    385 {
    386    return lltrunc(v.value(), pol);
    387 }
    388 inline long long lltrunc(const concepts::real_concept& v)
    389 {
    390    return lltrunc(v.value(), policies::policy<>());
    391 }
     368#if defined(__SGI_STL_PORT)
     369//
     370// We shouldn't really need these type casts any more, but there are some
     371// STLport iostream bugs we work around by using them....
     372//
     373namespace tools
     374{
     375// real_cast converts from T to integer and narrower floating-point types.
     376
     377// Convert from T to integer types.
     378
     379template <>
     380inline unsigned int real_cast<unsigned int, concepts::real_concept>(concepts::real_concept r)
     381{
     382   return static_cast<unsigned int>(r.value());
     383}
     384
     385template <>
     386inline int real_cast<int, concepts::real_concept>(concepts::real_concept r)
     387{
     388   return static_cast<int>(r.value());
     389}
     390
     391template <>
     392inline long real_cast<long, concepts::real_concept>(concepts::real_concept r)
     393{
     394   return static_cast<long>(r.value());
     395}
     396
     397// Converts from T to narrower floating-point types, float, double & long double.
     398
     399template <>
     400inline float real_cast<float, concepts::real_concept>(concepts::real_concept r)
     401{
     402   return static_cast<float>(r.value());
     403}
     404template <>
     405inline double real_cast<double, concepts::real_concept>(concepts::real_concept r)
     406{
     407   return static_cast<double>(r.value());
     408}
     409template <>
     410inline long double real_cast<long double, concepts::real_concept>(concepts::real_concept r)
     411{
     412   return r.value();
     413}
     414
     415} // STLPort
    392416
    393417#endif
  • sandbox/math_toolkit/boost/math/concepts/std_real_concept.hpp

    r44090 r44695  
    224224namespace boost{ namespace math{ namespace concepts{
    225225
     226//
     227// Conversion and truncation routines:
     228//
     229template <class Policy>
     230inline int iround(const concepts::std_real_concept& v, const Policy& pol)
     231{
     232   return boost::math::iround(v.value(), pol);
     233}
     234inline int iround(const concepts::std_real_concept& v)
     235{
     236   return boost::math::iround(v.value(), policies::policy<>());
     237}
     238
     239template <class Policy>
     240inline long lround(const concepts::std_real_concept& v, const Policy& pol)
     241{
     242   return boost::math::lround(v.value(), pol);
     243}
     244inline long lround(const concepts::std_real_concept& v)
     245{
     246   return boost::math::lround(v.value(), policies::policy<>());
     247}
     248
     249#ifdef BOOST_HAS_LONG_LONG
     250
     251template <class Policy>
     252inline long long llround(const concepts::std_real_concept& v, const Policy& pol)
     253{
     254   return boost::math::llround(v.value(), pol);
     255}
     256inline long long llround(const concepts::std_real_concept& v)
     257{
     258   return boost::math::llround(v.value(), policies::policy<>());
     259}
     260
     261#endif
     262
     263template <class Policy>
     264inline int itrunc(const concepts::std_real_concept& v, const Policy& pol)
     265{
     266   return boost::math::itrunc(v.value(), pol);
     267}
     268inline int itrunc(const concepts::std_real_concept& v)
     269{
     270   return boost::math::itrunc(v.value(), policies::policy<>());
     271}
     272
     273template <class Policy>
     274inline long ltrunc(const concepts::std_real_concept& v, const Policy& pol)
     275{
     276   return boost::math::ltrunc(v.value(), pol);
     277}
     278inline long ltrunc(const concepts::std_real_concept& v)
     279{
     280   return boost::math::ltrunc(v.value(), policies::policy<>());
     281}
     282
     283#ifdef BOOST_HAS_LONG_LONG
     284
     285template <class Policy>
     286inline long long lltrunc(const concepts::std_real_concept& v, const Policy& pol)
     287{
     288   return boost::math::lltrunc(v.value(), pol);
     289}
     290inline long long lltrunc(const concepts::std_real_concept& v)
     291{
     292   return boost::math::lltrunc(v.value(), policies::policy<>());
     293}
     294
     295#endif
     296
    226297// Streaming:
    227298template <class charT, class traits>
     
    283354} // namespace tools
    284355
    285 //
    286 // Conversion and truncation routines:
    287 //
    288 template <class Policy>
    289 inline int iround(const concepts::std_real_concept& v, const Policy& pol)
    290 {
    291    return iround(v.value(), pol);
    292 }
    293 inline int iround(const concepts::std_real_concept& v)
    294 {
    295    return iround(v.value(), policies::policy<>());
    296 }
    297 
    298 template <class Policy>
    299 inline long lround(const concepts::std_real_concept& v, const Policy& pol)
    300 {
    301    return lround(v.value(), pol);
    302 }
    303 inline long lround(const concepts::std_real_concept& v)
    304 {
    305    return lround(v.value(), policies::policy<>());
    306 }
    307 
    308 #ifdef BOOST_HAS_LONG_LONG
    309 
    310 template <class Policy>
    311 inline long long llround(const concepts::std_real_concept& v, const Policy& pol)
    312 {
    313    return llround(v.value(), pol);
    314 }
    315 inline long long llround(const concepts::std_real_concept& v)
    316 {
    317    return llround(v.value(), policies::policy<>());
    318 }
    319 
    320 #endif
    321 
    322 template <class Policy>
    323 inline int itrunc(const concepts::std_real_concept& v, const Policy& pol)
    324 {
    325    return itrunc(v.value(), pol);
    326 }
    327 inline int itrunc(const concepts::std_real_concept& v)
    328 {
    329    return itrunc(v.value(), policies::policy<>());
    330 }
    331 
    332 template <class Policy>
    333 inline long ltrunc(const concepts::std_real_concept& v, const Policy& pol)
    334 {
    335    return ltrunc(v.value(), pol);
    336 }
    337 inline long ltrunc(const concepts::std_real_concept& v)
    338 {
    339    return ltrunc(v.value(), policies::policy<>());
    340 }
    341 
    342 #ifdef BOOST_HAS_LONG_LONG
    343 
    344 template <class Policy>
    345 inline long long lltrunc(const concepts::std_real_concept& v, const Policy& pol)
    346 {
    347    return lltrunc(v.value(), pol);
    348 }
    349 inline long long lltrunc(const concepts::std_real_concept& v)
    350 {
    351    return lltrunc(v.value(), policies::policy<>());
    352 }
    353 
    354 #endif
    355 
    356356} // namespace math
    357357} // namespace boost
  • sandbox/math_toolkit/boost/math/distributions/fwd.hpp

    r43401 r44695  
    4444template <class RealType, class Policy>
    4545class negative_binomial_distribution;
     46
     47template <class RealType, class Policy>
     48class non_central_chi_squared_distribution;
     49
     50template <class RealType, class Policy>
     51class non_central_beta_distribution;
     52
     53template <class RealType, class Policy>
     54class non_central_f_distribution;
     55
     56template <class RealType, class Policy>
     57class non_central_t_distribution;
    4658
    4759template <class RealType, class Policy>
  • sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp

    r42920 r44695  
    1111#endif
    1212
     13#include <boost/math/special_functions/round.hpp>
    1314#include <boost/math/special_functions/gamma.hpp>
    1415#include <boost/math/special_functions/sin_pi.hpp>
  • sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp

    r44090 r44695  
    7474   return isnan(t);
    7575#else // BOOST_HAS_FPCLASSIFY
    76    return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == FP_NAN);
     76   return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN);
    7777#endif
    7878}
     
    201201{
    202202   int t = (::boost::math::fpclassify)(z);
    203    return (t != FP_NAN) && (t != FP_INFINITE);
     203   return (t != (int)FP_NAN) && (t != (int)FP_INFINITE);
    204204}
    205205
     
    207207inline bool isinf BOOST_NO_MACRO_EXPAND(T t)
    208208{
    209    return (::boost::math::fpclassify)(t) == FP_INFINITE;
     209   return (::boost::math::fpclassify)(t) == (int)FP_INFINITE;
    210210}
    211211
     
    213213inline bool isnan BOOST_NO_MACRO_EXPAND(T t)
    214214{
    215    return (::boost::math::fpclassify)(t) == FP_NAN;
     215   return (::boost::math::fpclassify)(t) == (int)FP_NAN;
    216216}
    217217#ifdef isnan
     
    233233inline bool isnormal BOOST_NO_MACRO_EXPAND(T t)
    234234{
    235    return (::boost::math::fpclassify)(t) == FP_NORMAL;
     235   return (::boost::math::fpclassify)(t) == (int)FP_NORMAL;
    236236}
    237237
  • sandbox/math_toolkit/boost/math/special_functions/gamma.hpp

    r42920 r44695  
    153153      if(result == 0)
    154154         return policies::raise_underflow_error<T>(function, "Result of tgamma is too small to represent.", pol);
    155       if((boost::math::fpclassify)(result) == FP_SUBNORMAL)
     155      if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL)
    156156         return policies::raise_denorm_error<T>(function, "Result of tgamma is denormalized.", result, pol);
    157157      return result;
     
    353353      if(result == 0)
    354354         return policies::raise_underflow_error<T>(function, "Result of tgamma is too small to represent.", pol);
    355       if((boost::math::fpclassify)(result) == FP_SUBNORMAL)
     355      if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL)
    356356         return policies::raise_denorm_error<T>(function, "Result of tgamma is denormalized.", result, pol);
    357357      return result;
     
    585585   // rather than before it...
    586586   //
    587    if((boost::math::fpclassify)(prefix) == FP_INFINITE)
     587   if((boost::math::fpclassify)(prefix) == (int)FP_INFINITE)
    588588      policies::raise_overflow_error<T>("boost::math::detail::full_igamma_prefix<%1%>(%1%, %1%)", "Result of incomplete gamma function is too large to represent.", pol);
    589589
  • sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp

    r44090 r44695  
    2424#endif
    2525
     26#include <boost/math/special_functions/detail/round_fwd.hpp>
    2627#include <boost/math/tools/promotion.hpp> // for argument promotion.
    2728#include <boost/math/policies/policy.hpp>
     
    664665   \
    665666   template <class T>\
    666    inline T modf(const T& v, long long* ipart){ return boost::math::modf(v, ipart, Policy()); }\
    667    \
    668    template <class T>\
    669    inline long long lltrunc(const T& v){ return boost::math::lltrunc(v, Policy()); }\
    670    \
    671    template <class T>\
    672    inline long long llround(const T& v){ return boost::math::llround(v, Policy()); }\
     667   inline T modf(const T& v, long long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
     668   \
     669   template <class T>\
     670   inline long long lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
     671   \
     672   template <class T>\
     673   inline long long llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
    673674
    674675#else
     
    975976   \
    976977   template <class T>\
    977    inline T round(const T& v){ return boost::math::round(v, Policy()); }\
    978    \
    979    template <class T>\
    980    inline int iround(const T& v){ return boost::math::iround(v, Policy()); }\
    981    \
    982    template <class T>\
    983    inline long lround(const T& v){ return boost::math::lround(v, Policy()); }\
    984    \
    985    template <class T>\
    986    inline T trunc(const T& v){ return boost::math::trunc(v, Policy()); }\
    987    \
    988    template <class T>\
    989    inline int itrunc(const T& v){ return boost::math::itrunc(v, Policy()); }\
    990    \
    991    template <class T>\
    992    inline long ltrunc(const T& v){ return boost::math::ltrunc(v, Policy()); }\
    993    \
    994    template <class T>\
    995    inline T modf(const T& v, T* ipart){ return boost::math::modf(v, ipart, Policy()); }\
    996    \
    997    template <class T>\
    998    inline T modf(const T& v, int* ipart){ return boost::math::modf(v, ipart, Policy()); }\
    999    \
    1000    template <class T>\
    1001    inline T modf(const T& v, long* ipart){ return boost::math::modf(v, ipart, Policy()); }\
     978   inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\
     979   \
     980   template <class T>\
     981   inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\
     982   \
     983   template <class T>\
     984   inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\
     985   \
     986   template <class T>\
     987   inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\
     988   \
     989   template <class T>\
     990   inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\
     991   \
     992   template <class T>\
     993   inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\
     994   \
     995   template <class T>\
     996   inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
     997   \
     998   template <class T>\
     999   inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
     1000   \
     1001   template <class T>\
     1002   inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
    10021003   \
    10031004   template <int N, class T>\
  • sandbox/math_toolkit/boost/math/tools/config.hpp

    r44090 r44695  
    2222
    2323#include <boost/math/tools/user.hpp>
     24#include <boost/math/special_functions/detail/round_fwd.hpp>
    2425
    2526#if defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__hppa)
     
    190191   using std::floor;\
    191192   using std::log10;\
    192    using std::sqrt;
     193   using std::sqrt;\
     194   using boost::math::round;\
     195   using boost::math::iround;\
     196   using boost::math::lround;\
     197   using boost::math::trunc;\
     198   using boost::math::itrunc;\
     199   using boost::math::ltrunc;\
     200   using boost::math::modf;
    193201
    194202
  • sandbox/math_toolkit/boost/math/tools/polynomial.hpp

    r42744 r44695  
    1717
    1818#include <vector>
     19#include <ostream>
     20#include <algorithm>
    1921
    2022namespace boost{ namespace math{ namespace tools{
  • sandbox/math_toolkit/libs/math/doc/sf_and_dist/roadmap.qbk

    r44092 r44695  
    7272SVN Revisions:
    7373
    74 Sandbox and trunk last synchonised at revision: 44092.
     74Sandbox and trunk last synchonised at revision: 44695.
    7575
    7676]
  • sandbox/math_toolkit/libs/math/test/Jamfile.v2

    r44090 r44695  
    1414      <toolset>darwin:<cxxflags>-Wno-missing-braces
    1515      <toolset>acc:<cxxflags>+W2068,2461,2236,4070,4069
    16       <toolset>intel:<cxxflags>-Qwd264,239
    17       <toolset>intel:<cxxflags>/nologo
    18       <toolset>intel-linux:<cxxflags>-wd239
    19       <toolset>intel:<linkflags>/nologo
     16      <toolset>intel:<cxxflags>-nologo
     17      <toolset>intel:<linkflags>-nologo
    2018      <toolset>msvc:<warnings>all
    2119      <toolset>msvc:<asynch-exceptions>on
  • sandbox/math_toolkit/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp

    r43529 r44695  
    77// #includes all the files that it needs to.
    88//
    9 #include <boost/math/distributions/non_central_beta.hpp>
    10 //
    11 // Note this header includes no other headers, this is
    12 // important if this test is to be meaningful:
    13 //
    14 #include "test_compile_result.hpp"
    15 
    16 void check()
    17 {
    18    TEST_DIST_FUNC(non_central_beta)
    19 }
     9// In order to pass our conceptual tests, we need to forward declare
     10// those functoins that the non-central beta (deliberately) doesn't
     11// implement.  These declarations have to appear *before* the
     12// non central beta is defined, otherwise two-phase lookup
     13// won't find them :-(
     14//
     15#include <boost/math/distributions/fwd.hpp>
    2016
    2117namespace boost{ namespace math{
     
    3834}}
    3935
     36#include <boost/math/distributions/non_central_beta.hpp>
     37//
     38// Note this header includes no other headers, this is
     39// important if this test is to be meaningful:
     40//
     41#include "test_compile_result.hpp"
     42
     43void check()
     44{
     45   TEST_DIST_FUNC(non_central_beta)
     46}
     47
    4048template class boost::math::non_central_beta_distribution<float, boost::math::policies::policy<> >;
    4149template class boost::math::non_central_beta_distribution<double, boost::math::policies::policy<> >;
  • sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp

    r44090 r44695  
    348348   boost::math::zeta(v1, pol);
    349349   boost::math::zeta(i, pol);
    350    boost::math::trunc(v1, pol);
    351    boost::math::itrunc(v1, pol);
    352    boost::math::ltrunc(v1, pol);
    353    boost::math::round(v1, pol);
    354    boost::math::iround(v1, pol);
    355    boost::math::lround(v1, pol);
    356    boost::math::modf(v1, &v1, pol);
    357    boost::math::modf(v1, &i, pol);
    358    boost::math::modf(v1, &l, pol);
     350   //
     351   // These next functions are intended to be found via ADL:
     352   //
     353   BOOST_MATH_STD_USING
     354   trunc(v1, pol);
     355   itrunc(v1, pol);
     356   ltrunc(v1, pol);
     357   round(v1, pol);
     358   iround(v1, pol);
     359   lround(v1, pol);
     360   modf(v1, &v1, pol);
     361   modf(v1, &i, pol);
     362   modf(v1, &l, pol);
    359363#ifdef BOOST_HAS_LONG_LONG
    360    boost::math::lltrunc(v1, pol);
    361    boost::math::llround(v1, pol);
    362    boost::math::modf(v1, &ll, pol);
     364   using boost::math::lltrunc;
     365   using boost::math::llround;
     366   lltrunc(v1, pol);
     367   llround(v1, pol);
     368   modf(v1, &ll, pol);
    363369#endif
    364370   boost::math::pow<2>(v1, pol);
  • sandbox/math_toolkit/libs/math/test/compile_test/sf_modf_incl_test.cpp

    r43529 r44695  
    4141   check_result<long double>(boost::math::modf(l, &ll));
    4242#endif
     43#ifdef BOOST_HAS_LONG_LONG
    4344   check_result<float>(boost::math::modf(f, &llll));
    4445   check_result<double>(boost::math::modf(d, &llll));
     
    4647   check_result<long double>(boost::math::modf(l, &llll));
    4748#endif
     49#endif
    4850}
  • sandbox/math_toolkit/libs/math/test/expinti_data.ipp

    r41958 r44695  
    11#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
    2    static const boost::array<boost::array<T, 2>, 337> expinti_data = {{
     2   static const boost::array<boost::array<T, 2>, 336> expinti_data = {{
    33      { SC_(-49.689971923828125), SC_(-0.5189914452467706181911213069148082266893e-23) },
    44      { SC_(-49.490234375), SC_(-0.6362401135264284153452455085506782750647e-23) },
     
    336336      { SC_(59.3475341796875), SC_(1019568455497745443792447.961272554810421) },
    337337      { SC_(59.574817657470703125), SC_(1274778904679711262832523.146694528881756) },
    338       { SC_(59.610748291015625), SC_(1320604762679106118330023.701104305685706) },
    339       { SC_(114.701263427734375), SC_(0.5733168299717727201285049464972941664115e48) }
     338      { SC_(59.610748291015625), SC_(1320604762679106118330023.701104305685706) }
    340339   }};
    341340#undef SC_
  • sandbox/math_toolkit/libs/math/test/handle_test_result.hpp

    r40161 r44695  
    1212#include <boost/regex.hpp>
    1313#include <boost/test/test_tools.hpp>
     14
     15#if defined(BOOST_INTEL)
     16#  pragma warning(disable:239)
     17#  pragma warning(disable:264)
     18#endif
    1419
    1520//
  • sandbox/math_toolkit/libs/math/test/pow_test.cpp

    r43800 r44695  
    107107    BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(6.0f)), float>::value));
    108108    BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0)), double>::value));
     109#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    109110    BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0l)), long double>::value));
     111#endif
    110112};
    111113
     
    158160    test_with_big_exponents<double, -1>();
    159161
     162#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    160163    cout << "Testing with long double precision bases and positive small exponents" << endl;
    161164    test_with_small_exponents<long double, 1>();
     
    177180    cout << "Testing with concepts::real_concept precision bases and negative big exponents" << endl;
    178181    test_with_big_exponents<concepts::real_concept, -1>();
     182#endif
    179183
    180184    test_return_types();
  • sandbox/math_toolkit/libs/math/test/test_expint.cpp

    r42744 r44695  
    6161#endif
    6262
     63   //
     64   // On MacOS X erfc has much higher error levels than
     65   // expected: given that the implementation is basically
     66   // just a rational function evaluation combined with
     67   // exponentiation, we conclude that exp and pow are less
     68   // accurate on this platform, especially when the result
     69   // is outside the range of a double.
     70   //
     71   add_expected_result(
     72      ".*",                          // compiler
     73      ".*",                          // stdlib
     74      "Mac OS",                      // platform
     75      "float|double|long double",    // test type(s)
     76      ".*E1.*",                      // test data group
     77      ".*", 30, 10);                   // test function
     78   add_expected_result(
     79      ".*",                          // compiler
     80      ".*",                          // stdlib
     81      "Mac OS",                      // platform
     82      "float|double|long double",    // test type(s)
     83      ".*Ei.*",                      // test data group
     84      ".*", 300, 200);                   // test function
     85   add_expected_result(
     86      ".*",                          // compiler
     87      ".*",                          // stdlib
     88      "Mac OS",                      // platform
     89      ".*",                          // test type(s)
     90      ".*",                          // test data group
     91      ".*", 40, 15);                   // test function
     92
    6393   add_expected_result(
    6494      ".*",                          // compiler
     
    132162
    133163   typedef value_type (*pg)(value_type, value_type);
     164#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
     165   pg funcp = expint_wrapper<value_type>;
     166#else
    134167   pg funcp = expint_wrapper;
     168#endif
    135169
    136170   boost::math::tools::test_result<value_type> result;
     
    173207
    174208   typedef value_type (*pg)(value_type);
     209#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
     210   pg funcp = boost::math::expint<value_type>;
     211#else
    175212   pg funcp = boost::math::expint;
     213#endif
    176214
    177215   boost::math::tools::test_result<value_type> result;
  • sandbox/math_toolkit/libs/math/test/test_nc_beta.cpp

    r43075 r44695  
    8181#endif
    8282
     83#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    8384   if(boost::math::tools::digits<long double>() == 64)
    8485   {
     
    112113         "[^|]*", 40000, 5500);            // test function
    113114   }
     115#endif
    114116   //
    115117   // Catch all cases come last:
  • sandbox/math_toolkit/libs/math/test/test_nc_chi_squared.cpp

    r43098 r44695  
    8181#endif
    8282
     83   add_expected_result(
     84      "[^|]*",                          // compiler
     85      "[^|]*",                          // stdlib
     86      "Mac OS",                          // platform
     87      largest_type,                     // test type(s)
     88      "[^|]*medium[^|]*",                   // test data group
     89      "[^|]*", 550, 100);                  // test function
    8390   //
    8491   // Catch all cases come last:
     
    97104      largest_type,                     // test type(s)
    98105      "[^|]*large[^|]*",                   // test data group
    99       "[^|]*", 15000, 3000);                  // test function
     106      "[^|]*", 17000, 3000);                  // test function
    100107
    101108   //
     
    313320   BOOST_CHECK_CLOSE(
    314321      mode(dist)
    315       , static_cast<RealType>(17.184201184730857030170788677340294070728990862663L), sqrt(tolerance * 10));
     322      , static_cast<RealType>(17.184201184730857030170788677340294070728990862663L), sqrt(tolerance * 20));
    316323   BOOST_CHECK_CLOSE(
    317324      median(dist),
  • sandbox/math_toolkit/libs/math/test/test_nc_f.cpp

    r43075 r44695  
    228228
    229229   //
    230    // 2 eps expressed as a persentage, otherwise the limit of the test data:
    231    //
    232    RealType tol2 = (std::max)(boost::math::tools::epsilon<RealType>() * 200, RealType(1e-25));
     230   // 5 eps expressed as a persentage, otherwise the limit of the test data:
     231   //
     232   RealType tol2 = (std::max)(boost::math::tools::epsilon<RealType>() * 500, RealType(1e-25));
    233233   RealType x = 2;
    234234   
  • sandbox/math_toolkit/libs/math/test/test_round.cpp

    r42920 r44695  
    4040void check_within_half(T a, U u)
    4141{
     42   BOOST_MATH_STD_USING
    4243   if(fabs(a-u) > 0.5f)
    4344   {
     
    6162{
    6263   BOOST_MATH_STD_USING
    63    using ::abs;
    6464   if(fabs(a-u) >= 1)
    6565   {
  • sandbox/math_toolkit/libs/math/test/test_zeta.cpp

    r42140 r44695  
    8080      largest_type,                  // test type(s)
    8181      ".*",                          // test data group
    82       ".*", 2, 1);                   // test function
     82      ".*", 3, 1);                   // test function
    8383   add_expected_result(
    8484      ".*",                          // compiler
     
    106106
    107107   typedef value_type (*pg)(value_type);
     108#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
     109   pg funcp = boost::math::zeta<value_type>;
     110#else
    108111   pg funcp = boost::math::zeta;
     112#endif
    109113
    110114   boost::math::tools::test_result<value_type> result;
     
    154158   std::cout << "Testing basic sanity checks for type " << t << std::endl;
    155159   //
    156    // Basic sanity checks, tolerance is either 2 or 10 epsilon
     160   // Basic sanity checks, tolerance is either 5 or 10 epsilon
    157161   // expressed as a percentage:
    158162   //
    159163   T tolerance = boost::math::tools::epsilon<T>() * 100 *
    160       (boost::is_floating_point<T>::value ? 2 : 10);
     164      (boost::is_floating_point<T>::value ? 5 : 10);
    161165   BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(0.125)), static_cast<T>(-0.63277562349869525529352526763564627152686379131122L), tolerance);
    162166   BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(1023) / static_cast<T>(1024)), static_cast<T>(-1023.4228554489429786541032870895167448906103303056L), tolerance);
Note: See TracChangeset for help on using the changeset viewer.