Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76544 - in trunk: boost/math/tools libs/math/test
From: john_at_[hidden]
Date: 2012-01-16 13:25:16


Author: johnmaddock
Date: 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
New Revision: 76544
URL: http://svn.boost.org/trac/boost/changeset/76544

Log:
Refactor the tests some more: allow tables of data to be of a different type to the type being tested - allows us to have tables of POD's (fast to compile) rather than tables of UDT's which compile very slowly on some compilers (usually Intel).
Added:
   trunk/libs/math/test/table_type.hpp (contents, props changed)
Text files modified:
   trunk/boost/math/tools/test.hpp | 68 ++++++++++++++++++++++++
   trunk/libs/math/test/acosh_data.ipp | 4
   trunk/libs/math/test/asinh_data.ipp | 4
   trunk/libs/math/test/assoc_legendre_p.ipp | 2
   trunk/libs/math/test/atanh_data.ipp | 4
   trunk/libs/math/test/bessel_i_data.ipp | 2
   trunk/libs/math/test/bessel_i_int_data.ipp | 2
   trunk/libs/math/test/bessel_j_data.ipp | 2
   trunk/libs/math/test/bessel_j_int_data.ipp | 2
   trunk/libs/math/test/bessel_j_large_data.ipp | 2
   trunk/libs/math/test/bessel_k_data.ipp | 2
   trunk/libs/math/test/bessel_k_int_data.ipp | 2
   trunk/libs/math/test/bessel_y01_data.ipp | 2
   trunk/libs/math/test/bessel_yn_data.ipp | 2
   trunk/libs/math/test/bessel_yv_data.ipp | 2
   trunk/libs/math/test/beta_exp_data.ipp | 2
   trunk/libs/math/test/beta_med_data.ipp | 2
   trunk/libs/math/test/beta_small_data.ipp | 2
   trunk/libs/math/test/binomial_data.ipp | 2
   trunk/libs/math/test/binomial_large_data.ipp | 2
   trunk/libs/math/test/binomial_quantile.ipp | 2
   trunk/libs/math/test/cbrt_data.ipp | 2
   trunk/libs/math/test/digamma_data.ipp | 2
   trunk/libs/math/test/digamma_neg_data.ipp | 2
   trunk/libs/math/test/digamma_root_data.ipp | 2
   trunk/libs/math/test/digamma_small_data.ipp | 2
   trunk/libs/math/test/ellint_e2_data.ipp | 2
   trunk/libs/math/test/ellint_e_data.ipp | 2
   trunk/libs/math/test/ellint_f_data.ipp | 2
   trunk/libs/math/test/ellint_k_data.ipp | 2
   trunk/libs/math/test/ellint_pi2_data.ipp | 2
   trunk/libs/math/test/ellint_pi3_data.ipp | 2
   trunk/libs/math/test/ellint_pi3_large_data.ipp | 2
   trunk/libs/math/test/ellint_rc_data.ipp | 2
   trunk/libs/math/test/ellint_rd_data.ipp | 2
   trunk/libs/math/test/ellint_rf_data.ipp | 2
   trunk/libs/math/test/ellint_rj_data.ipp | 2
   trunk/libs/math/test/erf_data.ipp | 2
   trunk/libs/math/test/erf_inv_data.ipp | 2
   trunk/libs/math/test/erf_large_data.ipp | 2
   trunk/libs/math/test/erf_small_data.ipp | 2
   trunk/libs/math/test/erfc_inv_big_data.ipp | 2
   trunk/libs/math/test/erfc_inv_data.ipp | 2
   trunk/libs/math/test/expint_1_data.ipp | 2
   trunk/libs/math/test/expint_data.ipp | 2
   trunk/libs/math/test/expint_small_data.ipp | 2
   trunk/libs/math/test/expinti_data.ipp | 2
   trunk/libs/math/test/expinti_data_double.ipp | 2
   trunk/libs/math/test/expinti_data_long.ipp | 2
   trunk/libs/math/test/functor.hpp | 100 ++++++++++++++++++-----------------
   trunk/libs/math/test/gamma_inv_big_data.ipp | 2
   trunk/libs/math/test/gamma_inv_data.ipp | 2
   trunk/libs/math/test/gamma_inv_small_data.ipp | 2
   trunk/libs/math/test/hermite.ipp | 2
   trunk/libs/math/test/hypergeometric_dist_data2.ipp | 2
   trunk/libs/math/test/hypergeometric_test_data.ipp | 2
   trunk/libs/math/test/ibeta_data.ipp | 2
   trunk/libs/math/test/ibeta_int_data.ipp | 2
   trunk/libs/math/test/ibeta_inv_data.ipp | 2
   trunk/libs/math/test/ibeta_inva_data.ipp | 2
   trunk/libs/math/test/ibeta_large_data.ipp | 2
   trunk/libs/math/test/ibeta_small_data.ipp | 2
   trunk/libs/math/test/igamma_big_data.ipp | 2
   trunk/libs/math/test/igamma_int_data.ipp | 2
   trunk/libs/math/test/igamma_med_data.ipp | 2
   trunk/libs/math/test/igamma_small_data.ipp | 2
   trunk/libs/math/test/laguerre2.ipp | 2
   trunk/libs/math/test/laguerre3.ipp | 2
   trunk/libs/math/test/legendre_p.ipp | 2
   trunk/libs/math/test/legendre_p_large.ipp | 2
   trunk/libs/math/test/log1p_expm1_data.ipp | 4
   trunk/libs/math/test/log1p_expm1_test.hpp | 19 +++---
   trunk/libs/math/test/ncbeta.ipp | 4
   trunk/libs/math/test/ncbeta_big.ipp | 4
   trunk/libs/math/test/nccs.ipp | 4
   trunk/libs/math/test/nccs_big.ipp | 4
   trunk/libs/math/test/nct.ipp | 7 +-
   trunk/libs/math/test/negative_binomial_quantile.ipp | 4
   trunk/libs/math/test/poisson_quantile.ipp | 4
   trunk/libs/math/test/powm1_sqrtp1m1_test.hpp | 19 +++---
   trunk/libs/math/test/sph_bessel_data.ipp | 2
   trunk/libs/math/test/sph_neumann_data.ipp | 2
   trunk/libs/math/test/spherical_harmonic.ipp | 4
   trunk/libs/math/test/test_bessel_i.hpp | 69 ++++++++++++------------
   trunk/libs/math/test/test_bessel_j.hpp | 111 ++++++++++++++++++++-------------------
   trunk/libs/math/test/test_bessel_k.hpp | 63 +++++++++++-----------
   trunk/libs/math/test/test_bessel_y.hpp | 75 +++++++++++++-------------
   trunk/libs/math/test/test_beta.hpp | 25 ++++----
   trunk/libs/math/test/test_binomial.cpp | 7 --
   trunk/libs/math/test/test_binomial_coeff.hpp | 16 ++--
   trunk/libs/math/test/test_carlson.hpp | 57 ++++++++++----------
   trunk/libs/math/test/test_cbrt.hpp | 26 +++++----
   trunk/libs/math/test/test_digamma.hpp | 21 +++---
   trunk/libs/math/test/test_ellint_1.hpp | 43 +++++++-------
   trunk/libs/math/test/test_ellint_2.hpp | 57 ++++++++++----------
   trunk/libs/math/test/test_ellint_3.hpp | 47 ++++++++--------
   trunk/libs/math/test/test_erf.hpp | 63 +++++++++++-----------
   trunk/libs/math/test/test_expint.hpp | 47 ++++++++--------
   trunk/libs/math/test/test_gamma.hpp | 55 ++++++++++---------
   trunk/libs/math/test/test_gamma_data.ipp | 14 ++--
   trunk/libs/math/test/test_hermite.hpp | 15 ++--
   trunk/libs/math/test/test_hypergeometric_dist.cpp | 35 ++++++------
   trunk/libs/math/test/test_ibeta.hpp | 45 ++++++++-------
   trunk/libs/math/test/test_ibeta_inv.hpp | 67 ++++++++++++-----------
   trunk/libs/math/test/test_ibeta_inv_ab.hpp | 95 +++++++++++++++++----------------
   trunk/libs/math/test/test_igamma.hpp | 53 +++++++++---------
   trunk/libs/math/test/test_igamma_inv.hpp | 89 ++++++++++++++++---------------
   trunk/libs/math/test/test_igamma_inva.hpp | 76 +++++++++++++-------------
   trunk/libs/math/test/test_inv_hyp.cpp | 43 +++++++-------
   trunk/libs/math/test/test_laguerre.hpp | 27 +++++----
   trunk/libs/math/test/test_legendre.hpp | 47 ++++++++--------
   trunk/libs/math/test/test_long_double_support.cpp | 9 +-
   trunk/libs/math/test/test_nc_beta.cpp | 33 ++++++-----
   trunk/libs/math/test/test_nc_chi_squared.cpp | 37 ++++++------
   trunk/libs/math/test/test_nc_t.cpp | 25 ++++----
   trunk/libs/math/test/test_negative_binomial.cpp | 1
   trunk/libs/math/test/test_poisson.cpp | 1
   trunk/libs/math/test/test_roots.cpp | 45 ++++++++-------
   trunk/libs/math/test/test_spherical_harmonic.cpp | 39 +++++++------
   trunk/libs/math/test/test_tgamma_ratio.hpp | 42 +++++++-------
   trunk/libs/math/test/test_zeta.hpp | 27 +++++----
   trunk/libs/math/test/tgamma_delta_ratio_data.ipp | 2
   trunk/libs/math/test/tgamma_delta_ratio_int.ipp | 2
   trunk/libs/math/test/tgamma_delta_ratio_int2.ipp | 2
   trunk/libs/math/test/tgamma_ratio_data.ipp | 2
   trunk/libs/math/test/zeta_1_below_data.ipp | 2
   trunk/libs/math/test/zeta_1_up_data.ipp | 2
   trunk/libs/math/test/zeta_data.ipp | 2
   trunk/libs/math/test/zeta_neg_data.ipp | 2
   129 files changed, 1079 insertions(+), 975 deletions(-)

Modified: trunk/boost/math/tools/test.hpp
==============================================================================
--- trunk/boost/math/tools/test.hpp (original)
+++ trunk/boost/math/tools/test.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -255,6 +255,74 @@
    return result;
 }
 
+template <class Real, class A, class F1, class F2>
+test_result<Real> test_hetero(const A& a, F1 test_func, F2 expect_func)
+{
+ typedef typename A::value_type row_type;
+ typedef Real value_type;
+
+ test_result<value_type> result;
+
+ for(unsigned i = 0; i < a.size(); ++i)
+ {
+ const row_type& row = a[i];
+ value_type point;
+ try
+ {
+ point = test_func(row);
+ }
+ catch(const std::underflow_error&)
+ {
+ point = 0;
+ }
+ catch(const std::overflow_error&)
+ {
+ point = std::numeric_limits<value_type>::has_infinity ?
+ std::numeric_limits<value_type>::infinity()
+ : tools::max_value<value_type>();
+ }
+ catch(const std::exception& e)
+ {
+ std::cerr << e.what() << std::endl;
+ print_row(row);
+ BOOST_ERROR("Unexpected exception.");
+ // so we don't get further errors:
+ point = expect_func(row);
+ }
+ value_type expected = expect_func(row);
+ value_type err = relative_error(point, expected);
+#ifdef BOOST_INSTRUMENT
+ if(err != 0)
+ {
+ std::cout << row[0] << " " << err;
+ if(std::numeric_limits<value_type>::is_specialized)
+ {
+ std::cout << " (" << err / std::numeric_limits<value_type>::epsilon() << "eps)";
+ }
+ std::cout << std::endl;
+ }
+#endif
+ if(!(boost::math::isfinite)(point) && (boost::math::isfinite)(expected))
+ {
+ std::cout << "CAUTION: Found non-finite result, when a finite value was expected at entry " << i << "\n";
+ std::cout << "Found: " << point << " Expected " << expected << " Error: " << err << std::endl;
+ print_row(row);
+ BOOST_ERROR("Unexpected non-finite result");
+ }
+ if(err > 0.5)
+ {
+ std::cout << "CAUTION: Gross error found at entry " << i << ".\n";
+ std::cout << "Found: " << point << " Expected " << expected << " Error: " << err << std::endl;
+ print_row(row);
+ BOOST_ERROR("Gross error");
+ }
+ result.add(err);
+ if((result.max)() == err)
+ result.set_worst(i);
+ }
+ return result;
+}
+
 } // namespace tools
 } // namespace math
 } // namespace boost

Modified: trunk/libs/math/test/acosh_data.ipp
==============================================================================
--- trunk/libs/math/test/acosh_data.ipp (original)
+++ trunk/libs/math/test/acosh_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -5,8 +5,8 @@
 // (See accompanying file LICENSE_1_0.txt
 // or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 2>, 261> acosh_data = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 261> acosh_data = {{
       {{ SC_(1.000001430511474609375), SC_(0.001691455665129294448190238354291760044433) }},
       {{ SC_(1.0000019073486328125), SC_(0.001953124689559275021527821917817027620963) }},
       {{ SC_(1.000007152557373046875), SC_(0.003782208044661295168504799813496158490314) }},

Modified: trunk/libs/math/test/asinh_data.ipp
==============================================================================
--- trunk/libs/math/test/asinh_data.ipp (original)
+++ trunk/libs/math/test/asinh_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -5,8 +5,8 @@
 // (See accompanying file LICENSE_1_0.txt
 // or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 2>, 281> asinh_data = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 281> asinh_data = {{
       {{ SC_(-497.181640625), SC_(-6.902103625349694816896128061929344488774) }},
       {{ SC_(-495.216552734375), SC_(-6.898143347143858285101511567975488446084) }},
       {{ SC_(-488.0980224609375), SC_(-6.883664481302669222996695409880306523751) }},

Modified: trunk/libs/math/test/assoc_legendre_p.ipp
==============================================================================
--- trunk/libs/math/test/assoc_legendre_p.ipp (original)
+++ trunk/libs/math/test/assoc_legendre_p.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 400> assoc_legendre_p = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 400> assoc_legendre_p = {{
       {{ SC_(3.755727291107177734375), SC_(-3), SC_(0.264718532562255859375), SC_(0.018682285998021253444483874168352748715136623066073) }},
       {{ SC_(3.755727291107177734375), SC_(-3), SC_(0.67001712322235107421875), SC_(0.0085227010576716344744906184676725516467064196759033) }},
       {{ SC_(3.755727291107177734375), SC_(-3), SC_(0.91501367092132568359375), SC_(0.0013678553914178941694232605088191864494205442141689) }},

Modified: trunk/libs/math/test/atanh_data.ipp
==============================================================================
--- trunk/libs/math/test/atanh_data.ipp (original)
+++ trunk/libs/math/test/atanh_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -5,8 +5,8 @@
 // (See accompanying file LICENSE_1_0.txt
 // or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 2>, 260> atanh_data = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 260> atanh_data = {{
       {{ SC_(-0.9999983310699462890625), SC_(-6.998237084679026894944012639589359039154) }},
       {{ SC_(-0.9999978542327880859375), SC_(-6.872579751329170618373487147465365112113) }},
       {{ SC_(-0.999992847442626953125), SC_(-6.270592097465752658938563627507298840894) }},

Modified: trunk/libs/math/test/bessel_i_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_i_data.ipp (original)
+++ trunk/libs/math/test/bessel_i_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 225> bessel_i_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 225> bessel_i_data = {{
       {{ SC_(-0.8049192047119140625e2), SC_(0.24750102996826171875e2), SC_(0.4186983670927603951456761016615805321694e29) }},
       {{ SC_(-0.8049192047119140625e2), SC_(0.637722015380859375e2), SC_(0.2032477564839492547710163141114983376107e7) }},
       {{ SC_(-0.7460263824462890625e2), SC_(0.24750102996826171875e2), SC_(0.7209773983625557491285409746913864781653e24) }},

Modified: trunk/libs/math/test/bessel_i_int_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_i_int_data.ipp (original)
+++ trunk/libs/math/test/bessel_i_int_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 495> bessel_i_int_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 495> bessel_i_int_data = {{
       {{ SC_(0), SC_(0.177219114266335964202880859375e-2), SC_(0.1000000785165515654790765567976560128368e1) }},
       {{ SC_(0), SC_(0.22177286446094512939453125e-2), SC_(0.1000001229580463247166647265657459686513e1) }},
       {{ SC_(0), SC_(0.7444499991834163665771484375e-2), SC_(0.1000013855193023439561602999309818071557e1) }},

Modified: trunk/libs/math/test/bessel_j_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_j_data.ipp (original)
+++ trunk/libs/math/test/bessel_j_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 360> bessel_j_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 360> bessel_j_data = {{
       {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.553809732082299888134002685546875e-4), SC_(0.9956156809860747445801192500664050062602e0) }},
       {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.69304020144045352935791015625e-4), SC_(0.9957146107589140226790508756099801328105e0) }},
       {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.23264062474481761455535888671875e-3), SC_(0.9962489699005580621378590557841736186861e0) }},

Modified: trunk/libs/math/test/bessel_j_int_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_j_int_data.ipp (original)
+++ trunk/libs/math/test/bessel_j_int_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 224> bessel_j_int_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 224> bessel_j_int_data = {{
       {{ SC_(0), SC_(0.1730655412757187150418758392333984375e-5), SC_(0.999999999999251207960573702716351702855e0) }},
       {{ SC_(0), SC_(0.216575062950141727924346923828125e-5), SC_(0.9999999999988273810527038974545295287162e0) }},
       {{ SC_(0), SC_(0.72700195232755504548549652099609375e-5), SC_(0.9999999999867867040328417323221266089012e0) }},

Modified: trunk/libs/math/test/bessel_j_large_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_j_large_data.ipp (original)
+++ trunk/libs/math/test/bessel_j_large_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 70> bessel_j_large_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 70> bessel_j_large_data = {{
       {{ SC_(0.725889492034912109375e1), SC_(0.725889492034912109375e1), SC_(0.2307850131230964328215158373258970201933e0) }},
       {{ SC_(0.725889492034912109375e1), SC_(0.90838165283203125e1), SC_(0.331270090805281544869225081474258975783e0) }},
       {{ SC_(0.725889492034912109375e1), SC_(0.30492671966552734375e2), SC_(0.1392044369140870127137144436194280008198e0) }},

Modified: trunk/libs/math/test/bessel_k_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_k_data.ipp (original)
+++ trunk/libs/math/test/bessel_k_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 263> bessel_k_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 263> bessel_k_data = {{
       {{ SC_(-0.8049192047119140625e2), SC_(0.24750102996826171875e2), SC_(0.6579017807810652710369517871806355927214e29) }},
       {{ SC_(-0.8049192047119140625e2), SC_(0.637722015380859375e2), SC_(0.2395518238062557960566710371847643552469e-8) }},
       {{ SC_(-0.8049192047119140625e2), SC_(0.1252804412841796875e3), SC_(0.3069043255911758700865294859650240330974e-44) }},

Modified: trunk/libs/math/test/bessel_k_int_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_k_int_data.ipp (original)
+++ trunk/libs/math/test/bessel_k_int_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -2,7 +2,7 @@
 // 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)
- static const boost::array<boost::array<T, 3>, 481> bessel_k_int_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 481> bessel_k_int_data = {{
       {{ SC_(0), SC_(0.177219114266335964202880859375e-2), SC_(0.6451475930592273598846015135698055330078e1) }},
       {{ SC_(0), SC_(0.22177286446094512939453125e-2), SC_(0.6227212142001190939808570915268231760654e1) }},
       {{ SC_(0), SC_(0.7444499991834163665771484375e-2), SC_(0.5016294646816679195434588077252051358532e1) }},

Modified: trunk/libs/math/test/bessel_y01_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_y01_data.ipp (original)
+++ trunk/libs/math/test/bessel_y01_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 100> bessel_y01_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 100> bessel_y01_data = {{
       {{ SC_(0), SC_(0.23917420208454132080078125e0), SC_(-0.96144387845032600014206252125473909797e0) }},
       {{ SC_(0), SC_(0.1785583972930908203125e1), SC_(0.4741447443427281185149710186267060231689e0) }},
       {{ SC_(0), SC_(0.48770198822021484375e1), SC_(-0.2878028614684715596290259912770720755831e0) }},

Modified: trunk/libs/math/test/bessel_yn_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_yn_data.ipp (original)
+++ trunk/libs/math/test/bessel_yn_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 300> bessel_yn_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 300> bessel_yn_data = {{
       {{ SC_(0.3e1), SC_(0.48770198822021484375e1), SC_(0.110763167474753768460862899966350902213e0) }},
       {{ SC_(0.3e1), SC_(0.6349340915679931640625e1), SC_(0.3354120577583840086404698897976135110485e0) }},
       {{ SC_(0.3e1), SC_(0.677385044097900390625e1), SC_(0.3025179709577162581120705977708622170952e0) }},

Modified: trunk/libs/math/test/bessel_yv_data.ipp
==============================================================================
--- trunk/libs/math/test/bessel_yv_data.ipp (original)
+++ trunk/libs/math/test/bessel_yv_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 432> bessel_yv_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 432> bessel_yv_data = {{
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.177219114266335964202880859375e-2), SC_(-0.4109981080896677237358777348659577384814e1) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.22177286446094512939453125e-2), SC_(-0.3967198166482792888587309535339999462266e1) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.7444499991834163665771484375e-2), SC_(-0.3196174808457488271204616814902805588745e1) }},

Modified: trunk/libs/math/test/beta_exp_data.ipp
==============================================================================
--- trunk/libs/math/test/beta_exp_data.ipp (original)
+++ trunk/libs/math/test/beta_exp_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 351> beta_exp_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 351> beta_exp_data = { {
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.1730655412757187150418758392333984375e-5), SC_(1155631.551635027016649268884796909927277) }},
       {{ SC_(0.216575062950141727924346923828125e-5), SC_(0.1730655412757187150418758392333984375e-5), SC_(1039549.452063747329381617654200841254652) }},
       {{ SC_(0.216575062950141727924346923828125e-5), SC_(0.216575062950141727924346923828125e-5), SC_(923467.3524924676425690820378921903570447) }},

Modified: trunk/libs/math/test/beta_med_data.ipp
==============================================================================
--- trunk/libs/math/test/beta_med_data.ipp (original)
+++ trunk/libs/math/test/beta_med_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 1830> beta_med_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 1830> beta_med_data = { {
       {{ SC_(0.4883005917072296142578125), SC_(0.4883005917072296142578125), SC_(3.245912809500479157065104747353807392371) }},
       {{ SC_(3.5808107852935791015625), SC_(0.4883005917072296142578125), SC_(1.007653173802923954909901438393379243537) }},
       {{ SC_(3.5808107852935791015625), SC_(3.5808107852935791015625), SC_(0.01354763979296020361276499134253466025558) }},

Modified: trunk/libs/math/test/beta_small_data.ipp
==============================================================================
--- trunk/libs/math/test/beta_small_data.ipp (original)
+++ trunk/libs/math/test/beta_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 21> beta_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 21> beta_small_data = { {
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.1730655412757187150418758392333984375e-5), SC_(1155631.551635027016649268884796909927277) }},
       {{ SC_(0.216575062950141727924346923828125e-5), SC_(0.1730655412757187150418758392333984375e-5), SC_(1039549.452063747329381617654200841254652) }},
       {{ SC_(0.216575062950141727924346923828125e-5), SC_(0.216575062950141727924346923828125e-5), SC_(923467.3524924676425690820378921903570447) }},

Modified: trunk/libs/math/test/binomial_data.ipp
==============================================================================
--- trunk/libs/math/test/binomial_data.ipp (original)
+++ trunk/libs/math/test/binomial_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 159> binomial_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 159> binomial_data = { {
       {{ SC_(0.15e2), SC_(0.15e2), SC_(0.1e1) }},
       {{ SC_(0.19e2), SC_(0.15e2), SC_(0.3876e4) }},
       {{ SC_(0.19e2), SC_(0.19e2), SC_(0.1e1) }},

Modified: trunk/libs/math/test/binomial_large_data.ipp
==============================================================================
--- trunk/libs/math/test/binomial_large_data.ipp (original)
+++ trunk/libs/math/test/binomial_large_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 230> binomial_large_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 230> binomial_large_data = { {
       {{ SC_(0.174e3), SC_(0.4e1), SC_(0.36890001e8) }},
       {{ SC_(0.174e3), SC_(0.5e1), SC_(0.1254260034e10) }},
       {{ SC_(0.174e3), SC_(0.6e1), SC_(0.35328324291e11) }},

Modified: trunk/libs/math/test/binomial_quantile.ipp
==============================================================================
--- trunk/libs/math/test/binomial_quantile.ipp (original)
+++ trunk/libs/math/test/binomial_quantile.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
    static const boost::array<boost::array<T, 5>, 4032> binomial_quantile_data = {{
       {{ SC_(2), SC_(0.12698681652545928955078125), SC_(0.12698681652545928955078125), SC_(0), SC_(0.28467385230321224203411154382440248724380832183117) }},
       {{ SC_(2), SC_(0.12698681652545928955078125), SC_(0.135477006435394287109375), SC_(0), SC_(0.25727865882740919932840773421531232758964168093055) }},

Modified: trunk/libs/math/test/cbrt_data.ipp
==============================================================================
--- trunk/libs/math/test/cbrt_data.ipp (original)
+++ trunk/libs/math/test/cbrt_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 85> cbrt_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 85> cbrt_data = { {
       {{ SC_(0.266297021326439287136622624529991298914e-12), SC_(0.1888421455001568264216782004847867296461e-37) }},
       {{ SC_(0.5920415525016708979677559909760020673275e-12), SC_(0.2075183790343685754527643464587844863336e-36) }},
       {{ SC_(0.155163989296047688526414276566356420517e-11), SC_(0.3735707037930203997047439019589434984292e-35) }},

Modified: trunk/libs/math/test/digamma_data.ipp
==============================================================================
--- trunk/libs/math/test/digamma_data.ipp (original)
+++ trunk/libs/math/test/digamma_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 500> digamma_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 500> digamma_data = { {
       {{ SC_(2.818432331085205078125), SC_(0.8484115700906551606307984398000472347785) }},
       {{ SC_(4.6342258453369140625), SC_(1.421713669467331557347601964119226105014) }},
       {{ SC_(4.783483982086181640625), SC_(1.457016504476551729585831562031964212238) }},

Modified: trunk/libs/math/test/digamma_neg_data.ipp
==============================================================================
--- trunk/libs/math/test/digamma_neg_data.ipp (original)
+++ trunk/libs/math/test/digamma_neg_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 200> digamma_neg_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 200> digamma_neg_data = { {
       {{ SC_(-99.7181549072265625), SC_(2.03892909952497242038694056382195623059) }},
       {{ SC_(-99.5216522216796875), SC_(4.3913617771941913117971009646096341326) }},
       {{ SC_(-98.80979156494140625), SC_(-0.01795976054399933340057713377738267488686) }},

Modified: trunk/libs/math/test/digamma_root_data.ipp
==============================================================================
--- trunk/libs/math/test/digamma_root_data.ipp (original)
+++ trunk/libs/math/test/digamma_root_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 200> digamma_root_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 200> digamma_root_data = { {
       {{ SC_(1.39999997615814208984375), SC_(-0.06138456903152256550686860248931989075643) }},
       {{ SC_(1.4005000591278076171875), SC_(-0.06087192929516339380130503872301167293378) }},
       {{ SC_(1.40100002288818359375), SC_(-0.06035965880979232302674791723368356347747) }},

Modified: trunk/libs/math/test/digamma_small_data.ipp
==============================================================================
--- trunk/libs/math/test/digamma_small_data.ipp (original)
+++ trunk/libs/math/test/digamma_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 33> digamma_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 33> digamma_small_data = { {
       {{ SC_(0.1690093176520690576580818742513656616211e-8), SC_(-591683355.0172646248558707395909205014789) }},
       {{ SC_(0.2114990849122477811761200428009033203125e-8), SC_(-472815285.0570071002693788265718597340393) }},
       {{ SC_(0.7099628440698779741069301962852478027344e-8), SC_(-140852442.1314070676912450420112690472767) }},

Modified: trunk/libs/math/test/ellint_e2_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_e2_data.ipp (original)
+++ trunk/libs/math/test/ellint_e2_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // k, phi, E(k, phi)
 //
- static const boost::array<boost::array<T, 3>, 520> ellint_e2_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 520> ellint_e2_data = {{
       {{ SC_(0.177219114266335964202880859375e-2), SC_(-0.804919183254241943359375e0), SC_(0.17721905416489978459933452744691987573693030723399e-2) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(-0.74602639675140380859375e0), SC_(0.17721906263793616232304803862551613935165980878975e-2) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(-0.72904598712921142578125e0), SC_(0.17721906496143189532808590572077500756745196250994e-2) }},

Modified: trunk/libs/math/test/ellint_e_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_e_data.ipp (original)
+++ trunk/libs/math/test/ellint_e_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // k, E(k)
 //
- static const boost::array<boost::array<T, 2>, 100> ellint_e_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> ellint_e_data = {{
       {{ SC_(-0.990433037281036376953125e0), SC_(0.10274527688571687030049782227296053357094496206279e1) }},
       {{ SC_(-0.936334311962127685546875e0), SC_(0.11232874555917022066938321555637623562213676975972e1) }},
       {{ SC_(-0.931107819080352783203125e0), SC_(0.1130760221755419903369153157619439589360779303926e1) }},

Modified: trunk/libs/math/test/ellint_f_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_f_data.ipp (original)
+++ trunk/libs/math/test/ellint_f_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -8,7 +8,7 @@
 //
 // phi, k, ellint_1(k, phi)
 //
- static const boost::array<boost::array<T, 3>, 610> ellint_f_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 610> ellint_f_data = {{
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.12698681652545928955078125e0), SC_(0.17721911576221833285284471505772299979929420100157e-2) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.135477006435394287109375e0), SC_(0.17721911596893097495385621130075639520810631802367e-2) }},
       {{ SC_(0.177219114266335964202880859375e-2), SC_(0.22103404998779296875e0), SC_(0.17721911879842626333735727252300568988042608181058e-2) }},

Modified: trunk/libs/math/test/ellint_k_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_k_data.ipp (original)
+++ trunk/libs/math/test/ellint_k_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 100> ellint_k_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> ellint_k_data = {{
       {{ SC_(-0.99042308330535888671875e0), SC_(0.3377711175347896212115917173531827081735908096628e1) }},
       {{ SC_(-0.936324596405029296875e0), SC_(0.24799928378892127263868582279024816073017669022263e1) }},
       {{ SC_(-0.931098163127899169921875e0), SC_(0.24445366497109921574142184681825951967450363552834e1) }},

Modified: trunk/libs/math/test/ellint_pi2_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_pi2_data.ipp (original)
+++ trunk/libs/math/test/ellint_pi2_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // n, k, PI(n, k)
 //
- static const boost::array<boost::array<T, 3>, 500> ellint_pi2_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 500> ellint_pi2_data = {{
       {{ SC_(-0.871743316650390625e2), SC_(0.12698681652545928955078125e0), SC_(0.1674125184786922275852201144520277497358358213892e0) }},
       {{ SC_(-0.871743316650390625e2), SC_(0.135477006435394287109375e0), SC_(0.16743071541243053183466547814319460702264753849723e0) }},
       {{ SC_(-0.871743316650390625e2), SC_(0.22103404998779296875e0), SC_(0.16768328087467940131221559947745677007068360020936e0) }},

Modified: trunk/libs/math/test/ellint_pi3_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_pi3_data.ipp (original)
+++ trunk/libs/math/test/ellint_pi3_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // n, phi, k, PI(n, phi, k)
 //
- static const boost::array<boost::array<T, 4>, 400> ellint_pi3_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 400> ellint_pi3_data = {{
       {{ SC_(0.97540400922298431396484375e-1), SC_(0.15321610867977142333984375e0), SC_(0.814723670482635498046875e0), SC_(0.15373203842748125370338546651780574888816846402842e0) }},
       {{ SC_(0.97540400922298431396484375e-1), SC_(0.1994704306125640869140625e0), SC_(0.135477006435394287109375e0), SC_(0.19975117232566753482238350513231879856319046077755e0) }},
       {{ SC_(0.97540400922298431396484375e-1), SC_(0.2128067910671234130859375e0), SC_(0.905791938304901123046875e0), SC_(0.21444962146028791552496083456124507126701014421723e0) }},

Modified: trunk/libs/math/test/ellint_pi3_large_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_pi3_large_data.ipp (original)
+++ trunk/libs/math/test/ellint_pi3_large_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // n, phi, k, PI(n, phi, k)
 //
- static const boost::array<boost::array<T, 4>, 380> ellint_pi3_large_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 380> ellint_pi3_large_data = {{
       {{ SC_(-0.882951507568359375e2), SC_(-0.80491924285888671875e1), SC_(0.814723670482635498046875e0), SC_(-0.87472421400728425336727040442604900083192977041785e0) }},
       {{ SC_(-0.882951507568359375e2), SC_(-0.7460263729095458984375e1), SC_(0.135477006435394287109375e0), SC_(-0.82718880423302271609361236805097048706326618138613e0) }},
       {{ SC_(-0.882951507568359375e2), SC_(-0.729045963287353515625e1), SC_(0.905791938304901123046875e0), SC_(-0.87747551276758882959544200152954525505618423971659e0) }},

Modified: trunk/libs/math/test/ellint_rc_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_rc_data.ipp (original)
+++ trunk/libs/math/test/ellint_rc_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // x, y, RC(x, y)
 //
- static const boost::array<boost::array<T, 3>, 201> ellint_rc_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 201> ellint_rc_data = {{
       {{ SC_(0.11698430441812742785454260394458960094979845402414e-30), SC_(0.1429457475085533184e20), SC_(0.41546482167023371731518451342517736095263780557582e-9) }},
       {{ SC_(0.60682196926171104626767727515008970841312337712241e-30), SC_(0.20031258624e11), SC_(0.11098537606275153066313383027431717728910787699004e-4) }},
       {{ SC_(0.75974287571611502022633594876763844865744160884209e-30), SC_(0.20657736771171195551744e23), SC_(0.10928951720653730370271800759007590309935803177545e-10) }},

Modified: trunk/libs/math/test/ellint_rd_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_rd_data.ipp (original)
+++ trunk/libs/math/test/ellint_rd_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // x, y, z, RD(x, y, z)
 //
- static const boost::array<boost::array<T, 4>, 201> ellint_rd_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 201> ellint_rd_data = {{
       {{ SC_(0.60682196926171104626767727515008970841312337712241e-30), SC_(0.20031258624e11), SC_(0.10313978271484375e4), SC_(0.20551372495384815463856604017047221545095240191057e-7) }},
       {{ SC_(0.13810928266794127506964991575307193802925529863273e-29), SC_(0.2529551275074481964111328125e-3), SC_(0.7030536597341097149183042347431182861328125e-8), SC_(0.26827491422802771467722943731540343461246213838861e11) }},
       {{ SC_(0.44767214645416419053919245787147718165594030426536e-29), SC_(0.26553176031232e14), SC_(0.2085586588137791946752e23), SC_(0.10585138723496739834534066073267118675522211779171e-31) }},

Modified: trunk/libs/math/test/ellint_rf_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_rf_data.ipp (original)
+++ trunk/libs/math/test/ellint_rf_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // x, y, z, RF(x, y, z)
 //
- static const boost::array<boost::array<T, 4>, 401> ellint_rf_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 401> ellint_rf_data = {{
       {{ SC_(0.60682196926171104626767727515008970841312337712241e-30), SC_(0.20031258624e11), SC_(0.10313978271484375e4), SC_(0.69081557947567857896297308369623231790841946303168e-4) }},
       {{ SC_(0.13810928266794127506964991575307193802925529863273e-29), SC_(0.2529551275074481964111328125e-3), SC_(0.7030536597341097149183042347431182861328125e-8), SC_(0.41696748464385961137940994051143282877208328256968e3) }},
       {{ SC_(0.14532352659780781796355564562931230420316401288775e-29), SC_(0.62687453931329231730011467674071804187172354186889e-30), SC_(0.26256847716031594952568184453411959111690521240234e-12), SC_(0.40492940437281068910143789937423107620726714449588e8) }},

Modified: trunk/libs/math/test/ellint_rj_data.ipp
==============================================================================
--- trunk/libs/math/test/ellint_rj_data.ipp (original)
+++ trunk/libs/math/test/ellint_rj_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 //
 // x, y, z, p, RF(x, y, z, p)
 //
- static const boost::array<boost::array<T, 5>, 801> ellint_rj_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 801> ellint_rj_data = {{
       {{ SC_(0.17778719640226356167347852945229440308832650104108e-30), SC_(0.140657017848070144e19), SC_(0.1004598712921142578125e2), SC_(-0.482979822802320768460049293935298919677734375e-9), SC_(-0.25179478604244669733973586875090503552089558764187e-9) }},
       {{ SC_(0.17971096343704528451751984491965084147481741634467e-30), SC_(0.89101844176293009628514463216220065078232437372208e-17), SC_(0.83764338663550372334498751058362691151424505491344e-28), SC_(0.25525904358368192101317869568e29), SC_(0.55264196567924337745014728862252651162552511364961e-18) }},
       {{ SC_(0.3374483874642825322028299383742755000492569610633e-30), SC_(0.46577155087788907954176e23), SC_(0.46983051300048828125e0), SC_(-0.4337557424349824941600672900676727294921875e-8), SC_(-0.29586494691174345632763961304004697052773087913144e-10) }},

Modified: trunk/libs/math/test/erf_data.ipp
==============================================================================
--- trunk/libs/math/test/erf_data.ipp (original)
+++ trunk/libs/math/test/erf_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 500> erf_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 500> erf_data = { {
       {{ SC_(-7.954905033111572265625), SC_(-0.9999999999999999999999999999768236114552), SC_(1.999999999999999999999999999976823611455) }},
       {{ SC_(-7.925852298736572265625), SC_(-0.9999999999999999999999999999631035087875), SC_(1.999999999999999999999999999963103508787) }},
       {{ SC_(-7.923464298248291015625), SC_(-0.9999999999999999999999999999616689085769), SC_(1.999999999999999999999999999961668908577) }},

Modified: trunk/libs/math/test/erf_inv_data.ipp
==============================================================================
--- trunk/libs/math/test/erf_inv_data.ipp (original)
+++ trunk/libs/math/test/erf_inv_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 100> erf_inv_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> erf_inv_data = { {
       {{ SC_(-0.990433037281036376953125), SC_(-1.832184533179510927322805923563700329767) }},
       {{ SC_(-0.936334311962127685546875), SC_(-1.311339282092737086640055105484822812599) }},
       {{ SC_(-0.931107819080352783203125), SC_(-1.286316461685184857889337272829270644576) }},

Modified: trunk/libs/math/test/erf_large_data.ipp
==============================================================================
--- trunk/libs/math/test/erf_large_data.ipp (original)
+++ trunk/libs/math/test/erf_large_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 300> erf_large_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 300> erf_large_data = { {
       {{ SC_(8.2311115264892578125), SC_(0.9999999999999999999999999999997436415644), SC_(0.2563584356432915693836191701249115171878e-30) }},
       {{ SC_(8.3800067901611328125), SC_(0.9999999999999999999999999999999787664373), SC_(0.212335626810981756102114466368867764939e-31) }},
       {{ SC_(8.39224529266357421875), SC_(0.9999999999999999999999999999999827316301), SC_(0.1726836993826464997300336080711750877816e-31) }},

Modified: trunk/libs/math/test/erf_small_data.ipp
==============================================================================
--- trunk/libs/math/test/erf_small_data.ipp (original)
+++ trunk/libs/math/test/erf_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 150> erf_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 150> erf_small_data = { {
       {{ SC_(0), SC_(0), SC_(1) }},
       {{ SC_(0.140129846432481707092372958328991613128e-44), SC_(0.1581195994027057927040695988659415347357e-44), SC_(1) }},
       {{ SC_(0.2802596928649634141847459166579832262561e-44), SC_(0.3162391988054115854081391977318830694715e-44), SC_(1) }},

Modified: trunk/libs/math/test/erfc_inv_big_data.ipp
==============================================================================
--- trunk/libs/math/test/erfc_inv_big_data.ipp (original)
+++ trunk/libs/math/test/erfc_inv_big_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 200> erfc_inv_big_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 200> erfc_inv_big_data = { {
       {{ SC_(0.5460825444184401149953083908674803067585e-4312), SC_(99.62016927389407649911084501709563799849) }},
       {{ SC_(0.2645475979732877501542006305722535728925e-4291), SC_(99.38083815930157675670279543643240126733) }},
       {{ SC_(0.4647218972549971591905525747707221131215e-4281), SC_(99.26209205835381203650501813598769577392) }},

Modified: trunk/libs/math/test/erfc_inv_data.ipp
==============================================================================
--- trunk/libs/math/test/erfc_inv_data.ipp (original)
+++ trunk/libs/math/test/erfc_inv_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 100> erfc_inv_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> erfc_inv_data = { {
       {{ SC_(0.00956696830689907073974609375), SC_(1.832184391051582711731256541599359331735) }},
       {{ SC_(0.063665688037872314453125), SC_(1.311339282092737086640055105484822812599) }},
       {{ SC_(0.068892158567905426025390625), SC_(1.286316565305373898738127895195338854718) }},

Modified: trunk/libs/math/test/expint_1_data.ipp
==============================================================================
--- trunk/libs/math/test/expint_1_data.ipp (original)
+++ trunk/libs/math/test/expint_1_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 79> expint_1_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 79> expint_1_data = {{
       {{ SC_(1), SC_(0.1690093176520690576580818742513656616211e-8), SC_(19.62126651228390287899433646349668926594) }},
       {{ SC_(1), SC_(0.2114990849122477811761200428009033203125e-8), SC_(19.39699968832702671432639506875262488287) }},
       {{ SC_(1), SC_(0.7099628440698779741069301962852478027344e-8), SC_(18.18600772876256587669156181753338435097) }},

Modified: trunk/libs/math/test/expint_data.ipp
==============================================================================
--- trunk/libs/math/test/expint_data.ipp (original)
+++ trunk/libs/math/test/expint_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 600> expint_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 600> expint_data = {{
       {{ SC_(0), SC_(4.8770198822021484375), SC_(0.001562365538135970995717852896857631808327) }},
       {{ SC_(0), SC_(5.4930877685546875), SC_(0.0007491447757702025944722131745633334937684) }},
       {{ SC_(0), SC_(6.349340915679931640625), SC_(0.0002752882216582873387067996572122917865872) }},

Modified: trunk/libs/math/test/expint_small_data.ipp
==============================================================================
--- trunk/libs/math/test/expint_small_data.ipp (original)
+++ trunk/libs/math/test/expint_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 380> expint_small_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 380> expint_small_data = {{
       {{ SC_(0), SC_(0.1730655412757187150418758392333984375e-5), SC_(577814.7758212256423775256378551874856003) }},
       {{ SC_(0), SC_(0.216575062950141727924346923828125e-5), SC_(461732.6762508792015318981937822200350918) }},
       {{ SC_(0), SC_(0.72700195232755504548549652099609375e-5), SC_(137550.2124589000541443257494936989244997) }},

Modified: trunk/libs/math/test/expinti_data.ipp
==============================================================================
--- trunk/libs/math/test/expinti_data.ipp (original)
+++ trunk/libs/math/test/expinti_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 336> expinti_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 336> expinti_data = {{
       {{ SC_(-49.689971923828125), SC_(-0.5189914452467706181911213069148082266893e-23) }},
       {{ SC_(-49.490234375), SC_(-0.6362401135264284153452455085506782750647e-23) }},
       {{ SC_(-49.47381591796875), SC_(-0.6469829627301154800340680350229540167762e-23) }},

Modified: trunk/libs/math/test/expinti_data_double.ipp
==============================================================================
--- trunk/libs/math/test/expinti_data_double.ipp (original)
+++ trunk/libs/math/test/expinti_data_double.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 100> expinti_data_double = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> expinti_data_double = {{
       {{ SC_(102.87009429931640625), SC_(4654899469800805764672952463660041015404000.0) }},
       {{ SC_(119.09970855712890625), SC_(0.4488787864805080932333174640972770490538e50) }},
       {{ SC_(120.6676483154296875), SC_(0.2124946028694675872596376925084081671409e51) }},

Modified: trunk/libs/math/test/expinti_data_long.ipp
==============================================================================
--- trunk/libs/math/test/expinti_data_long.ipp (original)
+++ trunk/libs/math/test/expinti_data_long.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 100> expinti_data_long = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 100> expinti_data_long = {{
       {{ SC_(850.51361083984375), SC_(0.27809823533792637952061836944224670902e367) }},
       {{ SC_(1136.15478515625), SC_(0.2348005093803919554840423708437417479629e491) }},
       {{ SC_(1163.7506103515625), SC_(0.2213003663371766101124862788858798209669e503) }},

Modified: trunk/libs/math/test/functor.hpp
==============================================================================
--- trunk/libs/math/test/functor.hpp (original)
+++ trunk/libs/math/test/functor.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -9,12 +9,13 @@
 #ifndef BOOST_MATH_TEST_FUNCTOR_HPP
 #define BOOST_MATH_TEST_FUNCTOR_HPP
 
+template <class Real>
 struct extract_result_type
 {
    extract_result_type(unsigned i) : m_location(i){}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return row[m_location];
    }
@@ -22,18 +23,19 @@
    unsigned m_location;
 };
 
-inline extract_result_type extract_result(unsigned i)
+template <class Real>
+inline extract_result_type<Real> extract_result(unsigned i)
 {
- return extract_result_type(i);
+ return extract_result_type<Real>(i);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder1
 {
    row_binder1(F _f, unsigned i) : f(_f), m_i(i) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(row[m_i]);
    }
@@ -43,19 +45,19 @@
    unsigned m_i;
 };
 
-template<class F>
-inline row_binder1<F> bind_func(F f, unsigned i)
+template<class Real, class F>
+inline row_binder1<Real, F> bind_func(F f, unsigned i)
 {
- return row_binder1<F>(f, i);
+ return row_binder1<Real, F>(f, i);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder2
 {
    row_binder2(F _f, unsigned i, unsigned j) : f(_f), m_i(i), m_j(j) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(row[m_i], row[m_j]);
    }
@@ -65,19 +67,19 @@
    unsigned m_i, m_j;
 };
 
-template<class F>
-inline row_binder2<F> bind_func(F f, unsigned i, unsigned j)
+template<class Real, class F>
+inline row_binder2<Real, F> bind_func(F f, unsigned i, unsigned j)
 {
- return row_binder2<F>(f, i, j);
+ return row_binder2<Real, F>(f, i, j);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder3
 {
    row_binder3(F _f, unsigned i, unsigned j, unsigned k) : f(_f), m_i(i), m_j(j), m_k(k) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(row[m_i], row[m_j], row[m_k]);
    }
@@ -87,19 +89,19 @@
    unsigned m_i, m_j, m_k;
 };
 
-template<class F>
-inline row_binder3<F> bind_func(F f, unsigned i, unsigned j, unsigned k)
+template<class Real, class F>
+inline row_binder3<Real, F> bind_func(F f, unsigned i, unsigned j, unsigned k)
 {
- return row_binder3<F>(f, i, j, k);
+ return row_binder3<Real, F>(f, i, j, k);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder4
 {
    row_binder4(F _f, unsigned i, unsigned j, unsigned k, unsigned l) : f(_f), m_i(i), m_j(j), m_k(k), m_l(l) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(row[m_i], row[m_j], row[m_k], row[m_l]);
    }
@@ -109,21 +111,21 @@
    unsigned m_i, m_j, m_k, m_l;
 };
 
-template<class F>
-inline row_binder4<F> bind_func(F f, unsigned i, unsigned j, unsigned k, unsigned l)
+template<class Real, class F>
+inline row_binder4<Real, F> bind_func(F f, unsigned i, unsigned j, unsigned k, unsigned l)
 {
- return row_binder4<F>(f, i, j, k, l);
+ return row_binder4<Real, F>(f, i, j, k, l);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder2_i1
 {
    row_binder2_i1(F _f, unsigned i, unsigned j) : f(_f), m_i(i), m_j(j) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
- return f(boost::math::itrunc(row[m_i]), row[m_j]);
+ return f(boost::math::itrunc(Real(row[m_i])), row[m_j]);
    }
 
 private:
@@ -131,23 +133,23 @@
    unsigned m_i, m_j;
 };
 
-template<class F>
-inline row_binder2_i1<F> bind_func_int1(F f, unsigned i, unsigned j)
+template<class Real, class F>
+inline row_binder2_i1<Real, F> bind_func_int1(F f, unsigned i, unsigned j)
 {
- return row_binder2_i1<F>(f, i, j);
+ return row_binder2_i1<Real, F>(f, i, j);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder3_i2
 {
    row_binder3_i2(F _f, unsigned i, unsigned j, unsigned k) : f(_f), m_i(i), m_j(j), m_k(k) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(
- boost::math::itrunc(row[m_i]),
- boost::math::itrunc(row[m_j]),
+ boost::math::itrunc(Real(row[m_i])),
+ boost::math::itrunc(Real(row[m_j])),
          row[m_k]);
    }
 
@@ -156,23 +158,23 @@
    unsigned m_i, m_j, m_k;
 };
 
-template<class F>
-inline row_binder3_i2<F> bind_func_int2(F f, unsigned i, unsigned j, unsigned k)
+template<class Real, class F>
+inline row_binder3_i2<Real, F> bind_func_int2(F f, unsigned i, unsigned j, unsigned k)
 {
- return row_binder3_i2<F>(f, i, j, k);
+ return row_binder3_i2<Real, F>(f, i, j, k);
 }
 
-template <class F>
+template <class Real, class F>
 struct row_binder4_i2
 {
    row_binder4_i2(F _f, unsigned i, unsigned j, unsigned k, unsigned l) : f(_f), m_i(i), m_j(j), m_k(k), m_l(l) {}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
       return f(
- boost::math::itrunc(row[m_i]),
- boost::math::itrunc(row[m_j]),
+ boost::math::itrunc(Real(row[m_i])),
+ boost::math::itrunc(Real(row[m_j])),
          row[m_k],
          row[m_l]);
    }
@@ -182,30 +184,30 @@
    unsigned m_i, m_j, m_k, m_l;
 };
 
-template<class F>
-inline row_binder4_i2<F> bind_func_int2(F f, unsigned i, unsigned j, unsigned k, unsigned l)
+template<class Real, class F>
+inline row_binder4_i2<Real, F> bind_func_int2(F f, unsigned i, unsigned j, unsigned k, unsigned l)
 {
- return row_binder4_i2<F>(f, i, j, k, l);
+ return row_binder4_i2<Real, F>(f, i, j, k, l);
 }
 
-template <class F>
+template <class Real, class F>
 struct negate_type
 {
    negate_type(F f) : m_f(f){}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
- return -m_f(row);
+ return -Real(m_f(row));
    }
 private:
    F m_f;
 };
 
-template <class F>
-inline negate_type<F> negate(F f)
+template <class Real, class F>
+inline negate_type<Real, F> negate(F f)
 {
- return negate_type<F>(f);
+ return negate_type<Real, F>(f);
 }
 
 #endif

Modified: trunk/libs/math/test/gamma_inv_big_data.ipp
==============================================================================
--- trunk/libs/math/test/gamma_inv_big_data.ipp (original)
+++ trunk/libs/math/test/gamma_inv_big_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 130> gamma_inv_big_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 130> gamma_inv_big_data = { {
       {{ SC_(464.56927490234375), SC_(0.12698681652545928955078125), SC_(440.0905015614498663381793089656310373835539712118699915057655756381750702144551901256933419148259778), SC_(489.2489328115381710888005650788332818303123263238882523231037266766796974176786885492715539575179927) }},
       {{ SC_(464.56927490234375), SC_(0.135477006435394287109375), SC_(440.9201626373476098986751145295281211597851207555116002836559277456581502883881279408150408804624974), SC_(488.3596775997958518494466317847702951287228545295142304855338082929544530999908165788368449119633373) }},
       {{ SC_(464.56927490234375), SC_(0.22103404998779296875), SC_(447.8707097559117500373730010123474103179731538915785876172851019700931527209673015311979439047788638), SC_(480.9951697728710868281134950146803822897647194680614404153327850687509247330919989892805468881282719) }},

Modified: trunk/libs/math/test/gamma_inv_data.ipp
==============================================================================
--- trunk/libs/math/test/gamma_inv_data.ipp (original)
+++ trunk/libs/math/test/gamma_inv_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 200> gamma_inv_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 200> gamma_inv_data = { {
       {{ SC_(9.754039764404296875), SC_(0.12698681652545928955078125), SC_(6.349849983781954486964960115093039567468747967664820851534065876063014180392060424555352423162443804), SC_(13.35954665556050630769710564071384909890705633863167415813992116806093647564994418684947673739937248) }},
       {{ SC_(9.754039764404296875), SC_(0.135477006435394287109375), SC_(6.443655518427200469944002789678415067225918847146256390238048987798948404483563975737891105237977816), SC_(13.20648307403762788665455912344161337928185855631083250140430065533748994841668643195553261756810763) }},
       {{ SC_(9.754039764404296875), SC_(0.22103404998779296875), SC_(7.262299107203547511919478506673940833772294421637239641242141768466064388735007729524335022945474356), SC_(11.97587613793353953360795933135034836336725275703898828955465276118339699687746564051854946108002967) }},

Modified: trunk/libs/math/test/gamma_inv_small_data.ipp
==============================================================================
--- trunk/libs/math/test/gamma_inv_small_data.ipp (original)
+++ trunk/libs/math/test/gamma_inv_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 229> gamma_inv_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 229> gamma_inv_small_data = { {
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.12698681652545928955078125), SC_(BOOST_MATH_SMALL_CONSTANT(0.2239623606222809074122747811596115646210220735131141509259977248899758059576948436798908594057794725e-517862)), SC_(BOOST_MATH_SMALL_CONSTANT(0.4348301951174619607003912855228982264838968134589390827069898370149065135278987288014463439625604227e-34079)) }},
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.135477006435394287109375), SC_(BOOST_MATH_SMALL_CONSTANT(0.9832661142546970309065948494116195914044751609094617663675341704778529043412686011701793912754530322e-501622)), SC_(BOOST_MATH_SMALL_CONSTANT(0.174464879621346471044494182889773112103066192989857880445657763562407515813032064473382568887549155e-36531)) }},
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.22103404998779296875), SC_(BOOST_MATH_SMALL_CONSTANT(0.8367188988033804556441828789142666841098768711906267440588049611090664598162301930590308375972597743e-378782)), SC_(BOOST_MATH_SMALL_CONSTANT(0.258455732678645501224573885451125893770282157149004436646252270592694652815341234774299743101856032e-62682)) }},

Modified: trunk/libs/math/test/hermite.ipp
==============================================================================
--- trunk/libs/math/test/hermite.ipp (original)
+++ trunk/libs/math/test/hermite.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 420> hermite = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 420> hermite = {{
       {{ SC_(0.8e1), SC_(-0.804919189453125e3), SC_(0.45107507538695517471998224862706929168983312035236e26) }},
       {{ SC_(0.8e1), SC_(-0.7460263671875e3), SC_(0.24561928260207418635049717146784087504133748838575e26) }},
       {{ SC_(0.8e1), SC_(-0.72904595947265625e3), SC_(0.20429972623973894937590136235800300689033201111301e26) }},

Modified: trunk/libs/math/test/hypergeometric_dist_data2.ipp
==============================================================================
--- trunk/libs/math/test/hypergeometric_dist_data2.ipp (original)
+++ trunk/libs/math/test/hypergeometric_dist_data2.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -8,7 +8,7 @@
 // (5) are commented out as they are too close to numeric_limits<double>::min(), to expect
 // our implementation to cope :-(
 //
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
    static const boost::array<boost::array<T, 7>, 1542-5> hypergeometric_dist_data2 = {{
       {{ SC_(3), SC_(3), SC_(4), SC_(3), SC_(0.25), SC_(1), SC_(0) }},
       {{ SC_(3), SC_(3), SC_(15), SC_(1), SC_(0.4351648351648351648351648351648351648351648351648351648351648351648351648351648351648351648351648352), SC_(0.9186813186813186813186813186813186813186813186813186813186813186813186813186813186813186813186813187), SC_(0.08131868131868131868131868131868131868131868131868131868131868131868131868131868131868131868131868132) }},

Modified: trunk/libs/math/test/hypergeometric_test_data.ipp
==============================================================================
--- trunk/libs/math/test/hypergeometric_test_data.ipp (original)
+++ trunk/libs/math/test/hypergeometric_test_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,7 +7,7 @@
 // Test data generated by Mathematica, 104 values are commented out because they have only a low
 // absolute error, not a low relative error.
 //
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
   static const boost::array<boost::array<T, 8>, 398-105> hypergeometric_test_data = {{
      //{{SC_(1),SC_(1),SC_(2),SC_(1),SC_(0.5),SC_(1),SC_(0.e-40)}},
      {{SC_(5),SC_(4),SC_(6),SC_(3),SC_(0.6666666666666666666666666666666666666667),SC_(0.6666666666666666666666666666666666666667),SC_(0.3333333333333333333333333333333333333333)}},

Modified: trunk/libs/math/test/ibeta_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_data.ipp (original)
+++ trunk/libs/math/test/ibeta_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 7>, 500> ibeta_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 7>, 500> ibeta_data = { {
       {{ SC_(0.115105740725994110107421875), SC_(27.2666988372802734375), SC_(0.913345992565155029296875), SC_(5.624704191155661855917495760118550518449), SC_(0.4314397017151442751805333868688125395477e-30), SC_(0.9999999999999999999999999999999232955748), SC_(0.7670442516666816870156810539487652961219e-31) }},
       {{ SC_(0.4634225666522979736328125), SC_(3.4317314624786376953125), SC_(0.24176712334156036376953125), SC_(0.9303555938707241359170267278058957882937), SC_(0.1886421251845313169553337074104181129545), SC_(0.8314186687138222136543152962911694480678), SC_(0.1685813312861777863456847037088305519322) }},
       {{ SC_(0.671531736850738525390625), SC_(23.0631923675537109375), SC_(0.908442795276641845703125), SC_(0.1643292146089890181565750406388380802073), SC_(0.5052411887003343404176234528376913340103e-25), SC_(0.9999999999999999999999996925432949323565), SC_(0.3074567050676435237921994231096931905187e-24) }},

Modified: trunk/libs/math/test/ibeta_int_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_int_data.ipp (original)
+++ trunk/libs/math/test/ibeta_int_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 7>, 1000> ibeta_int_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 7>, 1000> ibeta_int_data = { {
       {{ SC_(1), SC_(1), SC_(0.12707412242889404296875), SC_(0.12707412242889404296875), SC_(0.87292587757110595703125), SC_(0.12707412242889404296875), SC_(0.87292587757110595703125) }},
       {{ SC_(1), SC_(1), SC_(0.1355634629726409912109375), SC_(0.1355634629726409912109375), SC_(0.8644365370273590087890625), SC_(0.1355634629726409912109375), SC_(0.8644365370273590087890625) }},
       {{ SC_(1), SC_(1), SC_(0.221111953258514404296875), SC_(0.221111953258514404296875), SC_(0.778888046741485595703125), SC_(0.221111953258514404296875), SC_(0.778888046741485595703125) }},

Modified: trunk/libs/math/test/ibeta_inv_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_inv_data.ipp (original)
+++ trunk/libs/math/test/ibeta_inv_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 5>, 1210> ibeta_inv_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 1210> ibeta_inv_data = { {
       {{ SC_(0.104760829344741068780422210693359375e-4), SC_(39078.1875), SC_(0.913384497165679931640625), SC_(0.2135769916611873809373928693612157637794870746322109915739746618652569766882593624385400901395922558e-3760), SC_(BOOST_MATH_SMALL_CONSTANT(0.6169146818683135737866366973021696361959736535710675458813428774517757535576031054239811928697394346e-101417)) }},
       {{ SC_(0.1127331415773369371891021728515625e-4), SC_(0.0226620174944400787353515625), SC_(0.1355634629726409912109375), SC_(BOOST_MATH_SMALL_CONSTANT(0.6398069040886718270700942839013650119743974939592699138527850527236181568779785317811717302449254101e-76964)), SC_(BOOST_MATH_SMALL_CONSTANT(0.1123304116325227195797533167182832111272986902383876280357481893374380043283848201429836361152904889e-5592)) }},
       {{ SC_(0.113778432933031581342220306396484375e-4), SC_(0.03654421865940093994140625), SC_(0.9688708782196044921875), SC_(0.5825356514402150924555439351704966386176716144780670249830283141506929468296452211723778443894234951e-1195), SC_(BOOST_MATH_SMALL_CONSTANT(0.1299246431009640780314778465681510321819328250560790012308930348335051591055920757982605267188242976e-132423)) }},

Modified: trunk/libs/math/test/ibeta_inva_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_inva_data.ipp (original)
+++ trunk/libs/math/test/ibeta_inva_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 7>, 1100> ibeta_inva_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 7>, 1100> ibeta_inva_data = { {
       {{ SC_(0.101913392427377402782440185546875e-4), SC_(0.3082362115383148193359375), SC_(0.1355634629726409912109375), SC_(0.6498233713152427462579302903941895526823485861809005407005756658138299437345439685916818979079350952e-4), SC_(0.1598220360006443400909761969445329244603859759388130816641624923434214075962489978723834186220509792e-5), SC_(0.1598250823507423266003361933591577902014719110010440833489018043541995851576985396009647692344594598e-5), SC_(0.6499023539055942142435327607856798948132754954188633069136984730655318067141056849740949064680308213e-4) }},
       {{ SC_(0.1127331415773369371891021728515625e-4), SC_(0.8350250720977783203125), SC_(0.221111953258514404296875), SC_(0.3971461302443922423613753292972913694448775540766244520233346130148330830638824141461619735572445997e-4), SC_(0.3200361118082439458200937030865347915510238320387461167764804252841304593011303390960681217527273982e-5), SC_(0.3200210889570744035937464686925692217326089474042347373846591880760057034684133216576634448402269381e-5), SC_(0.3970804661143976120973144952058224085647966940391220340079248912116191892887943249201895859632245494e-4) }},
       {{ SC_(0.113778432933031581342220306396484375e-4), SC_(0.905801355838775634765625), SC_(0.913384497165679931640625), SC_(0.1078981970343159393325856300516135956140969598440175633458632674725240047510167692675710778553847126e-5), SC_(0.0001200181935703441995121934466228033111754654801609287621930678605774967528649020200620769888673021826), SC_(0.0001199468547533371496891932800417754246696194915133685876058567801242730706768275318621189458708399548), SC_(0.1078921129179782267266584693661729948023960221141040813461658037144034851960955828005953048025067861e-5) }},

Modified: trunk/libs/math/test/ibeta_large_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_large_data.ipp (original)
+++ trunk/libs/math/test/ibeta_large_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 7>, 1210> ibeta_large_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 7>, 1210> ibeta_large_data = { {
       {{ SC_(0.104760829344741068780422210693359375e-4), SC_(39078.1875), SC_(0.913384497165679931640625), SC_(95444.37547576888548779405522478045372688), SC_(BOOST_MATH_SMALL_CONSTANT(0.4076397251031275963346153642645211144346e-41521)), SC_(1), SC_(BOOST_MATH_SMALL_CONSTANT(0.4270966445860582673748568606264586002504e-41526)) }},
       {{ SC_(0.1127331415773369371891021728515625e-4), SC_(0.0226620174944400787353515625), SC_(0.1355634629726409912109375), SC_(88703.20318198098901713372585734808194292), SC_(45.9460483635769831377505786833842050448), SC_(0.9994822930837981780736860587426162687504), SC_(0.0005177069162018219263139412573837312496096) }},
       {{ SC_(0.113778432933031581342220306396484375e-4), SC_(0.03654421865940093994140625), SC_(0.9688708782196044921875), SC_(87893.29210911967129223056449206866305889), SC_(24.13233514927218107101077084629346084654), SC_(0.999725511349976252733137998478545702411), SC_(0.0002744886500237472668620015214542975889712) }},

Modified: trunk/libs/math/test/ibeta_small_data.ipp
==============================================================================
--- trunk/libs/math/test/ibeta_small_data.ipp (original)
+++ trunk/libs/math/test/ibeta_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 7>, 500> ibeta_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 7>, 500> ibeta_small_data = { {
       {{ SC_(0.011510574258863925933837890625), SC_(2.726669788360595703125), SC_(0.913345992565155029296875), SC_(85.50804647765112454526520766832090120908), SC_(0.0004969774007283958673037601318581948437309), SC_(0.9999941879795790272650838125485136788379), SC_(0.5812020420972734916187451486321162137375e-5) }},
       {{ SC_(0.0463422574102878570556640625), SC_(0.34317314624786376953125), SC_(0.24176712334156036376953125), SC_(20.36367089471426800179696837574809289039), SC_(3.630773740238788693031723031598949317136), SC_(0.8486827348798151491124959025982318049325), SC_(0.1513172651201848508875040974017681950675) }},
       {{ SC_(0.06715317070484161376953125), SC_(2.30631923675537109375), SC_(0.908442795276641845703125), SC_(13.78727207173260438424514878253152024011), SC_(0.001859217475218142037637565734833320618317), SC_(0.9998651679038930266805148691555636600556), SC_(0.0001348320961069733194851308444363399443688) }},

Modified: trunk/libs/math/test/igamma_big_data.ipp
==============================================================================
--- trunk/libs/math/test/igamma_big_data.ipp (original)
+++ trunk/libs/math/test/igamma_big_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 6>, 287> igamma_big_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 287> igamma_big_data = { {
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.1730655441178896580822765827178955078125e-7), SC_(-1), SC_(0.2993117912029903240422582053899047098779533956541385552546168739467202263345519375546082579259835689e-4), SC_(577797.90391619920649973095027584836128926282155274216943338008435801586707772349755359609709258809), SC_(0.9999700688208797009675957741794610095290122046604345861444745383126053279773665448062442806862583006) }},
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.8653277063785935752093791961669921875e-6), SC_(13.38277582367555562294055416847373915500263659346494217875993623821221196887112446988546507684731302), SC_(0.2316099655383339755405731669847576162961123204586203558223557251327214945205980959748823352959805302e-4), SC_(577801.8158305834504756449335090514614341009677858339594077124115869397920785194231187741120056354752), SC_(0.9999768390034461666024459426833015242383703887679541379644177644274867278505479401904023114002150846) }},
       {{ SC_(0.1730655412757187150418758392333984375e-5), SC_(0.15575898260067333467304706573486328125e-5), SC_(12.79500378214091254793715786456975103024623413471734292810881005720669047076428987935745392946724363), SC_(0.2214376467251173939070843604623148303831679646741287024258011317172427658231597089388494422353631048e-4), SC_(577802.4036026249851187199369053553654222257241882927070069630627131207976000175299533646400167828553), SC_(0.9999778562353274882606092915639537685169616832035325871297574198868282757234176840291059234224082336) }},

Modified: trunk/libs/math/test/igamma_int_data.ipp
==============================================================================
--- trunk/libs/math/test/igamma_int_data.ipp (original)
+++ trunk/libs/math/test/igamma_int_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 6>, 140> igamma_int_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 140> igamma_int_data = { {
       {{ SC_(0.5), SC_(0.004999999888241291046142578125), SC_(1.631267845368323485191815380032984903074365412587098308286220239190324188420710121791871591309590004), SC_(0.9203443263332001265162236927545643793578786527087679769237787431564844748135321134774112708209554194), SC_(0.1411860055371925421063521033081602797231840435352888199275875506625870961703220596656577919527041757), SC_(0.07965567366679987348377630724543562064212134729123202307622125684351552518646788652258872917904458057) }},
       {{ SC_(0.5), SC_(0.25), SC_(0.8498918380799311297867616098602389766300312781938048348528626579829435160004444680322048858624092311), SC_(0.479500122186953462317253346108035471263548424242036299941194274352806478283146429109461900411394659), SC_(0.9225620128255848975114058734809062061675181779285822933609451318699677685905877134253244973998849491), SC_(0.520499877813046537682746653891964528736451575757963700058805725647193521716853570890538099588605341) }},
       {{ SC_(0.5), SC_(0.449999988079071044921875), SC_(0.6075647752751784703583581789426278456752564880945645704809989500539948786183333019925969429005007538), SC_(0.3427817175407890768272360273834711985342418909050114189064883223090985450970247707985828865357086527), SC_(1.164889075630337556939809304398517337122292968027822557732808839798916405972698879464932440361793426), SC_(0.6572182824592109231727639726165288014657581090949885810935116776909014549029752292014171134642913473) }},

Modified: trunk/libs/math/test/igamma_med_data.ipp
==============================================================================
--- trunk/libs/math/test/igamma_med_data.ipp (original)
+++ trunk/libs/math/test/igamma_med_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 6>, 700> igamma_med_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 700> igamma_med_data = { {
       {{ SC_(0.9759566783905029296875), SC_(0.009759566746652126312255859375), SC_(1.003339192007827076679495082852814844336347745360235976200689788561799007730110137330271807878843422), SC_(0.9890348932311204142405476428315735322132825375129739181325170152149560168983641202727073881868421137), SC_(0.01112369385656880593053787042266942213006008594885039559843996330162391632861423778173725952365124566), SC_(0.01096510676887958575945235716842646778671746248702608186748298478504398310163587972729261181315788632) }},
       {{ SC_(0.9759566783905029296875), SC_(0.48797833919525146484375), SC_(0.6107075742899761923771199703161020169732161418698525715736270035568544567698769445946517198087313906), SC_(0.60200090392622800556746880021527940973985765617427715855663599678855269649431562996389062378697249), SC_(0.4037553115744196902329129829593822494931916894392338002255027483065684672888474305173573475937632775), SC_(0.39799909607377199443253119978472059026014234382572284144336400321144730350568437003610937621302751) }},
       {{ SC_(0.9759566783905029296875), SC_(0.8783609867095947265625), SC_(0.4103188243195825736649265764483608742565650301514019080978258727846258380934756822777647401521337079), SC_(0.4044690348331089562847173039266064850324957624072768224521011340506874965505832795400716939018472498), SC_(0.6041440615448133089451063768271233922098428011576844637013038790787970859652486928342443272503609601), SC_(0.5955309651668910437152826960733935149675042375927231775478988659493125034494167204599283060981527502) }},

Modified: trunk/libs/math/test/igamma_small_data.ipp
==============================================================================
--- trunk/libs/math/test/igamma_small_data.ipp (original)
+++ trunk/libs/math/test/igamma_small_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 6>, 252> igamma_small_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 252> igamma_small_data = { {
       {{ SC_(0.165048161769598689119220580323599278926849365234375e-11), SC_(0.165048164480104120332981665342231281101703643798828125e-13), SC_(31.15790848492937617968754572910879626038987427321665501824062445965678033809696860327421033588997389), SC_(0.5142555520027874508595595722328287870710653491133268223717400674935981376413784737279829921742056631e-10), SC_(605883754914.8750136902267543620760601500284208480879474455026885251060577270869941538181411625849707), SC_(0.9999999999485744447997212549140440427767171212928934650886673177628259932506401862358621522444918976) }},
       {{ SC_(0.165048161769598689119220580323599278926849365234375e-11), SC_(0.825240808847993445596102901617996394634246826171875e-12), SC_(27.24588549611682625963801859326817650865189920983978484217386169027034380426371292313397641222047523), SC_(0.4496883316923336685099678252541612612557662391990416220973173325702496188138998642060577791819560088e-10), SC_(605883754918.7870366790393042821255872858690405998259225088795587011728204964734306876513968427252046), SC_(0.9999999999550311668307666331490032174745838738744233760800958377902682667429750381186100131967398492) }},
       {{ SC_(0.165048161769598689119220580323599278926849365234375e-11), SC_(0.1485433412558301302652807862614281475543975830078125e-11), SC_(26.65809886043765184861833815671322602877461879268583897860494287446522932950747972178867249013415618), SC_(0.4399870213191659715445515622143744278264487110204265430288897607131180016977120873571283497579633446e-10), SC_(605883754919.3748233147184786931452677224239910797032029260335045647417393122785451624076300440705085), SC_(0.9999999999560012978680834028455448437785625572173551288979573456971110239286881998302287908816411206) }},

Modified: trunk/libs/math/test/laguerre2.ipp
==============================================================================
--- trunk/libs/math/test/laguerre2.ipp (original)
+++ trunk/libs/math/test/laguerre2.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 280> laguerre2 = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 280> laguerre2 = {{
       {{ SC_(0.5e1), SC_(0.9754039764404296875e2), SC_(-0.56218428868911115998451316426215010600803852349048e8) }},
       {{ SC_(0.5e1), SC_(0.12698681640625e3), SC_(-0.2243354877625806499089339248835065869040287604245e9) }},
       {{ SC_(0.5e1), SC_(0.1354770050048828125e3), SC_(-0.31418973293934559300911242611564538290439848722478e9) }},

Modified: trunk/libs/math/test/laguerre3.ipp
==============================================================================
--- trunk/libs/math/test/laguerre3.ipp (original)
+++ trunk/libs/math/test/laguerre3.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 2240> laguerre3 = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 2240> laguerre3 = {{
       {{ SC_(0.6e1), SC_(0.4e1), SC_(0.9754039764404296875e2), SC_(0.61248773400035441372705568899743424188675775638604e9) }},
       {{ SC_(0.6e1), SC_(0.4e1), SC_(0.12698681640625e3), SC_(0.35204789737752362425049635886299775785128782532338e10) }},
       {{ SC_(0.6e1), SC_(0.4e1), SC_(0.1354770050048828125e3), SC_(0.53680020529340456542399945558001901900007952546989e10) }},

Modified: trunk/libs/math/test/legendre_p.ipp
==============================================================================
--- trunk/libs/math/test/legendre_p.ipp (original)
+++ trunk/libs/math/test/legendre_p.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 140> legendre_p = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 140> legendre_p = {{
       {{ SC_(3), SC_(-0.804919183254241943359375), SC_(-0.09637879251279735399302410605920296560178428535437), SC_(-0.84585603807674271376114723023136351467791030262194) }},
       {{ SC_(3), SC_(-0.74602639675140380859375), SC_(0.081027074619746344180737168075984167003866787126753), SC_(-0.80282652754865351221792807765781454966620965987346) }},
       {{ SC_(3), SC_(-0.72904598712921142578125), SC_(0.12483445078630286253952851342405305778981983166886), SC_(-0.77778604740049228448138273219369426999256253154477) }},

Modified: trunk/libs/math/test/legendre_p_large.ipp
==============================================================================
--- trunk/libs/math/test/legendre_p_large.ipp (original)
+++ trunk/libs/math/test/legendre_p_large.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 160> legendre_p_large = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 160> legendre_p_large = {{
       {{ SC_(29), SC_(-0.74602639675140380859375), SC_(0.050915219643735786802064817454102557266509665552523), SC_(-0.27118035040452065163236941090242943684321195237749) }},
       {{ SC_(29), SC_(-0.72904598712921142578125), SC_(0.15209960929167220423613043592541930303920942697128), SC_(-0.1438359066051312703697159687668902900032679225431) }},
       {{ SC_(29), SC_(-0.5579319000244140625), SC_(0.15849246733249484229246386045081847903407720368835), SC_(-0.046562152771403674797644638451970346262085750814402) }},

Modified: trunk/libs/math/test/log1p_expm1_data.ipp
==============================================================================
--- trunk/libs/math/test/log1p_expm1_data.ipp (original)
+++ trunk/libs/math/test/log1p_expm1_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,9 +3,9 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
- static const boost::array<boost::array<T, 3>, 80> log1p_expm1_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 80> log1p_expm1_data = { {
       {{ SC_(-0.69330310821533203125e0), SC_(-0.1181895342296499380302723361817935835636e1), SC_(-0.5000779577496508480606742934033661111325e0) }},
       {{ SC_(-0.650003612041473388671875e0), SC_(-0.1049832444670425873798449427248829256278e1), SC_(-0.477956108886575099597621504254337139212e0) }},
       {{ SC_(-0.5634434223175048828125e0), SC_(-0.8288372954181591063099417140530721209296e0), SC_(-0.4307544676154126107123951950891833745657e0) }},

Modified: trunk/libs/math/test/log1p_expm1_test.hpp
==============================================================================
--- trunk/libs/math/test/log1p_expm1_test.hpp (original)
+++ trunk/libs/math/test/log1p_expm1_test.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -8,13 +8,14 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 
-template <class T>
+template <class Real, class T>
 void do_test(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -34,10 +35,10 @@
 #else
    funcp = &boost::math::log1p;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::log1p", "log1p and expm1");
    std::cout << std::endl;
    //
@@ -48,10 +49,10 @@
 #else
    funcp = boost::math::expm1;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(2));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::expm1", "log1p and expm1");
    std::cout << std::endl;
 }
@@ -61,7 +62,7 @@
 {
 # include "log1p_expm1_data.ipp"
 
- do_test(log1p_expm1_data, type_name, "expm1 and log1p");
+ do_test<T>(log1p_expm1_data, type_name, "expm1 and log1p");
 
    //
    // C99 Appendix F special cases:

Modified: trunk/libs/math/test/ncbeta.ipp
==============================================================================
--- trunk/libs/math/test/ncbeta.ipp (original)
+++ trunk/libs/math/test/ncbeta.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 6>, 3000> ncbeta = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 3000> ncbeta = {{
       {{ SC_(1.454305052757263183593750000000000000000), SC_(1.454305052757263183593750000000000000000e-1), SC_(5.940588760375976562500000000000000000000e1), SC_(9.976066350936889648437500000000000000000e-1), SC_(2.759834870217354705236013708534509068967e-1), SC_(7.240165129782645294763986291465490931033e-1) }},
       {{ SC_(1.454305052757263183593750000000000000000), SC_(1.454305052757263183593750000000000000000e-1), SC_(1.451677856445312500000000000000000000000e2), SC_(9.990068674087524414062500000000000000000e-1), SC_(2.757975665000284929998400439182434398680e-1), SC_(7.242024334999715070001599560817565601320e-1) }},
       {{ SC_(1.454305052757263183593750000000000000000), SC_(1.454305052757263183593750000000000000000e-1), SC_(1.929777069091796875000000000000000000000e2), SC_(9.992512464523315429687500000000000000000e-1), SC_(2.757802819095769722518059796277858159202e-1), SC_(7.242197180904230277481940203722141840798e-1) }},

Modified: trunk/libs/math/test/ncbeta_big.ipp
==============================================================================
--- trunk/libs/math/test/ncbeta_big.ipp (original)
+++ trunk/libs/math/test/ncbeta_big.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 6>, 72> ncbeta_big = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 72> ncbeta_big = {{
       {{ SC_(2.322846374511718750000000000000000000000e2), SC_(2.090561676025390625000000000000000000000e2), SC_(2.322846374511718750000000000000000000000e2), SC_(6.248598918318748474121093750000000000000e-2), SC_(5.822794103663371475941613559141512048716e-200), SC_(1.000000000000000000000000000000000000000) }},
       {{ SC_(2.322846374511718750000000000000000000000e2), SC_(2.299617919921875000000000000000000000000e2), SC_(2.906821289062500000000000000000000000000e2), SC_(1.553418934345245361328125000000000000000e-1), SC_(2.376427035888773394585864365564861664654e-112), SC_(1.000000000000000000000000000000000000000) }},
       {{ SC_(2.322846374511718750000000000000000000000e2), SC_(2.320523529052734375000000000000000000000e2), SC_(9.757655029296875000000000000000000000000e2), SC_(3.780863285064697265625000000000000000000e-1), SC_(9.534309971409020993977308030456117404144e-89), SC_(1.000000000000000000000000000000000000000) }},

Modified: trunk/libs/math/test/nccs.ipp
==============================================================================
--- trunk/libs/math/test/nccs.ipp (original)
+++ trunk/libs/math/test/nccs.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 5>, 3200> nccs = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 3200> nccs = {{
       {{ SC_(1.951913356781005859375000000000000000000), SC_(9.566968083381652832031250000000000000000e-1), SC_(2.908610105514526367187500000000000000000e-1), SC_(9.191713210042786241188236234883914114395e-2), SC_(9.080828678995721375881176376511608588560e-1) }},
       {{ SC_(1.951913356781005859375000000000000000000), SC_(6.366568565368652343750000000000000000000), SC_(2.079620361328125000000000000000000000000), SC_(8.979177306921986952474050864260945461537e-2), SC_(9.102082269307801304752594913573905453846e-1) }},
       {{ SC_(1.951913356781005859375000000000000000000), SC_(6.889215946197509765625000000000000000000), SC_(4.420564651489257812500000000000000000000), SC_(2.322522640917811378036214577533389504074e-1), SC_(7.677477359082188621963785422466610495926e-1) }},

Modified: trunk/libs/math/test/nccs_big.ipp
==============================================================================
--- trunk/libs/math/test/nccs_big.ipp (original)
+++ trunk/libs/math/test/nccs_big.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -8,8 +8,8 @@
 // the current algorithm may underflow to zero
 // prematurely in these cases.
 //
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 5>, 216> nccs_big = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 216> nccs_big = {{
       {{ SC_(1.018147201538085937500000000000000000000e2), SC_(1.814723730087280273437500000000000000000), SC_(1.036294460296630859375000000000000000000e1), SC_(6.015496565199092654771842521716269252752e-33), SC_(9.999999999999999999999999999999939845034e-1) }},
       {{ SC_(1.018147201538085937500000000000000000000e2), SC_(2.270954132080078125000000000000000000000), SC_(2.602141952514648437500000000000000000000e1), SC_(6.271325708033427466636203558887430713942e-16), SC_(9.999999999999993728674291966572533363796e-1) }},
       {{ SC_(1.018147201538085937500000000000000000000e2), SC_(7.623167991638183593750000000000000000000), SC_(5.471894454956054687500000000000000000000e1), SC_(5.592130493491734836774684682197361443348e-6), SC_(9.999944078695065082651632253153178026386e-1) }},

Modified: trunk/libs/math/test/nct.ipp
==============================================================================
--- trunk/libs/math/test/nct.ipp (original)
+++ trunk/libs/math/test/nct.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -4,9 +4,10 @@
 // Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt
 // or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 5>, 209-7> nct = {{
+#ifndef SC_
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+#endif
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 209-7> nct = {{
       {{ SC_(5.637862086296081542968750000000000000000e-1), SC_(-5.074075460433959960937500000000000000000e-1), SC_(-3.162277862429618835449218750000000000000e-2), SC_(6.862274577179818450132372470056769938949e-1), SC_(3.137725422820181549867627529943230061051e-1) }},
       {{ SC_(9.567963480949401855468750000000000000000e-1), SC_(-9.472283720970153808593750000000000000000e-1), SC_(-7.905694097280502319335937500000000000000e-2), SC_(8.115615601997266002916301508229723403909e-1), SC_(1.884384398002733997083698491770276596091e-1) }},
       {{ SC_(2.380512714385986328125000000000000000000), SC_(-2.378132343292236328125000000000000000000), SC_(-6.344355583190917968750000000000000000000), SC_(1.181983559218041139443788725932712768639e-1), SC_(8.818016440781958860556211274067287231361e-1) }},

Modified: trunk/libs/math/test/negative_binomial_quantile.ipp
==============================================================================
--- trunk/libs/math/test/negative_binomial_quantile.ipp (original)
+++ trunk/libs/math/test/negative_binomial_quantile.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 5>, 792> negative_binomial_quantile_data = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 5>, 792> negative_binomial_quantile_data = {{
       {{ SC_(4.285762786865234375), SC_(0.12698681652545928955078125), SC_(0.097540400922298431396484375), SC_(11.568381290037563253305975817351444024377036234904), SC_(49.67581419477884086070549390307050513757197652133) }},
       {{ SC_(4.285762786865234375), SC_(0.12698681652545928955078125), SC_(0.12698681652545928955078125), SC_(12.977136041273636067294825573363051160267257422387), SC_(46.43808301937089644496373095130068129633820080023) }},
       {{ SC_(4.285762786865234375), SC_(0.12698681652545928955078125), SC_(0.135477006435394287109375), SC_(13.355446548799362499196093574014767375702882517351), SC_(45.626103029359612367556766004407934151298781150048) }},

Modified: trunk/libs/math/test/poisson_quantile.ipp
==============================================================================
--- trunk/libs/math/test/poisson_quantile.ipp (original)
+++ trunk/libs/math/test/poisson_quantile.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 4>, 619> poisson_quantile_data = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 619> poisson_quantile_data = {{
       {{ SC_(2.539736270904541015625), SC_(0.097540400922298431396484375), SC_(0.1236392659323415267286721455855935332272165776019), SC_(4.1794244675777288954971650240102219690023733491107) }},
       {{ SC_(2.539736270904541015625), SC_(0.12698681652545928955078125), SC_(0.29692152360861802647109703200927257466043783201072), SC_(3.8759279753758017243263560996428606489658831749751) }},
       {{ SC_(2.539736270904541015625), SC_(0.135477006435394287109375), SC_(0.34320650665410472759846385302850183249926507900385), SC_(3.7989374337321363992500232228194835442428384328783) }},

Modified: trunk/libs/math/test/powm1_sqrtp1m1_test.hpp
==============================================================================
--- trunk/libs/math/test/powm1_sqrtp1m1_test.hpp (original)
+++ trunk/libs/math/test/powm1_sqrtp1m1_test.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -7,15 +7,16 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
 void test_powm1_sqrtp1m1(T, const char* type_name)
 {
- static const boost::array<boost::array<T, 2>, 141> sqrtp1m1_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 141> sqrtp1m1_data = {{
       {{ SC_(-0.990433037281036376953125), SC_(-0.902189148255607021082179865003660033379) }},
       {{ SC_(-0.928576648235321044921875), SC_(-0.7327485233629588435419837213946140663952) }},
       {{ SC_(-0.804919183254241943359375), SC_(-0.5583204592175928547330219789723812512248) }},
@@ -159,7 +160,7 @@
       {{ SC_(0.99292266368865966796875), SC_(0.4117091285702801135545007937655927942821) }},
    }};
 
- static const boost::array<boost::array<T, 3>, 1400> powm1_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 1400> powm1_data = {{
       {{ SC_(0.161179845478123719842988847972264920827e-14), SC_(0.1431564604442703013402649929484277542953e-29), SC_(-0.4876113153308343652049349438365788782568e-28) }},
       {{ SC_(0.161179845478123719842988847972264920827e-14), SC_(0.1791466932348087634896446282571611213266e-29), SC_(-0.6101991796549119337733033929476086235147e-28) }},
       {{ SC_(0.161179845478123719842988847972264920827e-14), SC_(0.6013619202535540063110633226832922483532e-29), SC_(-0.2048324441766037485142714404837079817647e-27) }},
@@ -1569,10 +1570,10 @@
    typedef T (*func_t)(const T&);
    func_t f = &boost::math::sqrt1pm1<T>;
 
- boost::math::tools::test_result<T> result = boost::math::tools::test(
+ boost::math::tools::test_result<T> result = boost::math::tools::test_hetero<T>(
       sqrtp1m1_data,
- bind_func(f, 0),
- extract_result(1));
+ bind_func<T>(f, 0),
+ extract_result<T>(1));
 
    std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
       "Test results for type " << type_name << std::endl << std::endl;
@@ -1580,10 +1581,10 @@
 
    typedef T (*func2_t)(T const, T const);
    func2_t f2 = &boost::math::powm1<T,T>;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<T>(
       powm1_data,
- bind_func(f2, 0, 1),
- extract_result(2));
+ bind_func<T>(f2, 0, 1),
+ extract_result<T>(2));
    handle_test_result(result, powm1_data[result.worst()], result.worst(), type_name, "boost::math::powm1", "powm1");
 }
 

Modified: trunk/libs/math/test/sph_bessel_data.ipp
==============================================================================
--- trunk/libs/math/test/sph_bessel_data.ipp (original)
+++ trunk/libs/math/test/sph_bessel_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 483> sph_bessel_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 483> sph_bessel_data = {{
       {{ SC_(0), SC_(0.177219114266335964202880859375e-2), SC_(0.999999476556507842202459130864323898236e0) }},
       {{ SC_(0), SC_(0.22177286446094512939453125e-2), SC_(0.9999991802801447287222232346958222796612e0) }},
       {{ SC_(0), SC_(0.7444499991834163665771484375e-2), SC_(0.9999907632622405689302860688925139982587e0) }},

Modified: trunk/libs/math/test/sph_neumann_data.ipp
==============================================================================
--- trunk/libs/math/test/sph_neumann_data.ipp (original)
+++ trunk/libs/math/test/sph_neumann_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 284> sph_neumann_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 284> sph_neumann_data = {{
       {{ SC_(0), SC_(0.177219114266335964202880859375e-2), SC_(-0.5642723324792311990959765396871018960216e3) }},
       {{ SC_(0), SC_(0.22177286446094512939453125e-2), SC_(-0.4509106843488238999473616173421364998283e3) }},
       {{ SC_(0), SC_(0.7444499991834163665771484375e-2), SC_(-0.1343236336805396008478682587573788632696e3) }},

Modified: trunk/libs/math/test/spherical_harmonic.ipp
==============================================================================
--- trunk/libs/math/test/spherical_harmonic.ipp (original)
+++ trunk/libs/math/test/spherical_harmonic.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,8 +3,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 6>, 1000> spherical_harmonic = {{
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 6>, 1000> spherical_harmonic = {{
       {{ SC_(0.2e1), SC_(0), SC_(-0.6223074436187744140625e1), SC_(-0.983176708221435546875e0), SC_(0.62736841735769885881246893757736785347239567286304e0), SC_(0) }},
       {{ SC_(0.2e1), SC_(0), SC_(-0.5057456493377685546875e1), SC_(0.59339153766632080078125e0), SC_(-0.20713028443163886820218719974386053923059852163073e0), SC_(0) }},
       {{ SC_(0.2e1), SC_(0), SC_(-0.4687422275543212890625e1), SC_(0.5891966342926025390625e1), SC_(-0.31480190270523966739513025513763623833894947272512e0), SC_(0) }},

Added: trunk/libs/math/test/table_type.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/table_type.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -0,0 +1,36 @@
+
+#ifndef BOOST_MATH_TEST_TABLE_TYPE_HPP
+#define BOOST_MATH_TEST_TABLE_TYPE_HPP
+
+template <class T>
+struct table_type
+{
+ typedef T type;
+};
+
+namespace boost{ namespace math{ namespace concepts{
+
+ class real_concept;
+
+}}}
+
+template <>
+struct table_type<boost::math::concepts::real_concept>
+{
+ typedef long double type;
+};
+
+namespace boost{ namespace multiprecision{
+
+ template <class Backend>
+ class mp_number;
+
+}}
+
+template <class Backend>
+struct table_type<boost::multiprecision::mp_number<Backend> >
+{
+ typedef const char* type;
+};
+
+#endif

Modified: trunk/libs/math/test/test_bessel_i.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_i.hpp (original)
+++ trunk/libs/math/test/test_bessel_i.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,9 +14,10 @@
 
 #include "handle_test_result.hpp"
 #include "test_bessel_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+# define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
@@ -27,11 +28,11 @@
       boost::math::itrunc(v), x));
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_i(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -48,10 +49,10 @@
    //
    // test cyl_bessel_i against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_i", test_name);
    std::cout << std::endl;
 
@@ -75,11 +76,11 @@
 #endif
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_i_int(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -96,10 +97,10 @@
    //
    // test cyl_bessel_i against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_i", test_name);
    std::cout << std::endl;
 }
@@ -114,8 +115,8 @@
         {{ SC_(0), SC_(-2), SC_(2.27958530233606726743720444081153335328584110278545905407084) }},
         {{ SC_(0), SC_(4), SC_(11.3019219521363304963562701832171024974126165944353377060065) }},
         {{ SC_(0), SC_(-7), SC_(168.593908510289698857326627187500840376522679234531714193194) }},
- {{ SC_(0), SC_(1) / 1024, SC_(1.00000023841859331241759166109699567801556273303717896447683) }},
- {{ SC_(0), SC_(1) / (1024*1024), SC_(1.00000000000022737367544324498417583090700894607432256476338) }},
+ {{ SC_(0), T(1) / 1024, SC_(1.00000023841859331241759166109699567801556273303717896447683) }},
+ {{ SC_(0), T(SC_(1)) / (1024*1024), SC_(1.00000000000022737367544324498417583090700894607432256476338) }},
         {{ SC_(0), SC_(-1), SC_(1.26606587775200833559824462521471753760767031135496220680814) }},
         {{ SC_(0), SC_(100), SC_(1.07375170713107382351972085760349466128840319332527279540154e42) }},
         {{ SC_(0), SC_(200), SC_(2.03968717340972461954167312677945962233267573614834337894328e85) }},
@@ -126,15 +127,15 @@
         {{ SC_(1), SC_(-2), SC_(-1.59063685463732906338225442499966624795447815949553664713229) }},
         {{ SC_(1), SC_(4), SC_(9.75946515370444990947519256731268090005597033325296730692753) }},
         {{ SC_(1), SC_(-8), SC_(-399.873136782560098219083086145822754889628443904067647306574) }},
- {{ SC_(1), SC_(1)/1024, SC_(0.000488281308207663226432087816784315537514225208473395063575150) }},
- {{ SC_(1), SC_(1)/(1024*1024), SC_(4.76837158203179210108624277276025646653133998635956784292029E-7) }},
+ {{ SC_(1), T(SC_(1))/1024, SC_(0.000488281308207663226432087816784315537514225208473395063575150) }},
+ {{ SC_(1), T(SC_(1))/(1024*1024), SC_(4.76837158203179210108624277276025646653133998635956784292029E-7) }},
         {{ SC_(1), SC_(-10), SC_(-2670.98830370125465434103196677215254914574515378753771310849) }},
         {{ SC_(1), SC_(100), SC_(1.06836939033816248120614576322429526544612284405623226965918e42) }},
         {{ SC_(1), SC_(200), SC_(2.03458154933206270342742797713906950389661161681122964159220e85) }},
     }};
     static const boost::array<boost::array<T, 3>, 11> in_data = {{
         {{ SC_(-2), SC_(0), SC_(0) }},
- {{ SC_(2), SC_(1)/(1024*1024), SC_(1.13686837721624646204093977095674566928522671779753217215467e-13) }},
+ {{ SC_(2), T(SC_(1))/(1024*1024), SC_(1.13686837721624646204093977095674566928522671779753217215467e-13) }},
         {{ SC_(5), SC_(10), SC_(777.188286403259959907293484802339632852674154572666041953297) }},
         {{ SC_(-5), SC_(100), SC_(9.47009387303558124618275555002161742321578485033007130107740e41) }},
         {{ SC_(-5), SC_(-1), SC_(-0.000271463155956971875181073905153777342383564426758143634974124) }},
@@ -146,16 +147,16 @@
         {{ SC_(10), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070546737213403880e-1010) }},
     }};
     static const boost::array<boost::array<T, 3>, 10> iv_data = {{
- {{ SC_(2.25), SC_(1)/(1024*1024), SC_(2.34379212133481347189068464680335815256364262507955635911656e-15) }},
+ {{ SC_(2.25), T(1)/(1024*1024), SC_(2.34379212133481347189068464680335815256364262507955635911656e-15) }},
         {{ SC_(5.5), SC_(3.125), SC_(0.0583514045989371500460946536220735787163510569634133670181210) }},
- {{ SC_(-5) + T(1)/1024, SC_(2.125), SC_(0.0267920938009571023702933210070984416052633027166975342895062) }},
+ {{ T(-5) + T(1)/1024, SC_(2.125), SC_(0.0267920938009571023702933210070984416052633027166975342895062) }},
         {{ SC_(-5.5), SC_(10), SC_(597.577606961369169607937419869926705730305175364662688426534) }},
         {{ SC_(-5.5), SC_(100), SC_(9.22362906144706871737354069133813819358704200689067071415379e41) }},
- {{ SC_(-10486074)/(1024*1024), SC_(1)/1024, SC_(1.41474005665181350367684623930576333542989766867888186478185e35) }},
- {{ SC_(-10486074)/(1024*1024), SC_(50), SC_(1.07153277202900671531087024688681954238311679648319534644743e20) }},
- {{ SC_(144794)/1024, SC_(100), SC_(2066.27694757392660413922181531984160871678224178890247540320) }},
- {{ SC_(144794)/1024, SC_(200), SC_(2.23699739472246928794922868978337381373643889659337595319774e64) }},
- {{ SC_(-144794)/1024, SC_(100), SC_(2066.27694672763190927440969155740243346136463461655104698748) }},
+ {{ T(-10486074)/(1024*1024), T(1)/1024, SC_(1.41474005665181350367684623930576333542989766867888186478185e35) }},
+ {{ T(-10486074)/(1024*1024), SC_(50), SC_(1.07153277202900671531087024688681954238311679648319534644743e20) }},
+ {{ T(144794)/1024, SC_(100), SC_(2066.27694757392660413922181531984160871678224178890247540320) }},
+ {{ T(144794)/1024, SC_(200), SC_(2.23699739472246928794922868978337381373643889659337595319774e64) }},
+ {{ T(-144794)/1024, SC_(100), SC_(2066.27694672763190927440969155740243346136463461655104698748) }},
     }};
     static const boost::array<boost::array<T, 3>, 5> iv_large_data = {{
         // Bug report https://svn.boost.org/trac/boost/ticket/5560:
@@ -166,22 +167,22 @@
         {{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
     }};
 
- do_test_cyl_bessel_i(i0_data, name, "Bessel I0: Mathworld Data");
- do_test_cyl_bessel_i(i1_data, name, "Bessel I1: Mathworld Data");
- do_test_cyl_bessel_i(in_data, name, "Bessel In: Mathworld Data");
-
- do_test_cyl_bessel_i_int(i0_data, name, "Bessel I0: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_i_int(i1_data, name, "Bessel I1: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_i_int(in_data, name, "Bessel In: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_i<T>(i0_data, name, "Bessel I0: Mathworld Data");
+ do_test_cyl_bessel_i<T>(i1_data, name, "Bessel I1: Mathworld Data");
+ do_test_cyl_bessel_i<T>(in_data, name, "Bessel In: Mathworld Data");
+
+ do_test_cyl_bessel_i_int<T>(i0_data, name, "Bessel I0: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_i_int<T>(i1_data, name, "Bessel I1: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_i_int<T>(in_data, name, "Bessel In: Mathworld Data (Integer Version)");
 
- do_test_cyl_bessel_i(iv_data, name, "Bessel Iv: Mathworld Data");
+ do_test_cyl_bessel_i<T>(iv_data, name, "Bessel Iv: Mathworld Data");
 
 #include "bessel_i_int_data.ipp"
- do_test_cyl_bessel_i(bessel_i_int_data, name, "Bessel In: Random Data");
+ do_test_cyl_bessel_i<T>(bessel_i_int_data, name, "Bessel In: Random Data");
 #include "bessel_i_data.ipp"
- do_test_cyl_bessel_i(bessel_i_data, name, "Bessel Iv: Random Data");
+ do_test_cyl_bessel_i<T>(bessel_i_data, name, "Bessel Iv: Random Data");
 
     if(0 != static_cast<T>(ldexp(0.5, -700)))
- do_test_cyl_bessel_i(iv_large_data, name, "Bessel Iv: Mathworld Data (large values)");
+ do_test_cyl_bessel_i<T>(iv_large_data, name, "Bessel Iv: Mathworld Data (large values)");
 }
 

Modified: trunk/libs/math/test/test_bessel_j.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_j.hpp (original)
+++ trunk/libs/math/test/test_bessel_j.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,16 +14,17 @@
 
 #include "handle_test_result.hpp"
 #include "test_bessel_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+# define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_j(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -40,10 +41,10 @@
    //
    // test cyl_bessel_j against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_j", test_name);
    std::cout << std::endl;
 
@@ -55,10 +56,10 @@
       //
       // test other::cyl_bessel_j against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::cyl_bessel_j", test_name);
       std::cout << std::endl;
    }
@@ -72,11 +73,11 @@
 }
 
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_j_int(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -93,19 +94,19 @@
    //
    // test cyl_bessel_j against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_j", test_name);
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_sph_bessel_j(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -124,10 +125,10 @@
    //
    // test sph_bessel against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::sph_bessel", test_name);
    std::cout << std::endl;
 }
@@ -142,7 +143,7 @@
    // three items, input value a, input value b and erf(a, b):
    //
     // function values calculated on http://functions.wolfram.com/
- static const boost::array<boost::array<T, 3>, 8> j0_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j0_data = {{
        {{ SC_(0), SC_(0), SC_(1) }},
         {{ SC_(0), SC_(1), SC_(0.7651976865579665514497175261026632209093) }},
         {{ SC_(0), SC_(-2), SC_(0.2238907791412356680518274546499486258252) }},
@@ -157,13 +158,13 @@
        {{ SC_(0), SC_(1e+03), SC_(0.02478668615242017456133073111569370878617) }},
         {{ SC_(0), SC_(1e+05), SC_(-0.001719201116235972192570601477073201747532) }},
         // test at the roots:
- {{ SC_(0), SC_(2521642)/(1024 * 1024), SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) }},
- {{ SC_(0), SC_(5788221)/(1024 * 1024), SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) }},
- {{ SC_(0), SC_(9074091)/(1024 * 1024), SC_(1.03553057441100845081018471279571355857520645127532785991335e-7) }},
- {{ SC_(0), SC_(12364320)/(1024 * 1024), SC_(-3.53017140778223781420794006033810387155048392363051866610931e-9) }}
+ {{ SC_(0), T(2521642)/(1024 * 1024), SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) }},
+ {{ SC_(0), T(5788221)/(1024 * 1024), SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) }},
+ {{ SC_(0), T(9074091)/(1024 * 1024), SC_(1.03553057441100845081018471279571355857520645127532785991335e-7) }},
+ {{ SC_(0), T(12364320)/(1024 * 1024), SC_(-3.53017140778223781420794006033810387155048392363051866610931e-9) }}
     }};
 
- static const boost::array<boost::array<T, 3>, 8> j1_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j1_data = {{
         {{ SC_(1), SC_(0), SC_(0) }},
         {{ SC_(1), SC_(1), SC_(0.4400505857449335159596822037189149131274) }},
         {{ SC_(1), SC_(-2), SC_(-0.5767248077568733872024482422691370869203) }},
@@ -178,12 +179,12 @@
         {{ SC_(1), SC_(1e+03), SC_(4.728311907089523917576071901216916285418e-03) }},
         {{ SC_(1), SC_(1e+05), SC_(1.846757562882567716362123967114215743694e-03) }},
         // test zeros:
- {{ SC_(1), SC_(4017834)/(1024*1024), SC_(3.53149033321258645807835062770856949751958513973522222203044e-7) }},
- {{ SC_(1), SC_(7356375)/(1024*1024), SC_(-2.31227973111067286051984021150135526024117175836722748404342e-7) }},
- {{ SC_(1), SC_(10667654)/(1024*1024), SC_(1.24591331097191900488116495350277530373473085499043086981229e-7) }},
+ {{ SC_(1), T(4017834)/(1024*1024), SC_(3.53149033321258645807835062770856949751958513973522222203044e-7) }},
+ {{ SC_(1), T(7356375)/(1024*1024), SC_(-2.31227973111067286051984021150135526024117175836722748404342e-7) }},
+ {{ SC_(1), T(10667654)/(1024*1024), SC_(1.24591331097191900488116495350277530373473085499043086981229e-7) }},
     }};
 
- static const boost::array<boost::array<T, 3>, 16> jn_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 16> jn_data = {{
         // This first one is a modified test case from https://svn.boost.org/trac/boost/ticket/2733
         {{ SC_(-1), SC_(1.25), SC_(-0.510623260319880467069474837274910375352924050139633057168856) }},
         {{ SC_(2), SC_(0), SC_(0) }},
@@ -202,23 +203,23 @@
         {{ SC_(1e+03), SC_(1e+05), SC_(1.283178112502480365195139312635384057363e-03) }},
         {{ SC_(10), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070546737213403880e-1010) }},
     }};
- do_test_cyl_bessel_j(j0_data, name, "Bessel J0: Mathworld Data");
- do_test_cyl_bessel_j(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases)");
- do_test_cyl_bessel_j(j1_data, name, "Bessel J1: Mathworld Data");
- do_test_cyl_bessel_j(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases)");
- do_test_cyl_bessel_j(jn_data, name, "Bessel JN: Mathworld Data");
-
- do_test_cyl_bessel_j_int(j0_data, name, "Bessel J0: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_j_int(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases) (Integer Version)");
- do_test_cyl_bessel_j_int(j1_data, name, "Bessel J1: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_j_int(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases) (Integer Version)");
- do_test_cyl_bessel_j_int(jn_data, name, "Bessel JN: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_j<T>(j0_data, name, "Bessel J0: Mathworld Data");
+ do_test_cyl_bessel_j<T>(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases)");
+ do_test_cyl_bessel_j<T>(j1_data, name, "Bessel J1: Mathworld Data");
+ do_test_cyl_bessel_j<T>(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases)");
+ do_test_cyl_bessel_j<T>(jn_data, name, "Bessel JN: Mathworld Data");
+
+ do_test_cyl_bessel_j_int<T>(j0_data, name, "Bessel J0: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_j_int<T>(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases) (Integer Version)");
+ do_test_cyl_bessel_j_int<T>(j1_data, name, "Bessel J1: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_j_int<T>(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases) (Integer Version)");
+ do_test_cyl_bessel_j_int<T>(jn_data, name, "Bessel JN: Mathworld Data (Integer Version)");
 
     static const boost::array<boost::array<T, 3>, 18> jv_data = {{
         //SC_(-2.4), {{ SC_(0), std::numeric_limits<T>::infinity() }},
- {{ SC_(2457)/1024, SC_(1)/1024, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) }},
- {{ SC_(5.5), SC_(3217)/1024, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
- {{ SC_(-5.5), SC_(3217)/1024, SC_(-2.55820064470647911823175836997490971806135336759164272675969) }},
+ {{ T(2457)/1024, T(1)/1024, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) }},
+ {{ SC_(5.5), T(3217)/1024, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
+ {{ SC_(-5.5), T(3217)/1024, SC_(-2.55820064470647911823175836997490971806135336759164272675969) }},
         {{ SC_(-5.5), SC_(1e+04), SC_(2.449843111985605522111159013846599118397e-03) }},
         {{ SC_(5.5), SC_(1e+04), SC_(0.00759343502722670361395585198154817047185480147294665270646578) }},
         {{ SC_(5.5), SC_(1e+06), SC_(-0.000747424248595630177396350688505919533097973148718960064663632) }},
@@ -228,15 +229,15 @@
         {{ SC_(-5.5), SC_(1e+04), SC_(0.00244984311198560552211115901384659911839737686676766460822577) }},
         {{ SC_(-5.5), SC_(1e+06), SC_(0.000279243200433579511095229508894156656558211060453622750659554) }},
         {{ SC_(-0.5), SC_(101), SC_(0.0708184798097594268482290389188138201440114881159344944791454) }},
- {{ SC_(-10486074) / (1024*1024), SC_(1)/1024, SC_(1.41474013160494695750009004222225969090304185981836460288562e35) }},
- {{ SC_(-10486074) / (1024*1024), SC_(15), SC_(-0.0902239288885423309568944543848111461724911781719692852541489) }},
- {{ SC_(10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547064914615137807616774867984047583596945624129838091326863) }},
- {{ SC_(10486074) / (1024*1024), SC_(2e+04), SC_(-0.00556783614400875611650958980796060611309029233226596737701688) }},
- {{ SC_(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547613660316806551338637153942604550779513947674222863858713) }},
+ {{ T(-10486074) / (1024*1024), T(1)/1024, SC_(1.41474013160494695750009004222225969090304185981836460288562e35) }},
+ {{ T(-10486074) / (1024*1024), SC_(15), SC_(-0.0902239288885423309568944543848111461724911781719692852541489) }},
+ {{ T(10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547064914615137807616774867984047583596945624129838091326863) }},
+ {{ T(10486074) / (1024*1024), SC_(2e+04), SC_(-0.00556783614400875611650958980796060611309029233226596737701688) }},
+ {{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547613660316806551338637153942604550779513947674222863858713) }},
         // Bug report https://svn.boost.org/trac/boost/ticket/4812:
- {{ SC_(1.5), SC_(8034)/1024, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
+ {{ SC_(1.5), T(8034)/1024, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
     }};
- do_test_cyl_bessel_j(jv_data, name, "Bessel J: Mathworld Data");
+ do_test_cyl_bessel_j<T>(jv_data, name, "Bessel J: Mathworld Data");
     static const boost::array<boost::array<T, 3>, 4> jv_large_data = {{
         // Bug report https://svn.boost.org/trac/boost/ticket/5560:
         {{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(7.14823099969225685526188875418476476336424046896822867989728e102) }},
@@ -245,18 +246,18 @@
         {{ SC_(-2.5), SC_(4), SC_(-0.0145679476685218007666785535204236327832335803441449596297004) }},
     }};
     if(jv_large_data[0][1] != 0)
- do_test_cyl_bessel_j(jv_data, name, "Bessel J: Mathworld Data (large values)");
+ do_test_cyl_bessel_j<T>(jv_data, name, "Bessel J: Mathworld Data (large values)");
 
 #include "bessel_j_int_data.ipp"
- do_test_cyl_bessel_j(bessel_j_int_data, name, "Bessel JN: Random Data");
+ do_test_cyl_bessel_j<T>(bessel_j_int_data, name, "Bessel JN: Random Data");
 
 #include "bessel_j_data.ipp"
- do_test_cyl_bessel_j(bessel_j_data, name, "Bessel J: Random Data");
+ do_test_cyl_bessel_j<T>(bessel_j_data, name, "Bessel J: Random Data");
 
 #include "bessel_j_large_data.ipp"
- do_test_cyl_bessel_j(bessel_j_large_data, name, "Bessel J: Random Data (Tricky large values)");
+ do_test_cyl_bessel_j<T>(bessel_j_large_data, name, "Bessel J: Random Data (Tricky large values)");
 
 #include "sph_bessel_data.ipp"
- do_test_sph_bessel_j(sph_bessel_data, name, "Bessel j: Random Data");
+ do_test_sph_bessel_j<T>(sph_bessel_data, name, "Bessel j: Random Data");
 }
 

Modified: trunk/libs/math/test/test_bessel_k.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_k.hpp (original)
+++ trunk/libs/math/test/test_bessel_k.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,9 +14,10 @@
 
 #include "handle_test_result.hpp"
 #include "test_bessel_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+# define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
@@ -27,11 +28,11 @@
       boost::math::itrunc(v), x));
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_k(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -48,10 +49,10 @@
    //
    // test cyl_bessel_k against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_k", test_name);
    std::cout << std::endl;
 
@@ -63,21 +64,21 @@
       //
       // test other::cyl_bessel_k against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::cyl_bessel_k");
       std::cout << std::endl;
    }
 #endif
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_bessel_k_int(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -94,10 +95,10 @@
    //
    // test cyl_bessel_k against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_bessel_k", test_name);
    std::cout << std::endl;
 }
@@ -143,14 +144,14 @@
         {{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }},
         {{ SC_(0.5), SC_(1.125), SC_(0.383621010650189547146769320487006220295290256657827220786527) }},
         {{ SC_(2.25), T(std::ldexp(1.0, -30)), SC_(5.62397392719283271332307799146649700147907612095185712015604e20) }},
- {{ SC_(5.5), SC_(3217)/1024, SC_(1.30623288775012596319554857587765179889689223531159532808379) }},
+ {{ SC_(5.5), T(3217)/1024, SC_(1.30623288775012596319554857587765179889689223531159532808379) }},
         {{ SC_(-5.5), SC_(10), SC_(0.0000733045300798502164644836879577484533096239574909573072142667) }},
         {{ SC_(-5.5), SC_(100), SC_(5.41274555306792267322084448693957747924412508020839543293369e-45) }},
- {{ SC_(10240)/1024, SC_(1)/1024, SC_(2.35522579263922076203415803966825431039900000000993410734978e38) }},
- {{ SC_(10240)/1024, SC_(10), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
- {{ SC_(144793)/1024, SC_(100), SC_(1.39565245860302528069481472855619216759142225046370312329416e-6) }},
- {{ SC_(144793)/1024, SC_(200), SC_(9.11950412043225432171915100042647230802198254567007382956336e-68) }},
- {{ SC_(-144793)/1024, SC_(50), SC_(1.30185229717525025165362673848737761549946548375142378172956e42) }},
+ {{ T(10240)/1024, T(1)/1024, SC_(2.35522579263922076203415803966825431039900000000993410734978e38) }},
+ {{ T(10240)/1024, SC_(10), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
+ {{ T(144793)/1024, SC_(100), SC_(1.39565245860302528069481472855619216759142225046370312329416e-6) }},
+ {{ T(144793)/1024, SC_(200), SC_(9.11950412043225432171915100042647230802198254567007382956336e-68) }},
+ {{ T(-144793)/1024, SC_(50), SC_(1.30185229717525025165362673848737761549946548375142378172956e42) }},
     }};
     static const boost::array<boost::array<T, 3>, 5> kv_large_data = {{
         // Bug report https://svn.boost.org/trac/boost/ticket/5560:
@@ -161,20 +162,20 @@
         {{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(1.12284149973980088540335945247019177715948513804063794284101e103) }},
     }};
 
- do_test_cyl_bessel_k(k0_data, name, "Bessel K0: Mathworld Data");
- do_test_cyl_bessel_k(k1_data, name, "Bessel K1: Mathworld Data");
- do_test_cyl_bessel_k(kn_data, name, "Bessel Kn: Mathworld Data");
-
- do_test_cyl_bessel_k_int(k0_data, name, "Bessel K0: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_k_int(k1_data, name, "Bessel K1: Mathworld Data (Integer Version)");
- do_test_cyl_bessel_k_int(kn_data, name, "Bessel Kn: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_k<T>(k0_data, name, "Bessel K0: Mathworld Data");
+ do_test_cyl_bessel_k<T>(k1_data, name, "Bessel K1: Mathworld Data");
+ do_test_cyl_bessel_k<T>(kn_data, name, "Bessel Kn: Mathworld Data");
+
+ do_test_cyl_bessel_k_int<T>(k0_data, name, "Bessel K0: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_k_int<T>(k1_data, name, "Bessel K1: Mathworld Data (Integer Version)");
+ do_test_cyl_bessel_k_int<T>(kn_data, name, "Bessel Kn: Mathworld Data (Integer Version)");
 
- do_test_cyl_bessel_k(kv_data, name, "Bessel Kv: Mathworld Data");
+ do_test_cyl_bessel_k<T>(kv_data, name, "Bessel Kv: Mathworld Data");
     if(0 != static_cast<T>(ldexp(0.5, -512)))
- do_test_cyl_bessel_k(kv_large_data, name, "Bessel Kv: Mathworld Data (large values)");
+ do_test_cyl_bessel_k<T>(kv_large_data, name, "Bessel Kv: Mathworld Data (large values)");
 #include "bessel_k_int_data.ipp"
- do_test_cyl_bessel_k(bessel_k_int_data, name, "Bessel Kn: Random Data");
+ do_test_cyl_bessel_k<T>(bessel_k_int_data, name, "Bessel Kn: Random Data");
 #include "bessel_k_data.ipp"
- do_test_cyl_bessel_k(bessel_k_data, name, "Bessel Kv: Random Data");
+ do_test_cyl_bessel_k<T>(bessel_k_data, name, "Bessel Kv: Random Data");
 }
 

Modified: trunk/libs/math/test/test_bessel_y.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_y.hpp (original)
+++ trunk/libs/math/test/test_bessel_y.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,16 +14,17 @@
 
 #include "handle_test_result.hpp"
 #include "test_bessel_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+# define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_neumann_y(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -40,10 +41,10 @@
    //
    // test cyl_neumann against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_neumann", test_name);
    std::cout << std::endl;
 
@@ -55,10 +56,10 @@
       //
       // test other::cyl_neumann against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::cyl_neumann", test_name);
       std::cout << std::endl;
    }
@@ -71,11 +72,11 @@
    return static_cast<T>(boost::math::cyl_neumann(boost::math::itrunc(v), x));
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_cyl_neumann_y_int(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -92,19 +93,19 @@
    //
    // test cyl_neumann against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_neumann", test_name);
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_sph_neumann_y(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -123,10 +124,10 @@
    //
    // test sph_neumann against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cyl_neumann", test_name);
    std::cout << std::endl;
 }
@@ -141,7 +142,7 @@
    // three items, input value a, input value b and erf(a, b):
    //
     // function values calculated on http://functions.wolfram.com/
- static const boost::array<boost::array<T, 3>, 9> y0_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> y0_data = {{
         {{ SC_(0), SC_(1), SC_(0.0882569642156769579829267660235151628278175230906755467110438) }},
         {{ SC_(0), SC_(2), SC_(0.510375672649745119596606592727157873268139227085846135571839) }},
         {{ SC_(0), SC_(4), SC_(-0.0169407393250649919036351344471532182404925898980149027169321) }},
@@ -152,7 +153,7 @@
         {{ SC_(0), SC_(1e+03), SC_(0.00471591797762281339977326146566525500985900489680197718528000) }},
         {{ SC_(0), SC_(1e+05), SC_(0.00184676615886506410434074102431546125884886798090392516843524) }}
     }};
- static const boost::array<boost::array<T, 3>, 9> y1_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> y1_data = {{
         {{ SC_(1), SC_(1), SC_(-0.781212821300288716547150000047964820549906390716444607843833) }},
         {{ SC_(1), SC_(2), SC_(-0.107032431540937546888370772277476636687480898235053860525795) }},
         {{ SC_(1), SC_(4), SC_(0.397925710557100005253979972450791852271189181622908340876586) }},
@@ -163,7 +164,7 @@
         {{ SC_(1), SC_(1e+03), SC_(-0.0247843312923517789148623560971412909386318548648705287583490) }},
         {{ SC_(1), SC_(1e+05), SC_(0.00171921035008825630099494523539897102954509504993494957572726) }}
     }};
- static const boost::array<boost::array<T, 3>, 10> yn_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 10> yn_data = {{
         {{ SC_(2), SC_(1e-20), SC_(-1.27323954473516268615107010698011489627570899691226996904849e40) }},
         {{ SC_(5), SC_(10), SC_(0.135403047689362303197029014762241709088405766746419538495983) }},
         {{ SC_(-5), SC_(1e+06), SC_(0.000331052088322609048503535570014688967096938338061796192422114) }},
@@ -177,12 +178,12 @@
     }};
     static const boost::array<boost::array<T, 3>, 9> yv_data = {{
         //SC_(2.25), {{ SC_(1) / 1024, SC_(-1.01759203636941035147948317764932151601257765988969544340275e7) }},
- {{ SC_(0.5), SC_(1) / (1024*1024), SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
+ {{ SC_(0.5), T(1) / (1024*1024), SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
         {{ SC_(5.5), SC_(3.125), SC_(-2.61489440328417468776474188539366752698192046890955453259866) }},
         {{ SC_(-5.5), SC_(3.125), SC_(-0.0274994493896489729948109971802244976377957234563871795364056) }},
         {{ SC_(-5.5), SC_(1e+04), SC_(-0.00759343502722670361395585198154817047185480147294665270646578) }},
- {{ SC_(-10486074) / (1024*1024), SC_(1)/1024, SC_(-1.50382374389531766117868938966858995093408410498915220070230e38) }},
- {{ SC_(-10486074) / (1024*1024), SC_(1e+02), SC_(0.0583041891319026009955779707640455341990844522293730214223545) }},
+ {{ T(-10486074) / (1024*1024), T(1)/1024, SC_(-1.50382374389531766117868938966858995093408410498915220070230e38) }},
+ {{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(0.0583041891319026009955779707640455341990844522293730214223545) }},
         {{ SC_(141.75), SC_(1e+02), SC_(-5.38829231428696507293191118661269920130838607482708483122068e9) }},
         {{ SC_(141.75), SC_(2e+04), SC_(-0.00376577888677186194728129112270988602876597726657372330194186) }},
         {{ SC_(-141.75), SC_(1e+02), SC_(-3.81009803444766877495905954105669819951653361036342457919021e9) }},
@@ -198,24 +199,24 @@
         {{ SC_(10.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-4.15729476804920974669173904282420477878640623992500096231384e167) }},
     }};
 
- do_test_cyl_neumann_y(y0_data, name, "Y0: Mathworld Data");
- do_test_cyl_neumann_y(y1_data, name, "Y1: Mathworld Data");
- do_test_cyl_neumann_y(yn_data, name, "Yn: Mathworld Data");
- do_test_cyl_neumann_y_int(y0_data, name, "Y0: Mathworld Data (Integer Version)");
- do_test_cyl_neumann_y_int(y1_data, name, "Y1: Mathworld Data (Integer Version)");
- do_test_cyl_neumann_y_int(yn_data, name, "Yn: Mathworld Data (Integer Version)");
- do_test_cyl_neumann_y(yv_data, name, "Yv: Mathworld Data");
+ do_test_cyl_neumann_y<T>(y0_data, name, "Y0: Mathworld Data");
+ do_test_cyl_neumann_y<T>(y1_data, name, "Y1: Mathworld Data");
+ do_test_cyl_neumann_y<T>(yn_data, name, "Yn: Mathworld Data");
+ do_test_cyl_neumann_y_int<T>(y0_data, name, "Y0: Mathworld Data (Integer Version)");
+ do_test_cyl_neumann_y_int<T>(y1_data, name, "Y1: Mathworld Data (Integer Version)");
+ do_test_cyl_neumann_y_int<T>(yn_data, name, "Yn: Mathworld Data (Integer Version)");
+ do_test_cyl_neumann_y<T>(yv_data, name, "Yv: Mathworld Data");
     if(yv_large_data[0][1] != 0)
- do_test_cyl_neumann_y(yv_large_data, name, "Yv: Mathworld Data (large values)");
+ do_test_cyl_neumann_y<T>(yv_large_data, name, "Yv: Mathworld Data (large values)");
 
 #include "bessel_y01_data.ipp"
- do_test_cyl_neumann_y(bessel_y01_data, name, "Y0 and Y1: Random Data");
+ do_test_cyl_neumann_y<T>(bessel_y01_data, name, "Y0 and Y1: Random Data");
 #include "bessel_yn_data.ipp"
- do_test_cyl_neumann_y(bessel_yn_data, name, "Yn: Random Data");
+ do_test_cyl_neumann_y<T>(bessel_yn_data, name, "Yn: Random Data");
 #include "bessel_yv_data.ipp"
- do_test_cyl_neumann_y(bessel_yv_data, name, "Yv: Random Data");
+ do_test_cyl_neumann_y<T>(bessel_yv_data, name, "Yv: Random Data");
 
 #include "sph_neumann_data.ipp"
- do_test_sph_neumann_y(sph_neumann_data, name, "y: Random Data");
+ do_test_sph_neumann_y<T>(sph_neumann_data, name, "y: Random Data");
 }
 

Modified: trunk/libs/math/test/test_beta.hpp
==============================================================================
--- trunk/libs/math/test/test_beta.hpp (original)
+++ trunk/libs/math/test/test_beta.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -23,18 +23,19 @@
 
 #include "test_beta_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #undef small // VC++ #defines small char !!!!!!
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_beta(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -51,18 +52,18 @@
    //
    // test beta against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::beta", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::beta;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::beta");
    }
 #endif
@@ -79,15 +80,15 @@
    //
 # include "beta_small_data.ipp"
 
- do_test_beta(beta_small_data, name, "Beta Function: Small Values");
+ do_test_beta<T>(beta_small_data, name, "Beta Function: Small Values");
 
 # include "beta_med_data.ipp"
 
- do_test_beta(beta_med_data, name, "Beta Function: Medium Values");
+ do_test_beta<T>(beta_med_data, name, "Beta Function: Medium Values");
 
 # include "beta_exp_data.ipp"
 
- do_test_beta(beta_exp_data, name, "Beta Function: Divergent Values");
+ do_test_beta<T>(beta_exp_data, name, "Beta Function: Divergent Values");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_binomial.cpp
==============================================================================
--- trunk/libs/math/test/test_binomial.cpp (original)
+++ trunk/libs/math/test/test_binomial.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -31,6 +31,7 @@
 
 #include <boost/test/test_exec_monitor.hpp> // for test_main
 #include <boost/test/floating_point_comparison.hpp> // for BOOST_CHECK_CLOSE
+#include "table_type.hpp"
 
 #include <iostream>
 using std::cout;
@@ -626,13 +627,7 @@
     //7 0.00036621093749999984 0.9999847412109375
     //8 1.52587890625e-005 1 1 0
   }
-#if !defined(TEST_REAL_CONCEPT)
 #define T RealType
-#else
- // This reduces compile time and compiler memory usage by storing test data
- // as an array of long double's rather than an array of real_concept's:
-#define T long double
-#endif
 #include "binomial_quantile.ipp"
 
   for(unsigned i = 0; i < binomial_quantile_data.size(); ++i)

Modified: trunk/libs/math/test/test_binomial_coeff.hpp
==============================================================================
--- trunk/libs/math/test/test_binomial_coeff.hpp (original)
+++ trunk/libs/math/test/test_binomial_coeff.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,10 +14,10 @@
 #include <boost/array.hpp>
 
 #include "handle_test_result.hpp"
-
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
@@ -42,10 +42,10 @@
 
 #include "binomial_data.ipp"
 
- boost::math::tools::test_result<T> result = boost::math::tools::test(
+ boost::math::tools::test_result<T> result = boost::math::tools::test_hetero<T>(
       binomial_data,
- bind_func(f, 0, 1),
- extract_result(2));
+ bind_func<T>(f, 0, 1),
+ extract_result<T>(2));
 
    std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
       "Test results for small arguments and type " << type_name << std::endl << std::endl;
@@ -55,10 +55,10 @@
 
 #include "binomial_large_data.ipp"
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<T>(
       binomial_large_data,
- bind_func(f, 0, 1),
- extract_result(2));
+ bind_func<T>(f, 0, 1),
+ extract_result<T>(2));
 
    std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
       "Test results for large arguments and type " << type_name << std::endl << std::endl;

Modified: trunk/libs/math/test/test_carlson.hpp
==============================================================================
--- trunk/libs/math/test/test_carlson.hpp (original)
+++ trunk/libs/math/test/test_carlson.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,16 +14,17 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_rf(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -34,10 +35,10 @@
 #endif
     boost::math::tools::test_result<value_type> result;
  
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(fp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_rf", test);
 
@@ -45,11 +46,11 @@
 
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_rc(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -60,22 +61,22 @@
 #endif
     boost::math::tools::test_result<value_type> result;
  
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp, 0, 1),
- extract_result(2));
- handle_test_result(result, data[result.worst()], result.worst(),
+ bind_func<Real>(fp, 0, 1),
+ extract_result<Real>(2));
+ handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_rc", test);
 
    std::cout << std::endl;
 
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_rj(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -86,22 +87,22 @@
 #endif
     boost::math::tools::test_result<value_type> result;
  
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp, 0, 1, 2, 3),
- extract_result(4));
- handle_test_result(result, data[result.worst()], result.worst(),
+ bind_func<Real>(fp, 0, 1, 2, 3),
+ extract_result<Real>(4));
+ handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_rf", test);
 
    std::cout << std::endl;
 
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_rd(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -112,11 +113,11 @@
 #endif
     boost::math::tools::test_result<value_type> result;
  
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp, 0, 1, 2),
- extract_result(3));
- handle_test_result(result, data[result.worst()], result.worst(),
+ bind_func<Real>(fp, 0, 1, 2),
+ extract_result<Real>(3));
+ handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_rd", test);
 
    std::cout << std::endl;
@@ -202,18 +203,18 @@
    //
 #include "ellint_rf_data.ipp"
 
- do_test_ellint_rf(ellint_rf_data, type_name, "RF: Random data");
+ do_test_ellint_rf<T>(ellint_rf_data, type_name, "RF: Random data");
 
 #include "ellint_rc_data.ipp"
 
- do_test_ellint_rc(ellint_rc_data, type_name, "RC: Random data");
+ do_test_ellint_rc<T>(ellint_rc_data, type_name, "RC: Random data");
 
 #include "ellint_rj_data.ipp"
 
- do_test_ellint_rj(ellint_rj_data, type_name, "RJ: Random data");
+ do_test_ellint_rj<T>(ellint_rj_data, type_name, "RJ: Random data");
 
 #include "ellint_rd_data.ipp"
 
- do_test_ellint_rd(ellint_rd_data, type_name, "RD: Random data");
+ do_test_ellint_rd<T>(ellint_rd_data, type_name, "RD: Random data");
 }
 

Modified: trunk/libs/math/test/test_cbrt.hpp
==============================================================================
--- trunk/libs/math/test/test_cbrt.hpp (original)
+++ trunk/libs/math/test/test_cbrt.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -15,28 +15,30 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
+template <class Real>
 struct negative_cbrt
 {
    negative_cbrt(){}
 
    template <class S>
- typename S::value_type operator()(const S& row)
+ Real operator()(const S& row)
    {
- return boost::math::cbrt(-row[1]);
+ return boost::math::cbrt(-Real(row[1]));
    }
 };
 
 
-template <class T>
+template <class Real, class T>
 void do_test_cbrt(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -53,14 +55,14 @@
    //
    // test cbrt against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 1),
- extract_result(0));
- result += boost::math::tools::test(
+ bind_func<Real>(funcp, 1),
+ extract_result<Real>(0));
+ result += boost::math::tools::test_hetero<Real>(
       data,
- negative_cbrt(),
- negate(extract_result(0)));
+ negative_cbrt<Real>(),
+ negate<Real>(extract_result<Real>(0)));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::cbrt", test_name);
    std::cout << std::endl;
 }
@@ -75,7 +77,7 @@
    //
 # include "cbrt_data.ipp"
 
- do_test_cbrt(cbrt_data, name, "cbrt Function");
+ do_test_cbrt<T>(cbrt_data, name, "cbrt Function");
 
 }
 

Modified: trunk/libs/math/test/test_digamma.hpp
==============================================================================
--- trunk/libs/math/test/test_digamma.hpp (original)
+++ trunk/libs/math/test/test_digamma.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -12,16 +12,17 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_digamma(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -38,10 +39,10 @@
    //
    // test digamma against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::digamma", test_name);
    std::cout << std::endl;
 }
@@ -57,19 +58,19 @@
    //
 # include "digamma_data.ipp"
 
- do_test_digamma(digamma_data, name, "Digamma Function: Large Values");
+ do_test_digamma<T>(digamma_data, name, "Digamma Function: Large Values");
 
 # include "digamma_root_data.ipp"
 
- do_test_digamma(digamma_root_data, name, "Digamma Function: Near the Positive Root");
+ do_test_digamma<T>(digamma_root_data, name, "Digamma Function: Near the Positive Root");
 
 # include "digamma_small_data.ipp"
 
- do_test_digamma(digamma_small_data, name, "Digamma Function: Near Zero");
+ do_test_digamma<T>(digamma_small_data, name, "Digamma Function: Near Zero");
 
 # include "digamma_neg_data.ipp"
 
- do_test_digamma(digamma_neg_data, name, "Digamma Function: Negative Values");
+ do_test_digamma<T>(digamma_neg_data, name, "Digamma Function: Negative Values");
 
 }
 

Modified: trunk/libs/math/test/test_ellint_1.hpp
==============================================================================
--- trunk/libs/math/test/test_ellint_1.hpp (original)
+++ trunk/libs/math/test/test_ellint_1.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,16 +17,17 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_f(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -37,10 +38,10 @@
 #endif
     boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp2, 1, 0),
- extract_result(2));
+ bind_func<Real>(fp2, 1, 0),
+ extract_result<Real>(2));
     handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_1", test);
 
@@ -48,11 +49,11 @@
 
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_k(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
     boost::math::tools::test_result<value_type> result;
 
    std::cout << "Testing: " << test << std::endl;
@@ -62,10 +63,10 @@
 #else
    value_type (*fp1)(value_type) = boost::math::ellint_1;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0),
- extract_result(1));
+ bind_func<Real>(fp1, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_1", test);
 
@@ -84,10 +85,10 @@
         {{ SC_(-4), SC_(0.875), SC_(-5.3190556182262405182189463092940736859067548232647) }},
         {{ SC_(8), SC_(-0.625), SC_(9.0419973860310100524448893214394562615252527557062) }},
         {{ SC_(1e-05), SC_(0.875), SC_(0.000010000000000127604166668510945638036143355898993088) }},
- {{ SC_(1e+05), SC_(10)/1024, SC_(100002.38431454899771096037307519328741455615271038) }},
+ {{ SC_(1e+05), T(10)/1024, SC_(100002.38431454899771096037307519328741455615271038) }},
         {{ SC_(1e-20), SC_(1), SC_(1.0000000000000000000000000000000000000000166666667e-20) }},
         {{ SC_(1e-20), SC_(1e-20), SC_(1.000000000000000e-20) }},
- {{ SC_(1e+20), SC_(400)/1024, SC_(1.0418143796499216839719289963154558027005142709763e20) }},
+ {{ SC_(1e+20), T(400)/1024, SC_(1.0418143796499216839719289963154558027005142709763e20) }},
         {{ SC_(1e+50), SC_(0.875), SC_(1.3913251718238765549409892714295358043696028445944e50) }},
         {{ SC_(2), SC_(0.5), SC_(2.1765877052210673672479877957388515321497888026770) }},
         {{ SC_(4), SC_(0.5), SC_(4.2543274975235836861894752787874633017836785640477) }},
@@ -99,11 +100,11 @@
         {{ SC_(-10), SC_(0.5), SC_(-10.697409951222544858346795279378531495869386960090) }},
     }};
 
- do_test_ellint_f(data1, type_name, "Elliptic Integral F: Mathworld Data");
+ do_test_ellint_f<T>(data1, type_name, "Elliptic Integral F: Mathworld Data");
 
 #include "ellint_f_data.ipp"
 
- do_test_ellint_f(ellint_f_data, type_name, "Elliptic Integral F: Random Data");
+ do_test_ellint_f<T>(ellint_f_data, type_name, "Elliptic Integral F: Random Data");
 
     // Function values calculated on http://functions.wolfram.com/
     // Note that Mathematica's EllipticK accepts k^2 as the second parameter.
@@ -111,18 +112,18 @@
         {{ SC_(0), SC_(1.5707963267948966192313216916397514420985846996876) }},
         {{ SC_(0.125), SC_(1.5769867712158131421244030532288080803822271060839) }},
         {{ SC_(0.25), SC_(1.5962422221317835101489690714979498795055744578951) }},
- {{ SC_(300)/1024, SC_(1.6062331054696636704261124078746600894998873503208) }},
- {{ SC_(400)/1024, SC_(1.6364782007562008756208066125715722889067992997614) }},
+ {{ T(300)/1024, SC_(1.6062331054696636704261124078746600894998873503208) }},
+ {{ T(400)/1024, SC_(1.6364782007562008756208066125715722889067992997614) }},
         {{ SC_(-0.5), SC_(1.6857503548125960428712036577990769895008008941411) }},
         {{ SC_(-0.75), SC_(1.9109897807518291965531482187613425592531451316788) }},
- {{ 1-SC_(1)/8, SC_(2.185488469278223686913080323730158689730428415766) }},
- {{ 1-SC_(1)/1024, SC_(4.5074135978990422666372495313621124487894807327687) }},
+ {{ 1-T(1)/8, SC_(2.185488469278223686913080323730158689730428415766) }},
+ {{ 1-T(1)/1024, SC_(4.5074135978990422666372495313621124487894807327687) }},
     }};
 
- do_test_ellint_k(data2, type_name, "Elliptic Integral K: Mathworld Data");
+ do_test_ellint_k<T>(data2, type_name, "Elliptic Integral K: Mathworld Data");
 
 #include "ellint_k_data.ipp"
 
- do_test_ellint_k(ellint_k_data, type_name, "Elliptic Integral K: Random Data");
+ do_test_ellint_k<T>(ellint_k_data, type_name, "Elliptic Integral K: Random Data");
 }
 

Modified: trunk/libs/math/test/test_ellint_2.hpp
==============================================================================
--- trunk/libs/math/test/test_ellint_2.hpp (original)
+++ trunk/libs/math/test/test_ellint_2.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,16 +17,17 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_e2(const T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -37,21 +38,21 @@
 #endif
     boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp2, 1, 0),
- extract_result(2));
+ bind_func<Real>(fp2, 1, 0),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_2", test);
 
    std::cout << std::endl;
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_e1(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
     boost::math::tools::test_result<value_type> result;
 
    std::cout << "Testing: " << test << std::endl;
@@ -61,10 +62,10 @@
 #else
    value_type (*fp1)(value_type) = boost::math::ellint_2;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0),
- extract_result(1));
+ bind_func<Real>(fp1, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_2", test);
 
@@ -80,40 +81,40 @@
         {{ SC_(0), SC_(0), SC_(0) }},
         {{ SC_(-10), SC_(0), SC_(-10) }},
         {{ SC_(-1), SC_(-1), SC_(-0.84147098480789650665250232163029899962256306079837) }},
- {{ SC_(-4), SC_(900) / 1024, SC_(-3.1756145986492562317862928524528520686391383168377) }},
- {{ SC_(8), SC_(-600) / 1024, SC_(7.2473147180505693037677015377802777959345489333465) }},
- {{ SC_(1e-05), SC_(800) / 1024, SC_(9.999999999898274739584436515967055859383969942432E-6) }},
- {{ SC_(1e+05), SC_(100) / 1024, SC_(99761.153306972066658135668386691227343323331995888) }},
+ {{ SC_(-4), T(900) / 1024, SC_(-3.1756145986492562317862928524528520686391383168377) }},
+ {{ SC_(8), T(-600) / 1024, SC_(7.2473147180505693037677015377802777959345489333465) }},
+ {{ SC_(1e-05), T(800) / 1024, SC_(9.999999999898274739584436515967055859383969942432E-6) }},
+ {{ SC_(1e+05), T(100) / 1024, SC_(99761.153306972066658135668386691227343323331995888) }},
         {{ SC_(1e+10), SC_(-0.5), SC_(9.3421545766487137036576748555295222252286528414669e9) }},
- {{ static_cast<T>(ldexp(SC_(1), 66)), SC_(400) / 1024, SC_(7.0886102721911705466476846969992069994308167515242e19) }},
- {{ static_cast<T>(ldexp(SC_(1), 166)), SC_(900) / 1024, SC_(7.1259011068364515942912094521783688927118026465790e49) }},
+ {{ static_cast<T>(ldexp(T(1), 66)), T(400) / 1024, SC_(7.0886102721911705466476846969992069994308167515242e19) }},
+ {{ static_cast<T>(ldexp(T(1), 166)), T(900) / 1024, SC_(7.1259011068364515942912094521783688927118026465790e49) }},
     }};
 
- do_test_ellint_e2(data1, type_name, "Elliptic Integral E: Mathworld Data");
+ do_test_ellint_e2<T>(data1, type_name, "Elliptic Integral E: Mathworld Data");
 
 #include "ellint_e2_data.ipp"
 
- do_test_ellint_e2(ellint_e2_data, type_name, "Elliptic Integral E: Random Data");
+ do_test_ellint_e2<T>(ellint_e2_data, type_name, "Elliptic Integral E: Random Data");
 
     // Function values calculated on http://functions.wolfram.com/
     // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
     static const boost::array<boost::array<T, 2>, 10> data2 = {{
         {{ SC_(-1), SC_(1) }},
         {{ SC_(0), SC_(1.5707963267948966192313216916397514420985846996876) }},
- {{ SC_(100) / 1024, SC_(1.5670445330545086723323795143598956428788609133377) }},
- {{ SC_(200) / 1024, SC_(1.5557071588766556854463404816624361127847775545087) }},
- {{ SC_(300) / 1024, SC_(1.5365278991162754883035625322482669608948678755743) }},
- {{ SC_(400) / 1024, SC_(1.5090417763083482272165682786143770446401437564021) }},
+ {{ T(100) / 1024, SC_(1.5670445330545086723323795143598956428788609133377) }},
+ {{ T(200) / 1024, SC_(1.5557071588766556854463404816624361127847775545087) }},
+ {{ T(300) / 1024, SC_(1.5365278991162754883035625322482669608948678755743) }},
+ {{ T(400) / 1024, SC_(1.5090417763083482272165682786143770446401437564021) }},
         {{ SC_(-0.5), SC_(1.4674622093394271554597952669909161360253617523272) }},
- {{ SC_(-600) / 1024, SC_(1.4257538571071297192428217218834579920545946473778) }},
- {{ SC_(-800) / 1024, SC_(1.2927868476159125056958680222998765985004489572909) }},
- {{ SC_(-900) / 1024, SC_(1.1966864890248739524112920627353824133420353430982) }},
+ {{ T(-600) / 1024, SC_(1.4257538571071297192428217218834579920545946473778) }},
+ {{ T(-800) / 1024, SC_(1.2927868476159125056958680222998765985004489572909) }},
+ {{ T(-900) / 1024, SC_(1.1966864890248739524112920627353824133420353430982) }},
     }};
 
- do_test_ellint_e1(data2, type_name, "Elliptic Integral E: Mathworld Data");
+ do_test_ellint_e1<T>(data2, type_name, "Elliptic Integral E: Mathworld Data");
 
 #include "ellint_e_data.ipp"
 
- do_test_ellint_e1(ellint_e_data, type_name, "Elliptic Integral E: Random Data");
+ do_test_ellint_e1<T>(ellint_e_data, type_name, "Elliptic Integral E: Random Data");
 }
 

Modified: trunk/libs/math/test/test_ellint_3.hpp
==============================================================================
--- trunk/libs/math/test/test_ellint_3.hpp (original)
+++ trunk/libs/math/test/test_ellint_3.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,17 +17,18 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_pi3(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -38,10 +39,10 @@
 #endif
     boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp2, 2, 0, 1),
- extract_result(3));
+ bind_func<Real>(fp2, 2, 0, 1),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_3", test);
 
@@ -49,11 +50,11 @@
 
 }
 
-template <typename T>
+template <class Real, typename T>
 void do_test_ellint_pi2(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
@@ -64,10 +65,10 @@
 #endif
     boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp2, 1, 0),
- extract_result(2));
+ bind_func<Real>(fp2, 1, 0),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "boost::math::ellint_3", test);
 
@@ -91,31 +92,31 @@
         {{ SC_(0.75), SC_(0.75), SC_(0), SC_(0.871827580412760575085768367421866079353646112288567703061975) }},
         {{ SC_(1), SC_(0.25), SC_(0), SC_(0.255341921221036266504482236490473678204201638800822621740476) }},
         {{ SC_(2), SC_(0.25), SC_(0), SC_(0.261119051639220165094943572468224137699644963125853641716219) }},
- {{ SC_(1023)/1024, SC_(1.5), SC_(0), SC_(13.2821612239764190363647953338544569682942329604483733197131) }},
+ {{ T(1023)/1024, SC_(1.5), SC_(0), SC_(13.2821612239764190363647953338544569682942329604483733197131) }},
         {{ SC_(0.5), SC_(-1), SC_(0.5), SC_(-1.228014414316220642611298946293865487807) }},
         {{ SC_(0.5), SC_(1e+10), SC_(0.5), SC_(1.536591003599172091573590441336982730551e+10) }},
         {{ SC_(-1e+05), SC_(10), SC_(0.75), SC_(0.0347926099493147087821620459290460547131012904008557007934290) }},
         {{ SC_(-1e+10), SC_(10), SC_(0.875), SC_(0.000109956202759561502329123384755016959364346382187364656768212) }},
         {{ SC_(-1e+10), SC_(1e+20), SC_(0.875), SC_(1.00000626665567332602765201107198822183913978895904937646809e15) }},
- {{ SC_(-1e+10), SC_(1608)/1024, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379) }},
- {{ 1-SC_(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21) }},
+ {{ SC_(-1e+10), T(1608)/1024, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379) }},
+ {{ 1-T(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21) }},
         {{ SC_(50), SC_(0.125), SC_(0.25), SC_(0.196321043776719739372196642514913879497104766409504746018939) }},
         {{ SC_(1.125), SC_(1), SC_(0.25), SC_(1.77299767784815770192352979665283069318388205110727241629752) }},
         {{ SC_(1.125), SC_(10), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487) }},
         {{ SC_(1.125), SC_(3), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178) }},
- {{ SC_(257)/256, SC_(1.5), SC_(0.125), SC_(22.2699300473528164111357290313578126108398839810535700884237) }},
- {{ SC_(257)/256, SC_(21.5), SC_(0.125), SC_(-0.535406081652313940727588125663856894154526187713506526799429) }},
+ {{ T(257)/256, SC_(1.5), SC_(0.125), SC_(22.2699300473528164111357290313578126108398839810535700884237) }},
+ {{ T(257)/256, SC_(21.5), SC_(0.125), SC_(-0.535406081652313940727588125663856894154526187713506526799429) }},
     }};
 
- do_test_ellint_pi3(data1, type_name, "Elliptic Integral PI: Mathworld Data");
+ do_test_ellint_pi3<T>(data1, type_name, "Elliptic Integral PI: Mathworld Data");
 
 #include "ellint_pi3_data.ipp"
 
- do_test_ellint_pi3(ellint_pi3_data, type_name, "Elliptic Integral PI: Random Data");
+ do_test_ellint_pi3<T>(ellint_pi3_data, type_name, "Elliptic Integral PI: Random Data");
 
 #include "ellint_pi3_large_data.ipp"
 
- do_test_ellint_pi3(ellint_pi3_large_data, type_name, "Elliptic Integral PI: Large Random Data");
+ do_test_ellint_pi3<T>(ellint_pi3_large_data, type_name, "Elliptic Integral PI: Large Random Data");
 
     // function values calculated on http://functions.wolfram.com/
     static const boost::array<boost::array<T, 3>, 9> data2 = {{
@@ -126,15 +127,15 @@
         {{ SC_(-4), SC_(0.3), SC_(0.712708870925620061597924858162260293305195624270730660081949) }},
         {{ SC_(-1e+05), SC_(-0.5), SC_(0.00496944596485066055800109163256108604615568144080386919012831) }},
         {{ SC_(-1e+10), SC_(-0.75), SC_(0.0000157080225184890546939710019277357161497407143903832703317801) }},
- {{ SC_(1) / 1024, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287) }},
- {{ SC_(1023)/1024, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997) }},
+ {{ T(1) / 1024, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287) }},
+ {{ T(1023)/1024, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997) }},
     }};
 
- do_test_ellint_pi2(data2, type_name, "Complete Elliptic Integral PI: Mathworld Data");
+ do_test_ellint_pi2<T>(data2, type_name, "Complete Elliptic Integral PI: Mathworld Data");
 
 #include "ellint_pi2_data.ipp"
 
- do_test_ellint_pi2(ellint_pi2_data, type_name, "Complete Elliptic Integral PI: Random Data");
+ do_test_ellint_pi2<T>(ellint_pi2_data, type_name, "Complete Elliptic Integral PI: Random Data");
 
     // Special cases, exceptions etc:
     BOOST_CHECK_THROW(boost::math::ellint_3(T(1.0001), T(-1), T(0)), std::domain_error);

Modified: trunk/libs/math/test/test_erf.hpp
==============================================================================
--- trunk/libs/math/test/test_erf.hpp (original)
+++ trunk/libs/math/test/test_erf.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -15,16 +15,17 @@
 
 #include "test_erf_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_erf(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -41,18 +42,18 @@
    //
    // test erf against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erf", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::erf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::erf");
    }
 #endif
@@ -64,29 +65,29 @@
 #else
    funcp = boost::math::erfc;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(2));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erfc", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::erfc;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind(funcp, 0),
- extract_result(2));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::erfc");
    }
 #endif
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_erf_inv(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 
@@ -101,19 +102,19 @@
 #else
    pg funcp = boost::math::erf_inv;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erf_inv", test_name);
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_erfc_inv(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -133,10 +134,10 @@
 #else
    funcp = boost::math::erfc_inv;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::erfc_inv", test_name);
    std::cout << std::endl;
 }
@@ -152,29 +153,29 @@
    //
 # include "erf_small_data.ipp"
 
- do_test_erf(erf_small_data, name, "Erf Function: Small Values");
+ do_test_erf<T>(erf_small_data, name, "Erf Function: Small Values");
 
 # include "erf_data.ipp"
 
- do_test_erf(erf_data, name, "Erf Function: Medium Values");
+ do_test_erf<T>(erf_data, name, "Erf Function: Medium Values");
 
 # include "erf_large_data.ipp"
 
- do_test_erf(erf_large_data, name, "Erf Function: Large Values");
+ do_test_erf<T>(erf_large_data, name, "Erf Function: Large Values");
 
 # include "erf_inv_data.ipp"
 
- do_test_erf_inv(erf_inv_data, name, "Inverse Erf Function");
+ do_test_erf_inv<T>(erf_inv_data, name, "Inverse Erf Function");
 
 # include "erfc_inv_data.ipp"
 
- do_test_erfc_inv(erfc_inv_data, name, "Inverse Erfc Function");
+ do_test_erfc_inv<T>(erfc_inv_data, name, "Inverse Erfc Function");
 
 # include "erfc_inv_big_data.ipp"
 
    if(std::numeric_limits<T>::min_exponent <= -4500)
    {
- do_test_erfc_inv(erfc_inv_big_data, name, "Inverse Erfc Function: extreme values");
+ do_test_erfc_inv<T>(erfc_inv_big_data, name, "Inverse Erfc Function: extreme values");
    }
 }
 

Modified: trunk/libs/math/test/test_expint.hpp
==============================================================================
--- trunk/libs/math/test/test_expint.hpp (original)
+++ trunk/libs/math/test/test_expint.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,9 +17,10 @@
 
 #include "handle_test_result.hpp"
 #include "test_expint_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
@@ -37,7 +38,7 @@
       boost::math::itrunc(n), z);
 }
 #endif
-template <class T>
+template <class Real, class T>
 void do_test_expint(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -45,7 +46,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -60,10 +61,10 @@
    //
    // test expint against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::expint", test_name);
 #ifdef TEST_OTHER
    if(boost::is_floating_point<value_type>::value && other::expint(2u, 2.0))
@@ -72,17 +73,17 @@
       //
       // test expint against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::expint", test_name);
    }
 #endif
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_expint_Ei(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -90,7 +91,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -105,10 +106,10 @@
    //
    // test expint against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::expint", test_name);
 #ifdef TEST_OTHER
    if(boost::is_floating_point<value_type>::value && other::expint(2.0))
@@ -117,10 +118,10 @@
       //
       // test expint against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::expint", test_name);
    }
 #endif
@@ -133,24 +134,24 @@
    // The actual test data is rather verbose, so it's in a separate file
    //
 #include "expint_data.ipp"
- do_test_expint(expint_data, name, "Exponential Integral En");
+ do_test_expint<T>(expint_data, name, "Exponential Integral En");
 #include "expint_small_data.ipp"
- do_test_expint(expint_small_data, name, "Exponential Integral En: small z values");
+ do_test_expint<T>(expint_small_data, name, "Exponential Integral En: small z values");
 #include "expint_1_data.ipp"
- do_test_expint(expint_1_data, name, "Exponential Integral E1");
+ do_test_expint<T>(expint_1_data, name, "Exponential Integral E1");
 #include "expinti_data.ipp"
- do_test_expint_Ei(expinti_data, name, "Exponential Integral Ei");
+ do_test_expint_Ei<T>(expinti_data, name, "Exponential Integral Ei");
 
    if(boost::math::tools::log_max_value<T>() > 100)
    {
 #include "expinti_data_double.ipp"
- do_test_expint_Ei(expinti_data_double, name, "Exponential Integral Ei: double exponent range");
+ do_test_expint_Ei<T>(expinti_data_double, name, "Exponential Integral Ei: double exponent range");
    }
 #if (defined(LDBL_MAX_10_EXP) && (LDBL_MAX_10_EXP > 2000)) || defined(TEST_UDT)
    if(boost::math::tools::log_max_value<T>() > 1000)
    {
 #include "expinti_data_long.ipp"
- do_test_expint_Ei(expinti_data_long, name, "Exponential Integral Ei: long exponent range");
+ do_test_expint_Ei<T>(expinti_data_long, name, "Exponential Integral Ei: long exponent range");
    }
 #endif
 }

Modified: trunk/libs/math/test/test_gamma.hpp
==============================================================================
--- trunk/libs/math/test/test_gamma.hpp (original)
+++ trunk/libs/math/test/test_gamma.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -19,16 +19,17 @@
 
 #include "test_gamma_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -45,18 +46,18 @@
    //
    // test tgamma against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::tgamma;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::tgamma");
    }
 #endif
@@ -68,18 +69,18 @@
 #else
    funcp = boost::math::lgamma;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(2));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::lgamma", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::lgamma;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0),
- extract_result(2));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::lgamma");
    }
 #endif
@@ -87,11 +88,11 @@
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_gammap1m1(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -108,10 +109,10 @@
    //
    // test tgamma1pm1 against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma1pm1", test_name);
    std::cout << std::endl;
 }
@@ -151,17 +152,17 @@
    //
 # include "test_gamma_data.ipp"
 
- do_test_gamma(factorials, name, "factorials");
- do_test_gamma(near_0, name, "near 0");
- do_test_gamma(near_1, name, "near 1");
- do_test_gamma(near_2, name, "near 2");
- do_test_gamma(near_m10, name, "near -10");
- do_test_gamma(near_m55, name, "near -55");
+ do_test_gamma<T>(factorials, name, "factorials");
+ do_test_gamma<T>(near_0, name, "near 0");
+ do_test_gamma<T>(near_1, name, "near 1");
+ do_test_gamma<T>(near_2, name, "near 2");
+ do_test_gamma<T>(near_m10, name, "near -10");
+ do_test_gamma<T>(near_m55, name, "near -55");
 
    //
    // And now tgamma1pm1 which computes gamma(1+dz)-1:
    //
- do_test_gammap1m1(gammap1m1_data, name, "tgamma1pm1(dz)");
+ do_test_gammap1m1<T>(gammap1m1_data, name, "tgamma1pm1(dz)");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_gamma_data.ipp
==============================================================================
--- trunk/libs/math/test/test_gamma_data.ipp (original)
+++ trunk/libs/math/test/test_gamma_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 198> factorials = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 198> factorials = { {
       {{ SC_(1), SC_(1), SC_(0) }},
       {{ SC_(2), SC_(1), SC_(0) }},
       {{ SC_(3), SC_(2), SC_(0.6931471805599453094172321214581765680755) }},
@@ -205,7 +205,7 @@
    } };
 
 
- static const boost::array<boost::array<T, 3>, 41> near_1 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 41> near_1 = { {
       {{ SC_(0.5), SC_(1.772453850905516027298167483341145182798), SC_(0.5723649429247000870717136756765293558236) }},
       {{ SC_(0.625), SC_(1.434518848090556775636019739456423136632), SC_(0.3608294954889401811849576858227794878574) }},
       {{ SC_(0.75), SC_(1.225416702465177645129098303362890526851), SC_(0.2032809514312953714814329718624296997597) }},
@@ -249,7 +249,7 @@
       {{ SC_(1.5), SC_(0.8862269254527580136490837416705725913988), SC_(-0.1207822376352452223455184457816472122519) }}
    } };
 
- static const boost::array<boost::array<T, 3>, 41> near_2 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 41> near_2 = { {
       {{ SC_(1.5), SC_(0.8862269254527580136490837416705725913988), SC_(-0.1207822376352452223455184457816472122519) }},
       {{ SC_(1.625), SC_(0.8965742800565979847725123371602644603951), SC_(-0.1091741337567953724659793453255625768435) }},
       {{ SC_(1.75), SC_(0.9190625268488832338468237275221678951384), SC_(-0.08440112102048555595778603413139773174384) }},
@@ -293,7 +293,7 @@
       {{ SC_(2.5), SC_(1.329340388179137020473625612505858887098), SC_(0.2846828704729191596324946696827019243201) }}
    } };
 
- static const boost::array<boost::array<T, 3>, 40> near_0 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 40> near_0 = { {
       {{ SC_(-0.5), SC_(-3.544907701811032054596334966682290365595), SC_(1.265512123484645396488945797134705923899) }},
       {{ SC_(-0.375), SC_(-3.825383594908151401696052638550461697686), SC_(1.341658748500666418041408813274783487436) }},
       {{ SC_(-0.25), SC_(-4.901666809860710580516393213451562107405), SC_(1.589575312551185990315897214778782835911) }},
@@ -336,7 +336,7 @@
       {{ SC_(0.5), SC_(1.772453850905516027298167483341145182798), SC_(0.5723649429247000870717136756765293558236) }}
    } };
 
- static const boost::array<boost::array<T, 3>, 40> near_m10 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 40> near_m10 = { {
       {{ SC_(-10.5), SC_(-0.2640121820547716316246385325311240439682e-6), SC_(-15.14727059071784114610117639552631963436) }},
       {{ SC_(-10.375), SC_(-0.3853824777091100016167565620752110328498e-6), SC_(-14.76902954720701012688042720516103787762) }},
       {{ SC_(-10.25), SC_(-0.67808180432946731304891004492754985848e-6), SC_(-14.20399790093109065161116876070387206737) }},
@@ -379,7 +379,7 @@
       {{ SC_(-9.5), SC_(0.2772127911575102132058704591576802461667e-5), SC_(-12.79589533355436345901781053661879076815) }}
    } };
 
- static const boost::array<boost::array<T, 3>, 40> near_m55 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 40> near_m55 = { {
       {{ SC_(-55.5), SC_(0.3313939247684676728377268347296671102738e-73), SC_(-169.1931592947433577934436950412776436064) }},
       {{ SC_(-55.375), SC_(0.5931885913251829148011431845907438457576e-73), SC_(-168.6109546898941580979033836431457031234) }},
       {{ SC_(-55.25), SC_(0.128134265213561204650151776242601279892e-72), SC_(-167.8408033134133338381597995376176917559) }},
@@ -422,7 +422,7 @@
       {{ SC_(-54.5), SC_(-0.183923628246499558424938393274965246202e-71), SC_(-165.1767762739909689670975862547818473059) }}
    } };
 
- static const boost::array<boost::array<T, 2>, 141> gammap1m1_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 141> gammap1m1_data = { {
       {{ SC_(-0.4952165186405181884765625), SC_(0.7559827693907095754807809442951050489732) }},
       {{ SC_(-0.4642883241176605224609375), SC_(0.6574328869566978138139138799311066062094) }},
       {{ SC_(-0.4024595916271209716796875), SC_(0.4948624198600628575485791492257182331098) }},

Modified: trunk/libs/math/test/test_hermite.hpp
==============================================================================
--- trunk/libs/math/test/test_hermite.hpp (original)
+++ trunk/libs/math/test/test_hermite.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -21,16 +21,17 @@
 
 #include "handle_test_result.hpp"
 #include "test_legendre_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_hermite(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -49,10 +50,10 @@
    //
    // test hermite against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::hermite", test_name);
 
    std::cout << std::endl;
@@ -69,7 +70,7 @@
    //
 # include "hermite.ipp"
 
- do_test_hermite(hermite, name, "Hermite Polynomials");
+ do_test_hermite<T>(hermite, name, "Hermite Polynomials");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_hypergeometric_dist.cpp
==============================================================================
--- trunk/libs/math/test/test_hypergeometric_dist.cpp (original)
+++ trunk/libs/math/test/test_hypergeometric_dist.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -24,6 +24,7 @@
 #include <boost/array.hpp>
 #include "functor.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #define BOOST_CHECK_EX(a) \
    {\
@@ -136,7 +137,7 @@
    return cdf(complement(d, x));
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_hypergeometric(const T& data, const char* type_name, const char* test_name)
 {
    // warning suppression:
@@ -146,7 +147,7 @@
 
 #if !defined(TEST_QUANT) || (TEST_QUANT == 0)
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type, value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -163,10 +164,10 @@
    //
    // test hypergeometric against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2, 3),
- extract_result(4));
+ bind_func<Real>(funcp, 0, 1, 2, 3),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "hypergeometric PDF", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -178,10 +179,10 @@
    //
    // test hypergeometric against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2, 3),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1, 2, 3),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "hypergeometric CDF", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -193,20 +194,20 @@
    //
    // test hypergeometric against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2, 3),
- extract_result(6));
+ bind_func<Real>(funcp, 0, 1, 2, 3),
+ extract_result<Real>(6));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "hypergeometric CDF complement", test_name);
    std::cout << std::endl;
 #endif
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_hypergeometric_quantile(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Checking quantiles with " << test_name << " with type " << type_name
       << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
@@ -419,7 +420,7 @@
    // Test data taken from Mathematica 6
 #define T RealType
 #include "hypergeometric_test_data.ipp"
- do_test_hypergeometric(hypergeometric_test_data, type_name, "Mathematica data");
+ do_test_hypergeometric<T>(hypergeometric_test_data, type_name, "Mathematica data");
 
 #include "hypergeometric_dist_data2.ipp"
    if(boost::is_floating_point<RealType>::value)
@@ -427,16 +428,16 @@
       //
       // Don't test this for real_concept: it's too slow!!!
       //
- do_test_hypergeometric(hypergeometric_dist_data2, type_name, "Random large data");
+ do_test_hypergeometric<T>(hypergeometric_dist_data2, type_name, "Random large data");
    }
 
- do_test_hypergeometric_quantile(hypergeometric_test_data, type_name, "Mathematica data");
+ do_test_hypergeometric_quantile<T>(hypergeometric_test_data, type_name, "Mathematica data");
    if(boost::is_floating_point<RealType>::value)
    {
       //
       // Don't test this for real_concept: it's too slow!!!
       //
- do_test_hypergeometric_quantile(hypergeometric_dist_data2, type_name, "Random large data");
+ do_test_hypergeometric_quantile<T>(hypergeometric_dist_data2, type_name, "Random large data");
    }
 
    RealType tolerance = (std::max)(

Modified: trunk/libs/math/test/test_ibeta.hpp
==============================================================================
--- trunk/libs/math/test/test_ibeta.hpp (original)
+++ trunk/libs/math/test/test_ibeta.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,16 +17,17 @@
 
 #include "test_beta_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_beta(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -43,10 +44,10 @@
    //
    // test beta against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::beta", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -54,10 +55,10 @@
 #else
    funcp = boost::math::betac;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(4));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::betac", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -65,10 +66,10 @@
 #else
    funcp = boost::math::ibeta;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibeta", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -76,18 +77,18 @@
 #else
    funcp = boost::math::ibetac;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(6));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(6));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibetac", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::ibeta;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1, 2),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(5));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::ibeta");
    }
 #endif
@@ -106,25 +107,25 @@
 #if !defined(TEST_DATA) || (TEST_DATA == 1)
 # include "ibeta_small_data.ipp"
 
- do_test_beta(ibeta_small_data, name, "Incomplete Beta Function: Small Values");
+ do_test_beta<T>(ibeta_small_data, name, "Incomplete Beta Function: Small Values");
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 2)
 # include "ibeta_data.ipp"
 
- do_test_beta(ibeta_data, name, "Incomplete Beta Function: Medium Values");
+ do_test_beta<T>(ibeta_data, name, "Incomplete Beta Function: Medium Values");
 
 #endif
 #if !defined(TEST_DATA) || (TEST_DATA == 3)
 # include "ibeta_large_data.ipp"
 
- do_test_beta(ibeta_large_data, name, "Incomplete Beta Function: Large and Diverse Values");
+ do_test_beta<T>(ibeta_large_data, name, "Incomplete Beta Function: Large and Diverse Values");
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 4)
 # include "ibeta_int_data.ipp"
 
- do_test_beta(ibeta_int_data, name, "Incomplete Beta Function: Small Integer Values");
+ do_test_beta<T>(ibeta_int_data, name, "Incomplete Beta Function: Small Integer Values");
 #endif
 }
 

Modified: trunk/libs/math/test/test_ibeta_inv.hpp
==============================================================================
--- trunk/libs/math/test/test_ibeta_inv.hpp (original)
+++ trunk/libs/math/test/test_ibeta_inv.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,17 +17,18 @@
 
 #include "test_beta_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void test_inverses(const T& data)
 {
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    value_type precision = static_cast<value_type>(ldexp(1.0, 1-boost::math::policies::digits<value_type, boost::math::policies::policy<> >()/2)) * 100;
    if(boost::math::policies::digits<value_type, boost::math::policies::policy<> >() < 50)
@@ -41,37 +42,37 @@
       // information left in the value we're using as input to the inverse
       // to be able to get back to the original value.
       //
- if(data[i][5] == 0)
- BOOST_CHECK_EQUAL(boost::math::ibeta_inv(data[i][0], data[i][1], data[i][5]), value_type(0));
- else if((1 - data[i][5] > 0.001)
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<double>()))
+ if(Real(data[i][5]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::ibeta_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0));
+ else if((1 - Real(data[i][5]) > 0.001)
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::ibeta_inv(data[i][0], data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE(data[i][2], inv, precision);
+ value_type inv = boost::math::ibeta_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE(Real(data[i][2]), inv, precision);
       }
- else if(1 == data[i][5])
- BOOST_CHECK_EQUAL(boost::math::ibeta_inv(data[i][0], data[i][1], data[i][5]), value_type(1));
+ else if(1 == Real(data[i][5]))
+ BOOST_CHECK_EQUAL(boost::math::ibeta_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1));
 
- if(data[i][6] == 0)
- BOOST_CHECK_EQUAL(boost::math::ibetac_inv(data[i][0], data[i][1], data[i][6]), value_type(1));
- else if((1 - data[i][6] > 0.001)
- && (fabs(data[i][6]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][6]) > 2 * boost::math::tools::min_value<double>()))
+ if(Real(data[i][6]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::ibetac_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][6])), value_type(1));
+ else if((1 - Real(data[i][6]) > 0.001)
+ && (fabs(Real(data[i][6])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][6])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::ibetac_inv(data[i][0], data[i][1], data[i][6]);
- BOOST_CHECK_CLOSE(data[i][2], inv, precision);
+ value_type inv = boost::math::ibetac_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][6]));
+ BOOST_CHECK_CLOSE(Real(data[i][2]), inv, precision);
       }
- else if(data[i][6] == 1)
- BOOST_CHECK_EQUAL(boost::math::ibetac_inv(data[i][0], data[i][1], data[i][6]), value_type(0));
+ else if(Real(data[i][6]) == 1)
+ BOOST_CHECK_EQUAL(boost::math::ibetac_inv(Real(data[i][0]), Real(data[i][1]), Real(data[i][6])), value_type(0));
    }
 }
 
-template <class T>
+template <class Real, class T>
 void test_inverses2(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -88,10 +89,10 @@
    //
    // test ibeta_inv(T, T, T) against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibeta_inv", test_name);
    //
    // test ibetac_inv(T, T, T) against data:
@@ -101,10 +102,10 @@
 #else
    funcp = boost::math::ibetac_inv;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(4));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibetac_inv", test_name);
 }
 
@@ -122,25 +123,25 @@
 #if !defined(TEST_DATA) || (TEST_DATA == 1)
 # include "ibeta_small_data.ipp"
 
- test_inverses(ibeta_small_data);
+ test_inverses<T>(ibeta_small_data);
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 2)
 # include "ibeta_data.ipp"
 
- test_inverses(ibeta_data);
+ test_inverses<T>(ibeta_data);
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 3)
 # include "ibeta_large_data.ipp"
 
- test_inverses(ibeta_large_data);
+ test_inverses<T>(ibeta_large_data);
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 4)
 # include "ibeta_inv_data.ipp"
 
- test_inverses2(ibeta_inv_data, name, "Inverse incomplete beta");
+ test_inverses2<T>(ibeta_inv_data, name, "Inverse incomplete beta");
 #endif
 }
 

Modified: trunk/libs/math/test/test_ibeta_inv_ab.hpp
==============================================================================
--- trunk/libs/math/test/test_ibeta_inv_ab.hpp (original)
+++ trunk/libs/math/test/test_ibeta_inv_ab.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -23,17 +23,18 @@
 #endif
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void test_inverses(const T& data)
 {
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    value_type precision = static_cast<value_type>(ldexp(1.0, 1-boost::math::policies::digits<value_type, boost::math::policies::policy<> >()/2)) * 100;
    if(boost::math::policies::digits<value_type, boost::math::policies::policy<> >() < 50)
@@ -47,53 +48,53 @@
       // information left in the value we're using as input to the inverse
       // to be able to get back to the original value.
       //
- if(data[i][5] == 0)
+ if(Real(data[i][5]) == 0)
       {
- BOOST_CHECK_EQUAL(boost::math::ibeta_inva(data[i][1], data[i][2], data[i][5]), boost::math::tools::max_value<value_type>());
- BOOST_CHECK_EQUAL(boost::math::ibeta_invb(data[i][0], data[i][2], data[i][5]), boost::math::tools::min_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibeta_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][5])), boost::math::tools::max_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibeta_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][5])), boost::math::tools::min_value<value_type>());
       }
- else if((1 - data[i][5] > 0.001)
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<double>()))
+ else if((1 - Real(data[i][5]) > 0.001)
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::ibeta_inva(data[i][1], data[i][2], data[i][5]);
- BOOST_CHECK_CLOSE(data[i][0], inv, precision);
- inv = boost::math::ibeta_invb(data[i][0], data[i][2], data[i][5]);
- BOOST_CHECK_CLOSE(data[i][1], inv, precision);
+ value_type inv = boost::math::ibeta_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE(Real(data[i][0]), inv, precision);
+ inv = boost::math::ibeta_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE(Real(data[i][1]), inv, precision);
       }
- else if(1 == data[i][5])
+ else if(1 == Real(data[i][5]))
       {
- BOOST_CHECK_EQUAL(boost::math::ibeta_inva(data[i][1], data[i][2], data[i][5]), boost::math::tools::min_value<value_type>());
- BOOST_CHECK_EQUAL(boost::math::ibeta_invb(data[i][0], data[i][2], data[i][5]), boost::math::tools::max_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibeta_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][5])), boost::math::tools::min_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibeta_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][5])), boost::math::tools::max_value<value_type>());
       }
 
- if(data[i][6] == 0)
+ if(Real(data[i][6]) == 0)
       {
- BOOST_CHECK_EQUAL(boost::math::ibetac_inva(data[i][1], data[i][2], data[i][6]), boost::math::tools::min_value<value_type>());
- BOOST_CHECK_EQUAL(boost::math::ibetac_invb(data[i][0], data[i][2], data[i][6]), boost::math::tools::max_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibetac_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][6])), boost::math::tools::min_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibetac_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][6])), boost::math::tools::max_value<value_type>());
       }
- else if((1 - data[i][6] > 0.001)
- && (fabs(data[i][6]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][6]) > 2 * boost::math::tools::min_value<double>()))
+ else if((1 - Real(data[i][6]) > 0.001)
+ && (fabs(Real(data[i][6])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][6])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::ibetac_inva(data[i][1], data[i][2], data[i][6]);
- BOOST_CHECK_CLOSE(data[i][0], inv, precision);
- inv = boost::math::ibetac_invb(data[i][0], data[i][2], data[i][6]);
- BOOST_CHECK_CLOSE(data[i][1], inv, precision);
+ value_type inv = boost::math::ibetac_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][6]));
+ BOOST_CHECK_CLOSE(Real(data[i][0]), inv, precision);
+ inv = boost::math::ibetac_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][6]));
+ BOOST_CHECK_CLOSE(Real(data[i][1]), inv, precision);
       }
- else if(data[i][6] == 1)
+ else if(Real(data[i][6]) == 1)
       {
- BOOST_CHECK_EQUAL(boost::math::ibetac_inva(data[i][1], data[i][2], data[i][6]), boost::math::tools::max_value<value_type>());
- BOOST_CHECK_EQUAL(boost::math::ibetac_invb(data[i][0], data[i][2], data[i][6]), boost::math::tools::min_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibetac_inva(Real(data[i][1]), Real(data[i][2]), Real(data[i][6])), boost::math::tools::max_value<value_type>());
+ BOOST_CHECK_EQUAL(boost::math::ibetac_invb(Real(data[i][0]), Real(data[i][2]), Real(data[i][6])), boost::math::tools::min_value<value_type>());
       }
    }
 }
 
-template <class T>
+template <class Real, class T>
 void test_inverses2(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -110,10 +111,10 @@
    //
    // test ibeta_inva(T, T, T) against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibeta_inva", test_name);
    //
    // test ibetac_inva(T, T, T) against data:
@@ -123,10 +124,10 @@
 #else
    funcp = boost::math::ibetac_inva;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(4));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibetac_inva", test_name);
    //
    // test ibeta_invb(T, T, T) against data:
@@ -136,10 +137,10 @@
 #else
    funcp = boost::math::ibeta_invb;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibeta_invb", test_name);
    //
    // test ibetac_invb(T, T, T) against data:
@@ -149,10 +150,10 @@
 #else
    funcp = boost::math::ibetac_invb;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1, 2),
- extract_result(6));
+ bind_func<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(6));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::ibetac_invb", test_name);
 }
 
@@ -170,19 +171,19 @@
 #if !defined(TEST_DATA) || (TEST_DATA == 1)
 # include "ibeta_small_data.ipp"
 
- test_inverses(ibeta_small_data);
+ test_inverses<T>(ibeta_small_data);
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 2)
 # include "ibeta_data.ipp"
 
- test_inverses(ibeta_data);
+ test_inverses<T>(ibeta_data);
 #endif
 
 #if !defined(TEST_DATA) || (TEST_DATA == 3)
 # include "ibeta_large_data.ipp"
 
- test_inverses(ibeta_large_data);
+ test_inverses<T>(ibeta_large_data);
 #endif
 
 #if !defined(TEST_REAL_CONCEPT) || defined(FULL_TEST) || (TEST_DATA == 4)
@@ -197,7 +198,7 @@
    //
 # include "ibeta_inva_data.ipp"
 
- test_inverses2(ibeta_inva_data, name, "Inverse incomplete beta");
+ test_inverses2<T>(ibeta_inva_data, name, "Inverse incomplete beta");
 #ifndef FULL_TEST
    }
 #endif

Modified: trunk/libs/math/test/test_igamma.hpp
==============================================================================
--- trunk/libs/math/test/test_igamma.hpp (original)
+++ trunk/libs/math/test/test_igamma.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -19,16 +19,17 @@
 
 #include "test_gamma_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma_2(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -45,12 +46,12 @@
    //
    // test tgamma(T, T) against data:
    //
- if(data[0][2] > 0)
+ if(Real(data[0][2]) > 0)
    {
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma", test_name);
       //
       // test tgamma_lower(T, T) against data:
@@ -60,10 +61,10 @@
 #else
       funcp = boost::math::tgamma_lower;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(4));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(4));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_lower", test_name);
    }
    //
@@ -74,10 +75,10 @@
 #else
    funcp = boost::math::gamma_q;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_q", test_name);
 #if defined(TEST_OTHER)
    //
@@ -86,10 +87,10 @@
    if(boost::is_floating_point<value_type>::value)
    {
       funcp = other::gamma_q;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(3));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::gamma_q");
    }
 #endif
@@ -101,10 +102,10 @@
 #else
    funcp = boost::math::gamma_p;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_p", test_name);
 #if defined(TEST_OTHER)
    //
@@ -113,10 +114,10 @@
    if(boost::is_floating_point<value_type>::value)
    {
       funcp = other::gamma_p;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(5));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(5));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::gamma_p");
    }
 #endif
@@ -137,19 +138,19 @@
    //
 # include "igamma_med_data.ipp"
 
- do_test_gamma_2(igamma_med_data, name, "tgamma(a, z) medium values");
+ do_test_gamma_2<T>(igamma_med_data, name, "tgamma(a, z) medium values");
 
 # include "igamma_small_data.ipp"
 
- do_test_gamma_2(igamma_small_data, name, "tgamma(a, z) small values");
+ do_test_gamma_2<T>(igamma_small_data, name, "tgamma(a, z) small values");
 
 # include "igamma_big_data.ipp"
 
- do_test_gamma_2(igamma_big_data, name, "tgamma(a, z) large values");
+ do_test_gamma_2<T>(igamma_big_data, name, "tgamma(a, z) large values");
 
 # include "igamma_int_data.ipp"
 
- do_test_gamma_2(igamma_int_data, name, "tgamma(a, z) integer and half integer values");
+ do_test_gamma_2<T>(igamma_int_data, name, "tgamma(a, z) integer and half integer values");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_igamma_inv.hpp
==============================================================================
--- trunk/libs/math/test/test_igamma_inv.hpp (original)
+++ trunk/libs/math/test/test_igamma_inv.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -19,9 +19,10 @@
 
 #include "test_gamma_hooks.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 #define BOOST_CHECK_CLOSE_EX(a, b, prec, i) \
@@ -37,7 +38,7 @@
       }\
    }
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma_2(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -45,7 +46,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -72,50 +73,50 @@
       // information left in the value we're using as input to the inverse
       // to be able to get back to the original value.
       //
- if(data[i][5] == 0)
- BOOST_CHECK_EQUAL(boost::math::gamma_p_inv(data[i][0], data[i][5]), value_type(0));
- else if((1 - data[i][5] > 0.001)
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<double>()))
+ if(Real(data[i][5]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::gamma_p_inv(Real(data[i][0]), Real(data[i][5])), value_type(0));
+ else if((1 - Real(data[i][5]) > 0.001)
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::gamma_p_inv(data[i][0], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][1], inv, precision, i);
+ value_type inv = boost::math::gamma_p_inv(Real(data[i][0]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][1]), inv, precision, i);
       }
- else if(1 == data[i][5])
- BOOST_CHECK_EQUAL(boost::math::gamma_p_inv(data[i][0], data[i][5]), boost::math::tools::max_value<value_type>());
+ else if(1 == Real(data[i][5]))
+ BOOST_CHECK_EQUAL(boost::math::gamma_p_inv(Real(data[i][0]), Real(data[i][5])), boost::math::tools::max_value<value_type>());
       else
       {
          // not enough bits in our input to get back to x, but we should be in
          // the same ball park:
- value_type inv = boost::math::gamma_p_inv(data[i][0], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][1], inv, 100000, i);
+ value_type inv = boost::math::gamma_p_inv(Real(data[i][0]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][1]), inv, 100000, i);
       }
 
- if(data[i][3] == 0)
- BOOST_CHECK_EQUAL(boost::math::gamma_q_inv(data[i][0], data[i][3]), boost::math::tools::max_value<value_type>());
- else if((1 - data[i][3] > 0.001) && (fabs(data[i][3]) > 2 * boost::math::tools::min_value<value_type>()))
+ if(Real(data[i][3]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::gamma_q_inv(Real(data[i][0]), Real(data[i][3])), boost::math::tools::max_value<value_type>());
+ else if((1 - Real(data[i][3]) > 0.001) && (fabs(Real(data[i][3])) > 2 * boost::math::tools::min_value<value_type>()))
       {
- value_type inv = boost::math::gamma_q_inv(data[i][0], data[i][3]);
- BOOST_CHECK_CLOSE_EX(data[i][1], inv, precision, i);
+ value_type inv = boost::math::gamma_q_inv(Real(data[i][0]), Real(data[i][3]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][1]), inv, precision, i);
       }
- else if(1 == data[i][3])
- BOOST_CHECK_EQUAL(boost::math::gamma_q_inv(data[i][0], data[i][3]), value_type(0));
- else if(fabs(data[i][3]) > 2 * boost::math::tools::min_value<value_type>())
+ else if(1 == Real(data[i][3]))
+ BOOST_CHECK_EQUAL(boost::math::gamma_q_inv(Real(data[i][0]), Real(data[i][3])), value_type(0));
+ else if(fabs(Real(data[i][3])) > 2 * boost::math::tools::min_value<value_type>())
       {
          // not enough bits in our input to get back to x, but we should be in
          // the same ball park:
- value_type inv = boost::math::gamma_q_inv(data[i][0], data[i][3]);
- BOOST_CHECK_CLOSE_EX(data[i][1], inv, 100, i);
+ value_type inv = boost::math::gamma_q_inv(Real(data[i][0]), Real(data[i][3]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][1]), inv, 100, i);
       }
    }
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma_inv(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -132,10 +133,10 @@
    //
    // test gamma_p_inv(T, T) against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_p_inv", test_name);
    //
    // test gamma_q_inv(T, T) against data:
@@ -145,10 +146,10 @@
 #else
    funcp = boost::math::gamma_q_inv;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_q_inv", test_name);
 #ifdef TEST_OTHER
    if(boost::is_floating_point<value_type>::value)
@@ -157,19 +158,19 @@
       //
       // test gamma_p_inv(T, T) against data:
       //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::gamma_q");
       //
       // test gamma_q_inv(T, T) against data:
       //
       funcp = other::gamma_q_inv;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0, 1),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(3));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::gamma_q");
    }
 #endif
@@ -190,29 +191,29 @@
    //
 # include "igamma_med_data.ipp"
 
- do_test_gamma_2(igamma_med_data, name, "Running round trip sanity checks on incomplete gamma medium sized values");
+ do_test_gamma_2<T>(igamma_med_data, name, "Running round trip sanity checks on incomplete gamma medium sized values");
 
 # include "igamma_small_data.ipp"
 
- do_test_gamma_2(igamma_small_data, name, "Running round trip sanity checks on incomplete gamma small values");
+ do_test_gamma_2<T>(igamma_small_data, name, "Running round trip sanity checks on incomplete gamma small values");
 
 # include "igamma_big_data.ipp"
 
- do_test_gamma_2(igamma_big_data, name, "Running round trip sanity checks on incomplete gamma large values");
+ do_test_gamma_2<T>(igamma_big_data, name, "Running round trip sanity checks on incomplete gamma large values");
 
 #endif
 
 # include "gamma_inv_data.ipp"
 
- do_test_gamma_inv(gamma_inv_data, name, "incomplete gamma inverse(a, z) medium values");
+ do_test_gamma_inv<T>(gamma_inv_data, name, "incomplete gamma inverse(a, z) medium values");
 
 # include "gamma_inv_big_data.ipp"
 
- do_test_gamma_inv(gamma_inv_big_data, name, "incomplete gamma inverse(a, z) large values");
+ do_test_gamma_inv<T>(gamma_inv_big_data, name, "incomplete gamma inverse(a, z) large values");
 
 # include "gamma_inv_small_data.ipp"
 
- do_test_gamma_inv(gamma_inv_small_data, name, "incomplete gamma inverse(a, z) small values");
+ do_test_gamma_inv<T>(gamma_inv_small_data, name, "incomplete gamma inverse(a, z) small values");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_igamma_inva.hpp
==============================================================================
--- trunk/libs/math/test/test_igamma_inva.hpp (original)
+++ trunk/libs/math/test/test_igamma_inva.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -18,11 +18,11 @@
 #include <boost/type_traits/is_floating_point.hpp>
 #include <boost/array.hpp>
 #include "functor.hpp"
-
+#include "table_type.hpp"
 #include "handle_test_result.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 #define BOOST_CHECK_CLOSE_EX(a, b, prec, i) \
@@ -38,7 +38,7 @@
       }\
    }
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma_2(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -46,7 +46,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -73,50 +73,50 @@
       // information left in the value we're using as input to the inverse
       // to be able to get back to the original value.
       //
- if(data[i][5] == 0)
- BOOST_CHECK_EQUAL(boost::math::gamma_p_inva(data[i][1], data[i][5]), boost::math::tools::max_value<value_type>());
- else if((1 - data[i][5] > 0.001) && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<value_type>()))
+ if(Real(data[i][5]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::gamma_p_inva(Real(data[i][1]), Real(data[i][5])), boost::math::tools::max_value<value_type>());
+ else if((1 - Real(data[i][5]) > 0.001) && (fabs(Real(data[i][5])) > 2 * boost::math::tools::min_value<value_type>()))
       {
- value_type inv = boost::math::gamma_p_inva(data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][0], inv, precision, i);
+ value_type inv = boost::math::gamma_p_inva(Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][0]), inv, precision, i);
       }
- else if(1 == data[i][5])
- BOOST_CHECK_EQUAL(boost::math::gamma_p_inva(data[i][1], data[i][5]), boost::math::tools::min_value<value_type>());
- else if(data[i][5] > 2 * boost::math::tools::min_value<value_type>())
+ else if(1 == Real(data[i][5]))
+ BOOST_CHECK_EQUAL(boost::math::gamma_p_inva(Real(data[i][1]), Real(data[i][5])), boost::math::tools::min_value<value_type>());
+ else if(Real(data[i][5]) > 2 * boost::math::tools::min_value<value_type>())
       {
          // not enough bits in our input to get back to x, but we should be in
          // the same ball park:
- value_type inv = boost::math::gamma_p_inva(data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][0], inv, 100, i);
+ value_type inv = boost::math::gamma_p_inva(Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][0]), inv, 100, i);
       }
 
- if(data[i][3] == 0)
- BOOST_CHECK_EQUAL(boost::math::gamma_q_inva(data[i][1], data[i][3]), boost::math::tools::min_value<value_type>());
- else if((1 - data[i][3] > 0.001)
- && (fabs(data[i][3]) > 2 * boost::math::tools::min_value<value_type>())
- && (fabs(data[i][3]) > 2 * boost::math::tools::min_value<double>()))
+ if(Real(data[i][3]) == 0)
+ BOOST_CHECK_EQUAL(boost::math::gamma_q_inva(Real(data[i][1]), Real(data[i][3])), boost::math::tools::min_value<value_type>());
+ else if((1 - Real(data[i][3]) > 0.001)
+ && (fabs(Real(data[i][3])) > 2 * boost::math::tools::min_value<value_type>())
+ && (fabs(Real(data[i][3])) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = boost::math::gamma_q_inva(data[i][1], data[i][3]);
- BOOST_CHECK_CLOSE_EX(data[i][0], inv, precision, i);
+ value_type inv = boost::math::gamma_q_inva(Real(data[i][1]), Real(data[i][3]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][0]), inv, precision, i);
       }
- else if(1 == data[i][3])
- BOOST_CHECK_EQUAL(boost::math::gamma_q_inva(data[i][1], data[i][3]), boost::math::tools::max_value<value_type>());
- else if(data[i][3] > 2 * boost::math::tools::min_value<value_type>())
+ else if(1 == Real(data[i][3]))
+ BOOST_CHECK_EQUAL(boost::math::gamma_q_inva(Real(data[i][1]), Real(data[i][3])), boost::math::tools::max_value<value_type>());
+ else if(Real(data[i][3]) > 2 * boost::math::tools::min_value<value_type>())
       {
          // not enough bits in our input to get back to x, but we should be in
          // the same ball park:
- value_type inv = boost::math::gamma_q_inva(data[i][1], data[i][3]);
- BOOST_CHECK_CLOSE_EX(data[i][0], inv, 100, i);
+ value_type inv = boost::math::gamma_q_inva(Real(data[i][1]), Real(data[i][3]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][0]), inv, 100, i);
       }
    }
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_gamma_inva(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -133,10 +133,10 @@
    //
    // test gamma_p_inva(T, T) against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_p_inva", test_name);
    //
    // test gamma_q_inva(T, T) against data:
@@ -146,10 +146,10 @@
 #else
    funcp = boost::math::gamma_q_inva;
 #endif
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(3));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::gamma_q_inva", test_name);
 }
 
@@ -168,20 +168,20 @@
    //
 # include "igamma_med_data.ipp"
 
- do_test_gamma_2(igamma_med_data, name, "Running round trip sanity checks on incomplete gamma medium sized values");
+ do_test_gamma_2<T>(igamma_med_data, name, "Running round trip sanity checks on incomplete gamma medium sized values");
 
 # include "igamma_small_data.ipp"
 
- do_test_gamma_2(igamma_small_data, name, "Running round trip sanity checks on incomplete gamma small values");
+ do_test_gamma_2<T>(igamma_small_data, name, "Running round trip sanity checks on incomplete gamma small values");
 
 # include "igamma_big_data.ipp"
 
- do_test_gamma_2(igamma_big_data, name, "Running round trip sanity checks on incomplete gamma large values");
+ do_test_gamma_2<T>(igamma_big_data, name, "Running round trip sanity checks on incomplete gamma large values");
 
 #endif
 
 # include "igamma_inva_data.ipp"
 
- do_test_gamma_inva(igamma_inva_data, name, "Incomplete gamma inverses.");
+ do_test_gamma_inva<T>(igamma_inva_data, name, "Incomplete gamma inverses.");
 }
 

Modified: trunk/libs/math/test/test_inv_hyp.cpp
==============================================================================
--- trunk/libs/math/test/test_inv_hyp.cpp (original)
+++ trunk/libs/math/test/test_inv_hyp.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -19,6 +19,7 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 //
 // DESCRIPTION:
@@ -88,7 +89,7 @@
       << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_asinh(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -96,7 +97,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -111,15 +112,15 @@
    //
    // test asinh against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::asinh", test_name);
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_acosh(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -127,7 +128,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -142,15 +143,15 @@
    //
    // test acosh against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::acosh", test_name);
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_atanh(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -158,7 +159,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -173,10 +174,10 @@
    //
    // test atanh against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::atanh", test_name);
    std::cout << std::endl;
 }
@@ -185,8 +186,8 @@
 void test_inv_hyperbolics(T, const char* name)
 {
     // function values calculated on http://functions.wolfram.com/
- #define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 2>, 16> data1 = {{
+ #define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 16> data1 = {{
         {{ SC_(1), SC_(0) }},
         {{ SC_(18014398509481985.0)/SC_(18014398509481984.0), (SC_(18014398509481985.0)/SC_(18014398509481984.0) == 1 ? 0 : SC_(1.05367121277235078980001569764860129317209081216314559121044e-8)) }},
         {{ SC_(140737488355329.0)/SC_(140737488355328.0), (SC_(140737488355329.0)/SC_(140737488355328.0) == 1 ? 0 : SC_(1.19209289550781179413921062141751258430803882725295121500042e-7)) }},
@@ -210,12 +211,12 @@
    // The actual test data is rather verbose, so it's in a separate file
    //
 #include "asinh_data.ipp"
- do_test_asinh(asinh_data, name, "asinh");
+ do_test_asinh<T>(asinh_data, name, "asinh");
 #include "acosh_data.ipp"
- do_test_acosh(data1, name, "acosh: Mathworld Data");
- do_test_acosh(acosh_data, name, "acosh");
+ do_test_acosh<T>(data1, name, "acosh: Mathworld Data");
+ do_test_acosh<T>(acosh_data, name, "acosh");
 #include "atanh_data.ipp"
- do_test_atanh(atanh_data, name, "atanh");
+ do_test_atanh<T>(atanh_data, name, "atanh");
 }
 
 extern "C" double zetac(double);

Modified: trunk/libs/math/test/test_laguerre.hpp
==============================================================================
--- trunk/libs/math/test/test_laguerre.hpp (original)
+++ trunk/libs/math/test/test_laguerre.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,16 +14,17 @@
 
 #include "handle_test_result.hpp"
 #include "test_legendre_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_laguerre2(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -40,20 +41,20 @@
    //
    // test laguerre against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::laguerre(n, x)", test_name);
 
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_laguerre3(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, unsigned, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -70,10 +71,10 @@
    //
    // test laguerre against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int2(funcp, 0, 1, 2),
- extract_result(3));
+ bind_func_int2<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::laguerre(n, m, x)", test_name);
    std::cout << std::endl;
 }
@@ -89,11 +90,11 @@
    //
 # include "laguerre2.ipp"
 
- do_test_laguerre2(laguerre2, name, "Laguerre Polynomials");
+ do_test_laguerre2<T>(laguerre2, name, "Laguerre Polynomials");
 
 # include "laguerre3.ipp"
 
- do_test_laguerre3(laguerre3, name, "Associated Laguerre Polynomials");
+ do_test_laguerre3<T>(laguerre3, name, "Associated Laguerre Polynomials");
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_legendre.hpp
==============================================================================
--- trunk/libs/math/test/test_legendre.hpp (original)
+++ trunk/libs/math/test/test_legendre.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -18,16 +18,17 @@
 
 #include "handle_test_result.hpp"
 #include "test_legendre_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_legendre_p(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(int, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -44,18 +45,18 @@
    //
    // test legendre_p against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::legendre_p", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::legendre_p;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp, 0, 1),
- extract_result(2));
+ bind_func_int1<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::legendre_p");
    }
 #endif
@@ -70,18 +71,18 @@
    //
    // test legendre_q against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp2, 0, 1),
- extract_result(3));
+ bind_func_int1<Real>(funcp2, 0, 1),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::legendre_q", test_name);
 #ifdef TEST_OTHER
    if(::boost::is_floating_point<value_type>::value){
       funcp = other::legendre_q;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int1(funcp2, 0, 1),
- extract_result(3));
+ bind_func_int1<Real>(funcp2, 0, 1),
+ extract_result<Real>(3));
       print_test_result(result, data[result.worst()], result.worst(), type_name, "other::legendre_q");
    }
 #endif
@@ -90,11 +91,11 @@
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_assoc_legendre_p(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(int, int, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -111,10 +112,10 @@
    //
    // test legendre_p against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int2(funcp, 0, 1, 2),
- extract_result(3));
+ bind_func_int2<Real>(funcp, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::legendre_p", test_name);
    std::cout << std::endl;
 }
@@ -130,15 +131,15 @@
    //
 # include "legendre_p.ipp"
 
- do_test_legendre_p(legendre_p, name, "Legendre Polynomials: Small Values");
+ do_test_legendre_p<T>(legendre_p, name, "Legendre Polynomials: Small Values");
 
 # include "legendre_p_large.ipp"
 
- do_test_legendre_p(legendre_p_large, name, "Legendre Polynomials: Large Values");
+ do_test_legendre_p<T>(legendre_p_large, name, "Legendre Polynomials: Large Values");
 
 # include "assoc_legendre_p.ipp"
 
- do_test_assoc_legendre_p(assoc_legendre_p, name, "Associated Legendre Polynomials: Small Values");
+ do_test_assoc_legendre_p<T>(assoc_legendre_p, name, "Associated Legendre Polynomials: Small Values");
 
 }
 

Modified: trunk/libs/math/test/test_long_double_support.cpp
==============================================================================
--- trunk/libs/math/test/test_long_double_support.cpp (original)
+++ trunk/libs/math/test/test_long_double_support.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -23,6 +23,7 @@
 #include <boost/array.hpp>
 #include "functor.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #include <boost/math/tools/config.hpp>
 
@@ -61,15 +62,15 @@
    //
    result = boost::math::tools::test(
       data,
- bind_func(proc, 0),
- extract_result(1));
+ bind_func<value_type>(proc, 0),
+ extract_result<value_type>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, function_name, test_name);
    if(inv_proc)
    {
       result = boost::math::tools::test(
          data,
- bind_func(inv_proc, 1),
- extract_result(0));
+ bind_func<value_type>(inv_proc, 1),
+ extract_result<value_type>(0));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, inv_function_name, test_name);
    }
 }

Modified: trunk/libs/math/test/test_nc_beta.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_beta.cpp (original)
+++ trunk/libs/math/test/test_nc_beta.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -34,6 +34,7 @@
 #include "functor.hpp"
 #include "handle_test_result.hpp"
 #include "test_ncbeta_hooks.hpp"
+#include "table_type.hpp"
 
 #include <iostream>
 using std::cout;
@@ -290,38 +291,38 @@
    return cdf(complement(boost::math::non_central_beta_distribution<T>(a, b, nc), x));
 }
 
-template <typename T>
+template <typename Real, typename T>
 void do_test_nc_chi_squared(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
    value_type (*fp1)(value_type, value_type, value_type, value_type) = nc_beta_cdf;
    boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2, 3),
- extract_result(4));
+ bind_func<Real>(fp1, 0, 1, 2, 3),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CDF", test);
 
    fp1 = nc_beta_ccdf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2, 3),
- extract_result(5));
+ bind_func<Real>(fp1, 0, 1, 2, 3),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CCDF", test);
 
 #ifdef TEST_OTHER
    fp1 = other::ncbeta_cdf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2, 3),
- extract_result(4));
+ bind_func<Real>(fp1, 0, 1, 2, 3),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "Other::CDF", test);
 #endif
@@ -329,11 +330,11 @@
 
 }
 
-template <typename T>
+template <typename Real, typename T>
 void quantile_sanity_check(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    //
    // Tests with type real_concept take rather too long to run, so
@@ -415,12 +416,12 @@
 {
 #if !defined(TEST_DATA) || (TEST_DATA == 1)
 #include "ncbeta.ipp"
- do_test_nc_chi_squared(ncbeta, type_name, "Non Central Beta, medium parameters");
- quantile_sanity_check(ncbeta, type_name, "Non Central Beta, medium parameters");
+ do_test_nc_chi_squared<T>(ncbeta, type_name, "Non Central Beta, medium parameters");
+ quantile_sanity_check<T>(ncbeta, type_name, "Non Central Beta, medium parameters");
 #endif
 #if !defined(TEST_DATA) || (TEST_DATA == 2)
 #include "ncbeta_big.ipp"
- do_test_nc_chi_squared(ncbeta_big, type_name, "Non Central Beta, large parameters");
+ do_test_nc_chi_squared<T>(ncbeta_big, type_name, "Non Central Beta, large parameters");
     // Takes too long to run:
     // quantile_sanity_check(ncbeta_big, type_name, "Non Central Beta, large parameters");
 #endif

Modified: trunk/libs/math/test/test_nc_chi_squared.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_chi_squared.cpp (original)
+++ trunk/libs/math/test/test_nc_chi_squared.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -31,6 +31,7 @@
 #include "functor.hpp"
 #include "handle_test_result.hpp"
 #include "test_nccs_hooks.hpp"
+#include "table_type.hpp"
 
 #include <iostream>
 using std::cout;
@@ -357,38 +358,38 @@
    return cdf(complement(boost::math::non_central_chi_squared_distribution<T>(df, nc), x));
 }
 
-template <typename T>
+template <typename Real, typename T>
 void do_test_nc_chi_squared(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
    value_type (*fp1)(value_type, value_type, value_type) = nccs_cdf;
    boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(fp1, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CDF", test);
 
    fp1 = nccs_ccdf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2),
- extract_result(4));
+ bind_func<Real>(fp1, 0, 1, 2),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CCDF", test);
 
 #ifdef TEST_OTHER
    fp1 = other::nccs_cdf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(fp1, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "other::CDF", test);
 #endif
@@ -397,11 +398,11 @@
 
 }
 
-template <typename T>
+template <typename Real, typename T>
 void quantile_sanity_check(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    //
    // Tests with type real_concept take rather too long to run, so
@@ -429,7 +430,7 @@
 
    for(unsigned i = 0; i < data.size(); ++i)
    {
- if(data[i][3] == 0)
+ if(Real(data[i][3]) == 0)
       {
          BOOST_CHECK(0 == quantile(boost::math::non_central_chi_squared_distribution<value_type>(data[i][0], data[i][1]), data[i][3]));
       }
@@ -500,12 +501,12 @@
 void test_accuracy(T, const char* type_name)
 {
 #include "nccs.ipp"
- do_test_nc_chi_squared(nccs, type_name, "Non Central Chi Squared, medium parameters");
- quantile_sanity_check(nccs, type_name, "Non Central Chi Squared, medium parameters");
+ do_test_nc_chi_squared<T>(nccs, type_name, "Non Central Chi Squared, medium parameters");
+ quantile_sanity_check<T>(nccs, type_name, "Non Central Chi Squared, medium parameters");
 
 #include "nccs_big.ipp"
- do_test_nc_chi_squared(nccs_big, type_name, "Non Central Chi Squared, large parameters");
- quantile_sanity_check(nccs_big, type_name, "Non Central Chi Squared, large parameters");
+ do_test_nc_chi_squared<T>(nccs_big, type_name, "Non Central Chi Squared, large parameters");
+ quantile_sanity_check<T>(nccs_big, type_name, "Non Central Chi Squared, large parameters");
 }
 
 int test_main(int, char* [])

Modified: trunk/libs/math/test/test_nc_t.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_t.cpp (original)
+++ trunk/libs/math/test/test_nc_t.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -29,6 +29,7 @@
 
 #include "functor.hpp"
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #include <iostream>
 using std::cout;
@@ -343,29 +344,29 @@
    return cdf(complement(boost::math::non_central_t_distribution<T>(df, nc), x));
 }
 
-template <typename T>
+template <typename Real, typename T>
 void do_test_nc_t(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << "Testing: " << test << std::endl;
 
    value_type (*fp1)(value_type, value_type, value_type) = nct_cdf;
    boost::math::tools::test_result<value_type> result;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2),
- extract_result(3));
+ bind_func<Real>(fp1, 0, 1, 2),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CDF", test);
 
    fp1 = nct_ccdf;
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(fp1, 0, 1, 2),
- extract_result(4));
+ bind_func<Real>(fp1, 0, 1, 2),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(),
       type_name, "CCDF", test);
 
@@ -373,11 +374,11 @@
 
 }
 
-template <typename T>
+template <typename Real, typename T>
 void quantile_sanity_check(T& data, const char* type_name, const char* test)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    //
    // Tests with type real_concept take rather too long to run, so
@@ -478,8 +479,8 @@
 void test_accuracy(T, const char* type_name)
 {
 #include "nct.ipp"
- do_test_nc_t(nct, type_name, "Non Central T");
- quantile_sanity_check(nct, type_name, "Non Central T");
+ do_test_nc_t<T>(nct, type_name, "Non Central T");
+ quantile_sanity_check<T>(nct, type_name, "Non Central T");
 }
 
 int test_main(int, char* [])

Modified: trunk/libs/math/test/test_negative_binomial.cpp
==============================================================================
--- trunk/libs/math/test/test_negative_binomial.cpp (original)
+++ trunk/libs/math/test/test_negative_binomial.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -37,6 +37,7 @@
 
 #include <boost/test/test_exec_monitor.hpp> // for test_main
 #include <boost/test/floating_point_comparison.hpp> // for BOOST_CHECK_CLOSE
+#include "table_type.hpp"
 
 #include <iostream>
 using std::cout;

Modified: trunk/libs/math/test/test_poisson.cpp
==============================================================================
--- trunk/libs/math/test/test_poisson.cpp (original)
+++ trunk/libs/math/test/test_poisson.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -33,6 +33,7 @@
 
 #include <boost/math/special_functions/gamma.hpp> // for (incomplete) gamma.
 // using boost::math::qamma_Q;
+#include "table_type.hpp"
 
 #include <iostream>
    using std::cout;

Modified: trunk/libs/math/test/test_roots.cpp
==============================================================================
--- trunk/libs/math/test/test_roots.cpp (original)
+++ trunk/libs/math/test/test_roots.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -13,6 +13,7 @@
 #include <boost/test/results_collector.hpp>
 #include <boost/test/unit_test.hpp>
 #include <boost/array.hpp>
+#include "table_type.hpp"
 
 #define BOOST_CHECK_CLOSE_EX(a, b, prec, i) \
    {\
@@ -237,12 +238,12 @@
 }
 
 
-template <class T>
+template <class Real, class T>
 void test_inverses(const T& data)
 {
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    value_type precision = static_cast<value_type>(ldexp(1.0, 1-boost::math::policies::digits<value_type, boost::math::policies::policy<> >()/2)) * 100;
    if(boost::math::policies::digits<value_type, boost::math::policies::policy<> >() < 50)
@@ -258,37 +259,37 @@
       //
       if(data[i][5] == 0)
       {
- BOOST_CHECK_EQUAL(inverse_ibeta_halley(data[i][0], data[i][1], data[i][5]), value_type(0));
- BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(data[i][0], data[i][1], data[i][5]), value_type(0));
- BOOST_CHECK_EQUAL(inverse_ibeta_newton(data[i][0], data[i][1], data[i][5]), value_type(0));
- BOOST_CHECK_EQUAL(inverse_ibeta_bisect(data[i][0], data[i][1], data[i][5]), value_type(0));
+ BOOST_CHECK_EQUAL(inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0));
+ BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0));
+ BOOST_CHECK_EQUAL(inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0));
+ BOOST_CHECK_EQUAL(inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0));
       }
       else if((1 - data[i][5] > 0.001)
          && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<value_type>())
          && (fabs(data[i][5]) > 2 * boost::math::tools::min_value<double>()))
       {
- value_type inv = inverse_ibeta_halley(data[i][0], data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][2], inv, precision, i);
- inv = inverse_ibeta_schroeder(data[i][0], data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][2], inv, precision, i);
- inv = inverse_ibeta_newton(data[i][0], data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][2], inv, precision, i);
- inv = inverse_ibeta_bisect(data[i][0], data[i][1], data[i][5]);
- BOOST_CHECK_CLOSE_EX(data[i][2], inv, precision, i);
+ value_type inv = inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
+ inv = inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
+ inv = inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
+ inv = inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
+ BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
       }
       else if(1 == data[i][5])
       {
- BOOST_CHECK_EQUAL(inverse_ibeta_halley(data[i][0], data[i][1], data[i][5]), value_type(1));
- BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(data[i][0], data[i][1], data[i][5]), value_type(1));
- BOOST_CHECK_EQUAL(inverse_ibeta_newton(data[i][0], data[i][1], data[i][5]), value_type(1));
- BOOST_CHECK_EQUAL(inverse_ibeta_bisect(data[i][0], data[i][1], data[i][5]), value_type(1));
+ BOOST_CHECK_EQUAL(inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1));
+ BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1));
+ BOOST_CHECK_EQUAL(inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1));
+ BOOST_CHECK_EQUAL(inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1));
       }
 
    }
 }
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
 template <class T>
@@ -302,15 +303,15 @@
    //
 # include "ibeta_small_data.ipp"
 
- test_inverses(ibeta_small_data);
+ test_inverses<T>(ibeta_small_data);
 
 # include "ibeta_data.ipp"
 
- test_inverses(ibeta_data);
+ test_inverses<T>(ibeta_data);
 
 # include "ibeta_large_data.ipp"
 
- test_inverses(ibeta_large_data);
+ test_inverses<T>(ibeta_large_data);
 }
 
 int test_main(int, char* [])

Modified: trunk/libs/math/test/test_spherical_harmonic.cpp
==============================================================================
--- trunk/libs/math/test/test_spherical_harmonic.cpp (original)
+++ trunk/libs/math/test/test_spherical_harmonic.cpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -14,6 +14,7 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 //
 // DESCRIPTION:
@@ -96,11 +97,11 @@
       << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_spherical_harmonic(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(unsigned, int, value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -117,10 +118,10 @@
    //
    // test Spheric Harmonic against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int2(funcp, 0, 1, 2, 3),
- extract_result(4));
+ bind_func_int2<Real>(funcp, 0, 1, 2, 3),
+ extract_result<Real>(4));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::spherical_harmonic_r", test_name);
 
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -131,20 +132,20 @@
    //
    // test Spheric Harmonic against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func_int2(funcp, 0, 1, 2, 3),
- extract_result(5));
+ bind_func_int2<Real>(funcp, 0, 1, 2, 3),
+ extract_result<Real>(5));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::spherical_harmonic_i", test_name);
 
    std::cout << std::endl;
 }
 
-template <class T>
+template <class Real, class T>
 void test_complex_spherical_harmonic(const T& data, const char* /* name */, boost::mpl::true_ const &)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    for(unsigned i = 0; i < sizeof(data) / sizeof(data[0]); ++i)
    {
@@ -155,24 +156,24 @@
       std::complex<value_type> r = boost::math::spherical_harmonic(
          boost::math::tools::real_cast<unsigned>(data[i][0]),
          boost::math::tools::real_cast<unsigned>(data[i][1]),
- data[i][2],
- data[i][3]);
+ Real(data[i][2]),
+ Real(data[i][3]));
       value_type re = boost::math::spherical_harmonic_r(
          boost::math::tools::real_cast<unsigned>(data[i][0]),
          boost::math::tools::real_cast<unsigned>(data[i][1]),
- data[i][2],
- data[i][3]);
+ Real(data[i][2]),
+ Real(data[i][3]));
       value_type im = boost::math::spherical_harmonic_i(
          boost::math::tools::real_cast<unsigned>(data[i][0]),
          boost::math::tools::real_cast<unsigned>(data[i][1]),
- data[i][2],
- data[i][3]);
+ Real(data[i][2]),
+ Real(data[i][3]));
       BOOST_CHECK_CLOSE_FRACTION(std::real(r), re, value_type(5));
       BOOST_CHECK_CLOSE_FRACTION(std::imag(r), im, value_type(5));
    }
 }
 
-template <class T>
+template <class Real, class T>
 void test_complex_spherical_harmonic(const T& /* data */, const char* /* name */, boost::mpl::false_ const &)
 {
    // T is not a built in type, can't use std::complex with it...
@@ -189,9 +190,9 @@
    //
 # include "spherical_harmonic.ipp"
 
- do_test_spherical_harmonic(spherical_harmonic, name, "Spherical Harmonics");
+ do_test_spherical_harmonic<T>(spherical_harmonic, name, "Spherical Harmonics");
 
- test_complex_spherical_harmonic(spherical_harmonic, name, boost::is_floating_point<T>());
+ test_complex_spherical_harmonic<T>(spherical_harmonic, name, boost::is_floating_point<T>());
 }
 
 template <class T>

Modified: trunk/libs/math/test/test_tgamma_ratio.hpp
==============================================================================
--- trunk/libs/math/test/test_tgamma_ratio.hpp (original)
+++ trunk/libs/math/test/test_tgamma_ratio.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -16,25 +16,27 @@
 #include "functor.hpp"
 
 #include "handle_test_result.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
+template <class Real>
 struct negative_tgamma_ratio
 {
    template <class Row>
- typename Row::value_type operator()(const Row& row)
+ Real operator()(const Row& row)
    {
- return boost::math::tgamma_delta_ratio(row[0], -row[1]);
+ return boost::math::tgamma_delta_ratio(Real(row[0]), -Real(row[1]));
    }
 };
 
-template <class T>
+template <class Real, class T>
 void do_test_tgamma_delta_ratio(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -51,23 +53,23 @@
    //
    // test tgamma_delta_ratio against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a, delta)", test_name);
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- negative_tgamma_ratio(),
- extract_result(3));
+ negative_tgamma_ratio<Real>(),
+ extract_result<Real>(3));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_delta_ratio(a -delta)", test_name);
 }
 
-template <class T>
+template <class Real, class T>
 void do_test_tgamma_ratio(const T& data, const char* type_name, const char* test_name)
 {
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    typedef value_type (*pg)(value_type, value_type);
 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
@@ -84,10 +86,10 @@
    //
    // test tgamma_ratio against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0, 1),
- extract_result(2));
+ bind_func<Real>(funcp, 0, 1),
+ extract_result<Real>(2));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::tgamma_ratio(a, b)", test_name);
 }
 
@@ -99,19 +101,19 @@
    //
 # include "tgamma_delta_ratio_data.ipp"
 
- do_test_tgamma_delta_ratio(tgamma_delta_ratio_data, name, "tgamma + small delta ratios");
+ do_test_tgamma_delta_ratio<T>(tgamma_delta_ratio_data, name, "tgamma + small delta ratios");
 
 # include "tgamma_delta_ratio_int.ipp"
 
- do_test_tgamma_delta_ratio(tgamma_delta_ratio_int, name, "tgamma + small integer ratios");
+ do_test_tgamma_delta_ratio<T>(tgamma_delta_ratio_int, name, "tgamma + small integer ratios");
 
 # include "tgamma_delta_ratio_int2.ipp"
 
- do_test_tgamma_delta_ratio(tgamma_delta_ratio_int2, name, "integer tgamma ratios");
+ do_test_tgamma_delta_ratio<T>(tgamma_delta_ratio_int2, name, "integer tgamma ratios");
 
 # include "tgamma_ratio_data.ipp"
 
- do_test_tgamma_ratio(tgamma_ratio_data, name, "tgamma ratios");
+ do_test_tgamma_ratio<T>(tgamma_ratio_data, name, "tgamma ratios");
 
 }
 

Modified: trunk/libs/math/test/test_zeta.hpp
==============================================================================
--- trunk/libs/math/test/test_zeta.hpp (original)
+++ trunk/libs/math/test/test_zeta.hpp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -17,12 +17,13 @@
 
 #include "handle_test_result.hpp"
 #include "test_zeta_hooks.hpp"
+#include "table_type.hpp"
 
 #ifndef SC_
-#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#define SC_(x) static_cast<typename table_type<T>::type>(BOOST_JOIN(x, L))
 #endif
 
-template <class T>
+template <class Real, class T>
 void do_test_zeta(const T& data, const char* type_name, const char* test_name)
 {
    //
@@ -30,7 +31,7 @@
    //
    using namespace std;
    typedef typename T::value_type row_type;
- typedef typename row_type::value_type value_type;
+ typedef Real value_type;
 
    std::cout << test_name << " with type " << type_name << std::endl;
 
@@ -45,20 +46,20 @@
    //
    // test zeta against data:
    //
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
       data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
    handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::zeta", test_name);
 #ifdef TEST_OTHER
    if(boost::is_floating_point<value_type>::value)
    {
       funcp = other::zeta;
 
- result = boost::math::tools::test(
+ result = boost::math::tools::test_hetero<Real>(
          data,
- bind_func(funcp, 0),
- extract_result(1));
+ bind_func<Real>(funcp, 0),
+ extract_result<Real>(1));
       handle_test_result(result, data[result.worst()], result.worst(), type_name, "other::zeta", test_name);
    }
 #endif
@@ -71,13 +72,13 @@
    // The actual test data is rather verbose, so it's in a separate file
    //
 #include "zeta_data.ipp"
- do_test_zeta(zeta_data, name, "Zeta: Random values greater than 1");
+ do_test_zeta<T>(zeta_data, name, "Zeta: Random values greater than 1");
 #include "zeta_neg_data.ipp"
- do_test_zeta(zeta_neg_data, name, "Zeta: Random values less than 1");
+ do_test_zeta<T>(zeta_neg_data, name, "Zeta: Random values less than 1");
 #include "zeta_1_up_data.ipp"
- do_test_zeta(zeta_1_up_data, name, "Zeta: Values close to and greater than 1");
+ do_test_zeta<T>(zeta_1_up_data, name, "Zeta: Values close to and greater than 1");
 #include "zeta_1_below_data.ipp"
- do_test_zeta(zeta_1_below_data, name, "Zeta: Values close to and less than 1");
+ do_test_zeta<T>(zeta_1_below_data, name, "Zeta: Values close to and less than 1");
 }
 
 extern "C" double zetac(double);

Modified: trunk/libs/math/test/tgamma_delta_ratio_data.ipp
==============================================================================
--- trunk/libs/math/test/tgamma_delta_ratio_data.ipp (original)
+++ trunk/libs/math/test/tgamma_delta_ratio_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 560> tgamma_delta_ratio_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 560> tgamma_delta_ratio_data = { {
       {{ SC_(0.2585242462158203125e2), SC_(0.5408298164866209845058619976043701171875e-7), SC_(0.9999998251530248995276873521622051469349e0), SC_(0.1000000174847005556584935896873247717521e1) }},
       {{ SC_(0.2585242462158203125e2), SC_(0.676797071719192899763584136962890625e-7), SC_(0.999999781195646858662207729479648955493e0), SC_(0.1000000218804400836041852388787649318772e1) }},
       {{ SC_(0.2585242462158203125e2), SC_(0.227188110102360951714217662811279296875e-6), SC_(0.9999992655149263979633607427932657111612e0), SC_(0.1000000734485611035140775476483228633931e1) }},

Modified: trunk/libs/math/test/tgamma_delta_ratio_int.ipp
==============================================================================
--- trunk/libs/math/test/tgamma_delta_ratio_int.ipp (original)
+++ trunk/libs/math/test/tgamma_delta_ratio_int.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 344> tgamma_delta_ratio_int = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 344> tgamma_delta_ratio_int = { {
       {{ SC_(0.24302618503570556640625e1), SC_(0.1e1), SC_(0.4114782939349022594054088894256271572472e0), SC_(0.14302618503570556640625e1) }},
       {{ SC_(0.301645793914794921875e2), SC_(0.1e1), SC_(0.3315146506841289877594755891064182591548e-1), SC_(0.291645793914794921875e2) }},
       {{ SC_(0.301645793914794921875e2), SC_(0.3e1), SC_(0.3307223761155750711531487469609546246538e-4), SC_(0.2231320586281996185139958610577082254167e5) }},

Modified: trunk/libs/math/test/tgamma_delta_ratio_int2.ipp
==============================================================================
--- trunk/libs/math/test/tgamma_delta_ratio_int2.ipp (original)
+++ trunk/libs/math/test/tgamma_delta_ratio_int2.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 4>, 190> tgamma_delta_ratio_int2 = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 4>, 190> tgamma_delta_ratio_int2 = { {
       {{ SC_(0.11e2), SC_(0.1e2), SC_(0.1491552059147518383844493235618106619139e-11), SC_(0.36288e7) }},
       {{ SC_(0.12e2), SC_(0.1e2), SC_(0.7812891738391762962994964567523415624059e-12), SC_(0.399168e8) }},
       {{ SC_(0.12e2), SC_(0.11e2), SC_(0.3551314426541710437724983894328825283663e-13), SC_(0.399168e8) }},

Modified: trunk/libs/math/test/tgamma_ratio_data.ipp
==============================================================================
--- trunk/libs/math/test/tgamma_ratio_data.ipp (original)
+++ trunk/libs/math/test/tgamma_ratio_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 3>, 400> tgamma_ratio_data = { {
+ static const boost::array<boost::array<typename table_type<T>::type, 3>, 400> tgamma_ratio_data = { {
       {{ SC_(6.68193912506103515625), SC_(6.68193912506103515625), SC_(1) }},
       {{ SC_(6.68193912506103515625), SC_(8.095367431640625), SC_(0.06544775114440229981894259276990196062764) }},
       {{ SC_(6.68193912506103515625), SC_(8.50289630889892578125), SC_(0.02833082889188931171456297874515804727699) }},

Modified: trunk/libs/math/test/zeta_1_below_data.ipp
==============================================================================
--- trunk/libs/math/test/zeta_1_below_data.ipp (original)
+++ trunk/libs/math/test/zeta_1_below_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 24> zeta_1_below_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 24> zeta_1_below_data = {{
       {{ SC_(0.02141654491424560546875), SC_(-0.5201506602793944998316548018699690797681) }},
       {{ SC_(0.50472259521484375), SC_(-1.479059796502255763615575236860218694317) }},
       {{ SC_(0.753675937652587890625), SC_(-3.500701844470537839375475836745309608254) }},

Modified: trunk/libs/math/test/zeta_1_up_data.ipp
==============================================================================
--- trunk/libs/math/test/zeta_1_up_data.ipp (original)
+++ trunk/libs/math/test/zeta_1_up_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 24> zeta_1_up_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 24> zeta_1_up_data = {{
       {{ SC_(1.00000011920928955078125), SC_(8388608.57721567358185799990090564625463) }},
       {{ SC_(1.0000002384185791015625), SC_(4194304.577215682262183001486952251646755) }},
       {{ SC_(1.000000476837158203125), SC_(2097152.577215699622832591533990692770612) }},

Modified: trunk/libs/math/test/zeta_data.ipp
==============================================================================
--- trunk/libs/math/test/zeta_data.ipp (original)
+++ trunk/libs/math/test/zeta_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 200> zeta_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 200> zeta_data = {{
       {{ SC_(1.16628754138946533203125), SC_(6.602868183069916948720755731837247651904) }},
       {{ SC_(1.28222560882568359375), SC_(4.140637712279411074557164685415721499333) }},
       {{ SC_(1.7022221088409423828125), SC_(2.049914055577335303673424130546639695977) }},

Modified: trunk/libs/math/test/zeta_neg_data.ipp
==============================================================================
--- trunk/libs/math/test/zeta_neg_data.ipp (original)
+++ trunk/libs/math/test/zeta_neg_data.ipp 2012-01-16 13:25:02 EST (Mon, 16 Jan 2012)
@@ -3,7 +3,7 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
- static const boost::array<boost::array<T, 2>, 200> zeta_neg_data = {{
+ static const boost::array<boost::array<typename table_type<T>::type, 2>, 200> zeta_neg_data = {{
       {{ SC_(-29.912628173828125), SC_(-11411595.03734503626230312380285630491992) }},
       {{ SC_(-29.851711273193359375), SC_(-17491128.83255653477666248263741824395945) }},
       {{ SC_(-29.6310367584228515625), SC_(-29338557.80907609522626540806232745245856) }},


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