Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-09-03 07:51:17


Author: johnmaddock
Date: 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
New Revision: 39110
URL: http://svn.boost.org/trac/boost/changeset/39110

Log:
Changed: "using namespace std;" to a more specific using declaration.
Text files modified:
   sandbox/math_toolkit/boost/math/distributions/bernoulli.hpp | 2 +-
   sandbox/math_toolkit/boost/math/distributions/beta.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/distributions/binomial.hpp | 16 ++++++++--------
   sandbox/math_toolkit/boost/math/distributions/cauchy.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/distributions/detail/derived_accessors.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/distributions/detail/inv_discrete_quantile.hpp | 18 +++++++++---------
   sandbox/math_toolkit/boost/math/distributions/exponential.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/distributions/extreme_value.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/distributions/fisher_f.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/distributions/gamma.hpp | 20 ++++++++++----------
   sandbox/math_toolkit/boost/math/distributions/lognormal.hpp | 24 ++++++++++++------------
   sandbox/math_toolkit/boost/math/distributions/negative_binomial.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/distributions/normal.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/distributions/pareto.hpp | 14 +++++++-------
   sandbox/math_toolkit/boost/math/distributions/poisson.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/distributions/rayleigh.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/distributions/students_t.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/distributions/triangular.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/distributions/weibull.hpp | 20 ++++++++++----------
   sandbox/math_toolkit/boost/math/policies/error_handling.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/bessel.hpp | 26 +++++++++++++-------------
   sandbox/math_toolkit/boost/math/special_functions/beta.hpp | 20 ++++++++++----------
   sandbox/math_toolkit/boost/math/special_functions/binomial.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/cbrt.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i0.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j0.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jn.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy_asym.hpp | 16 ++++++++--------
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k0.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y0.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/erf_inv.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/detail/gamma_inva.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inv_ab.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/special_functions/detail/lgamma_small.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/special_functions/detail/simple_complex.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/digamma.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/special_functions/ellint_1.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/ellint_2.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/ellint_rc.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/ellint_rd.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/ellint_rf.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/ellint_rj.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/erf.hpp | 12 ++++++------
   sandbox/math_toolkit/boost/math/special_functions/expm1.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/special_functions/factorials.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/special_functions/gamma.hpp | 36 ++++++++++++++++++------------------
   sandbox/math_toolkit/boost/math/special_functions/legendre.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/log1p.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/powm1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/sinc.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/sinhc.hpp | 2 +-
   sandbox/math_toolkit/boost/math/special_functions/spherical_harmonic.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/special_functions/sqrt1pm1.hpp | 2 +-
   sandbox/math_toolkit/boost/math/tools/config.hpp | 28 ++++++++++++++++++++++++++++
   sandbox/math_toolkit/boost/math/tools/fraction.hpp | 8 ++++----
   sandbox/math_toolkit/boost/math/tools/minima.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/tools/precision.hpp | 10 +++++-----
   sandbox/math_toolkit/boost/math/tools/remez.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/tools/roots.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/tools/series.hpp | 13 +++++++------
   sandbox/math_toolkit/boost/math/tools/stats.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/tools/test.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/tools/toms748_solve.hpp | 20 ++++++++++----------
   77 files changed, 320 insertions(+), 291 deletions(-)

Modified: sandbox/math_toolkit/boost/math/distributions/bernoulli.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/bernoulli.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/bernoulli.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -286,7 +286,7 @@
     template <class RealType, class Policy>
     inline RealType skewness(const bernoulli_distribution<RealType, Policy>& dist)
     {
- using namespace std;; // Aid ADL for sqrt.
+ BOOST_MATH_STD_USING; // Aid ADL for sqrt.
       RealType p = dist.success_fraction();
       return (1 - 2 * p) / sqrt(p * (1 - p));
     }

Modified: sandbox/math_toolkit/boost/math/distributions/beta.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/beta.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/beta.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -340,7 +340,7 @@
     template <class RealType, class Policy>
     inline RealType skewness(const beta_distribution<RealType, Policy>& dist)
     {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       RealType a = dist.alpha();
       RealType b = dist.beta();
       return (2 * (b-a) * sqrt(a + b + 1)) / ((a + b + 2) * sqrt(a * b));
@@ -370,7 +370,7 @@
 
       static const char* function = "boost::math::pdf(beta_distribution<%1%> const&, %1%)";
 
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
       RealType a = dist.alpha();
       RealType b = dist.beta();
@@ -391,7 +391,7 @@
     template <class RealType, class Policy>
     inline RealType cdf(const beta_distribution<RealType, Policy>& dist, const RealType x)
     { // Cumulative Distribution Function beta.
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
       static const char* function = "boost::math::cdf(beta_distribution<%1%> const&, %1%)";
 
@@ -423,7 +423,7 @@
     inline RealType cdf(const complemented2_type<beta_distribution<RealType, Policy>, RealType>& c)
     { // Complemented Cumulative Distribution Function beta.
 
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
       static const char* function = "boost::math::cdf(beta_distribution<%1%> const&, %1%)";
 

Modified: sandbox/math_toolkit/boost/math/distributions/binomial.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/binomial.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/binomial.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -163,7 +163,7 @@
          template <class T, class Policy>
          T inverse_binomial_cornish_fisher(T n, T sf, T p, T q, const Policy& pol)
          {
- using namespace std;
+ BOOST_MATH_STD_USING
             // mean:
             T m = n * sf;
             // standard deviation:
@@ -202,7 +202,7 @@
         // for a given probability p.
         //
         // Error checks:
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
         RealType result;
         RealType trials = dist.trials();
         RealType success_fraction = dist.success_fraction();
@@ -441,7 +441,7 @@
       { // Probability Density/Mass Function.
         BOOST_FPU_EXCEPTION_GUARD
 
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
         RealType n = dist.trials();
 
@@ -518,7 +518,7 @@
         // P = I[1-p]( n-k, k+1).
         // = 1 - I[p](k + 1, n - k)
 
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
         RealType n = dist.trials();
         RealType p = dist.success_fraction();
@@ -590,7 +590,7 @@
         // Q = 1 -I[1-p]( n-k, k+1).
         // = I[p](k + 1, n - k)
 
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
         RealType const& k = c.param;
         binomial_distribution<RealType, Policy> const& dist = c.dist;
@@ -661,7 +661,7 @@
       template <class RealType, class Policy>
       inline RealType mode(const binomial_distribution<RealType, Policy>& dist)
       {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
          RealType p = dist.success_fraction();
          RealType n = dist.trials();
          return floor(p * (n + 1));
@@ -678,7 +678,7 @@
         // Bounds for median and 50 percetage point of binomial and negative binomial distribution
         // Metrika, ISSN 0026-1335 (Print) 1435-926X (Online)
         // Volume 41, Number 1 / December, 1994, DOI 10.1007/BF01895303
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
          RealType p = dist.success_fraction();
          RealType n = dist.trials();
          // Wikipedia says one of floor(np) -1, floor (np), floor(np) +1
@@ -688,7 +688,7 @@
       template <class RealType, class Policy>
       inline RealType skewness(const binomial_distribution<RealType, Policy>& dist)
       {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
          RealType p = dist.success_fraction();
          RealType n = dist.trials();
          return (1 - 2 * p) / sqrt(n * p * (1 - p));

Modified: sandbox/math_toolkit/boost/math/distributions/cauchy.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/cauchy.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/cauchy.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -68,7 +68,7 @@
    // using the above formula, and then subtract from 1 when required
    // to get the result.
    //
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType result;
    RealType loc = dist.location();
@@ -102,7 +102,7 @@
    // from the location parameter depending on whether `complement` is true.
    //
    static const char* function = "boost::math::quantile(cauchy<%1%>&, %1%)";
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
    // Special cases:
    if(p == 1)
       return (complement ? -1 : 1) * policies::raise_overflow_error<RealType>(function, 0, Policy());

Modified: sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -72,7 +72,7 @@
 template <class RealType, class Policy>
 RealType pdf(const chi_squared_distribution<RealType, Policy>& dist, const RealType& chi_square)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
    RealType degrees_of_freedom = dist.degrees_of_freedom();
    // Error check:
    RealType error_result;
@@ -226,7 +226,7 @@
 template <class RealType, class Policy>
 inline RealType skewness(const chi_squared_distribution<RealType, Policy>& dist)
 {
- using namespace std; // For ADL
+ BOOST_MATH_STD_USING // For ADL
    RealType df = dist.degrees_of_freedom();
    return sqrt (8 / df); // == 2 * sqrt(2 / df);
 }

Modified: sandbox/math_toolkit/boost/math/distributions/detail/derived_accessors.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/detail/derived_accessors.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/detail/derived_accessors.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -44,7 +44,7 @@
 template <class Distribution>
 inline typename Distribution::value_type standard_deviation(const Distribution& dist)
 {
- using namespace std; // ADL of sqrt.
+ BOOST_MATH_STD_USING // ADL of sqrt.
    return sqrt(variance(dist));
 }
 
@@ -78,7 +78,7 @@
 inline typename Distribution::value_type chf(const Distribution& dist, const RealType& x)
 { // cumulative hazard function.
   // http://www.itl.nist.gov/div898/handbook/eda/section3/eda362.htm#HAZ
- using namespace std;
+ BOOST_MATH_STD_USING
    return -log(cdf(complement(dist, x)));
 }
 

Modified: sandbox/math_toolkit/boost/math/distributions/detail/inv_discrete_quantile.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/detail/inv_discrete_quantile.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/detail/inv_discrete_quantile.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -47,21 +47,21 @@
 template <class Real>
 void adjust_bounds(Real& /* a */, Real& b, tools::equal_floor const& /* tol */)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    b -= tools::epsilon<Real>() * b;
 }
 
 template <class Real>
 void adjust_bounds(Real& a, Real& /* b */, tools::equal_ceil const& /* tol */)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    a += tools::epsilon<Real>() * a;
 }
 
 template <class Real>
 void adjust_bounds(Real& a, Real& b, tools::equal_nearest_integer const& /* tol */)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    a += tools::epsilon<Real>() * a;
    b -= tools::epsilon<Real>() * b;
 }
@@ -85,7 +85,7 @@
 
    static const char* function = "boost::math::do_inverse_discrete_quantile<%1%>";
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
    distribution_quantile_finder<Dist> f(dist, p, q);
    //
@@ -318,7 +318,7 @@
       boost::uintmax_t& max_iter)
 {
    typedef typename Dist::value_type value_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    if(p <= pdf(dist, 0))
       return 0;
    //
@@ -360,7 +360,7 @@
       boost::uintmax_t& max_iter)
 {
    typedef typename Dist::value_type value_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    if(p <= pdf(dist, 0))
       return 0;
    //
@@ -402,7 +402,7 @@
       boost::uintmax_t& max_iter)
 {
    typedef typename Dist::value_type value_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    if(p <= pdf(dist, 0))
       return 0;
    return floor(do_inverse_discrete_quantile(
@@ -428,7 +428,7 @@
       const policies::discrete_quantile<policies::integer_round_up>&,
       boost::uintmax_t& max_iter)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    if(p <= pdf(dist, 0))
       return 0;
    return ceil(do_inverse_discrete_quantile(
@@ -455,7 +455,7 @@
       boost::uintmax_t& max_iter)
 {
    typedef typename Dist::value_type value_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    if(p <= pdf(dist, 0))
       return 0;
    //

Modified: sandbox/math_toolkit/boost/math/distributions/exponential.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/exponential.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/exponential.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -95,7 +95,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::pdf(const exponential_distribution<%1%>&, %1%)";
 
@@ -112,7 +112,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
 
@@ -130,7 +130,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const exponential_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
 
@@ -153,7 +153,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
 
@@ -171,7 +171,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
 

Modified: sandbox/math_toolkit/boost/math/distributions/extreme_value.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/extreme_value.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/extreme_value.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -90,7 +90,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const extreme_value_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType a = dist.location();
    RealType b = dist.scale();
@@ -104,7 +104,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const extreme_value_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType a = dist.location();
    RealType b = dist.scale();
@@ -120,7 +120,7 @@
 template <class RealType, class Policy>
 RealType quantile(const extreme_value_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const extreme_value_distribution<%1%>&, %1%)";
 
@@ -145,7 +145,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<extreme_value_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType a = c.dist.location();
    RealType b = c.dist.scale();
@@ -161,7 +161,7 @@
 template <class RealType, class Policy>
 RealType quantile(const complemented2_type<extreme_value_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const extreme_value_distribution<%1%>&, %1%)";
 
@@ -198,7 +198,7 @@
 template <class RealType, class Policy>
 inline RealType standard_deviation(const extreme_value_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions.
+ BOOST_MATH_STD_USING // for ADL of std functions.
 
    RealType b = dist.scale();
    RealType result;

Modified: sandbox/math_toolkit/boost/math/distributions/fisher_f.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/fisher_f.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/fisher_f.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -72,7 +72,7 @@
 template <class RealType, class Policy>
 RealType pdf(const fisher_f_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
@@ -319,7 +319,7 @@
 inline RealType skewness(const fisher_f_distribution<RealType, Policy>& dist)
 {
    static const char* function = "boost::math::skewness(fisher_f_distribution<%1%> const&)";
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    // See http://mathworld.wolfram.com/F-Distribution.html
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();

Modified: sandbox/math_toolkit/boost/math/distributions/gamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/gamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/gamma.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -117,7 +117,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const gamma_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::pdf(const gamma_distribution<%1%>&, %1%)";
 
@@ -141,7 +141,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const gamma_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const gamma_distribution<%1%>&, %1%)";
 
@@ -161,7 +161,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const gamma_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const gamma_distribution<%1%>&, %1%)";
 
@@ -185,7 +185,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<gamma_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const gamma_distribution<%1%>&, %1%)";
 
@@ -206,7 +206,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<gamma_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const gamma_distribution<%1%>&, %1%)";
 
@@ -231,7 +231,7 @@
 template <class RealType, class Policy>
 inline RealType mean(const gamma_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::mean(const gamma_distribution<%1%>&)";
 
@@ -249,7 +249,7 @@
 template <class RealType, class Policy>
 inline RealType variance(const gamma_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::variance(const gamma_distribution<%1%>&)";
 
@@ -267,7 +267,7 @@
 template <class RealType, class Policy>
 inline RealType mode(const gamma_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::mode(const gamma_distribution<%1%>&)";
 
@@ -296,7 +296,7 @@
 template <class RealType, class Policy>
 inline RealType skewness(const gamma_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::skewness(const gamma_distribution<%1%>&)";
 
@@ -314,7 +314,7 @@
 template <class RealType, class Policy>
 inline RealType kurtosis_excess(const gamma_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::kurtosis_excess(const gamma_distribution<%1%>&)";
 

Modified: sandbox/math_toolkit/boost/math/distributions/lognormal.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/lognormal.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/lognormal.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -92,7 +92,7 @@
 template <class RealType, class Policy>
 RealType pdf(const lognormal_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -121,7 +121,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const lognormal_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
 
@@ -139,7 +139,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const lognormal_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
 
@@ -159,7 +159,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<lognormal_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
 
@@ -177,7 +177,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<lognormal_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
 
@@ -197,7 +197,7 @@
 template <class RealType, class Policy>
 inline RealType mean(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -212,7 +212,7 @@
 template <class RealType, class Policy>
 inline RealType variance(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -227,7 +227,7 @@
 template <class RealType, class Policy>
 inline RealType mode(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -242,7 +242,7 @@
 template <class RealType, class Policy>
 inline RealType median(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
    RealType mu = dist.location();
    return exp(mu); // e^mu
 }
@@ -250,7 +250,7 @@
 template <class RealType, class Policy>
 inline RealType skewness(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    //RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -268,7 +268,7 @@
 template <class RealType, class Policy>
 inline RealType kurtosis(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    //RealType mu = dist.location();
    RealType sigma = dist.scale();
@@ -284,7 +284,7 @@
 template <class RealType, class Policy>
 inline RealType kurtosis_excess(const lognormal_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    // RealType mu = dist.location();
    RealType sigma = dist.scale();

Modified: sandbox/math_toolkit/boost/math/distributions/negative_binomial.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/negative_binomial.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/negative_binomial.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -287,14 +287,14 @@
     template <class RealType, class Policy>
     inline RealType mode(const negative_binomial_distribution<RealType, Policy>& dist)
     { // Mode of Negative Binomial distribution = floor[(r-1) * (1 - p)/p]
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       return floor((dist.successes() -1) * (1 - dist.success_fraction()) / dist.success_fraction());
     } // mode
 
     template <class RealType, class Policy>
     inline RealType skewness(const negative_binomial_distribution<RealType, Policy>& dist)
     { // skewness of Negative Binomial distribution = 2-p / (sqrt(r(1-p))
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       RealType p = dist.success_fraction();
       RealType r = dist.successes();
 
@@ -430,7 +430,7 @@
       // k argument may be integral, signed, or unsigned, or floating point.
       // BUT Cephes/CodeCogs says: finds argument p (0 to 1) such that cdf(k, n, p) = y
       static const char* function = "boost::math::quantile(const negative_binomial_distribution<%1%>&, %1%)";
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
 
       RealType p = dist.success_fraction();
       RealType r = dist.successes();
@@ -502,7 +502,7 @@
        // Return the number of expected failures k for a given
        // complement of the probability Q = 1 - P.
        static const char* function = "boost::math::quantile(const negative_binomial_distribution<%1%>&, %1%)";
- using namespace std;
+ BOOST_MATH_STD_USING
 
        // Error checks:
        RealType Q = c.param;

Modified: sandbox/math_toolkit/boost/math/distributions/normal.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/normal.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/normal.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -81,7 +81,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const normal_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType sd = dist.standard_deviation();
    RealType mean = dist.mean();
@@ -99,7 +99,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const normal_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType sd = dist.standard_deviation();
    RealType mean = dist.mean();
@@ -114,7 +114,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const normal_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType sd = dist.standard_deviation();
    RealType mean = dist.mean();
@@ -132,7 +132,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<normal_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType sd = c.dist.standard_deviation();
    RealType mean = c.dist.mean();
@@ -149,7 +149,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<normal_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType sd = c.dist.standard_deviation();
    RealType mean = c.dist.mean();

Modified: sandbox/math_toolkit/boost/math/distributions/pareto.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/pareto.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/pareto.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -176,7 +176,7 @@
     template <class RealType, class Policy>
     inline RealType pdf(const pareto_distribution<RealType, Policy>& dist, const RealType& x)
     {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";
       RealType location = dist.location();
       RealType shape = dist.shape();
@@ -196,7 +196,7 @@
     template <class RealType, class Policy>
     inline RealType cdf(const pareto_distribution<RealType, Policy>& dist, const RealType& x)
     {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
       static const char* function = "boost::math::cdf(const pareto_distribution<%1%>&, %1%)";
       RealType location = dist.location();
       RealType shape = dist.shape();
@@ -219,7 +219,7 @@
     template <class RealType, class Policy>
     inline RealType quantile(const pareto_distribution<RealType, Policy>& dist, const RealType& p)
     {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
       static const char* function = "boost::math::quantile(const pareto_distribution<%1%>&, %1%)";
       RealType result;
       RealType location = dist.location();
@@ -246,7 +246,7 @@
     template <class RealType, class Policy>
     inline RealType cdf(const complemented2_type<pareto_distribution<RealType, Policy>, RealType>& c)
     {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
        static const char* function = "boost::math::cdf(const pareto_distribution<%1%>&, %1%)";
        RealType result;
        RealType x = c.param;
@@ -268,7 +268,7 @@
     template <class RealType, class Policy>
     inline RealType quantile(const complemented2_type<pareto_distribution<RealType, Policy>, RealType>& c)
     {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
       static const char* function = "boost::math::quantile(const pareto_distribution<%1%>&, %1%)";
       RealType result;
       RealType q = c.param;
@@ -327,7 +327,7 @@
       {
         return result;
       }
- using namespace std;
+ BOOST_MATH_STD_USING
       return dist.location() * pow(RealType(2), (1/dist.shape()));
     } // median
 
@@ -359,7 +359,7 @@
     template <class RealType, class Policy>
     inline RealType skewness(const pareto_distribution<RealType, Policy>& dist)
     {
- using namespace std;
+ BOOST_MATH_STD_USING
       RealType result;
       RealType shape = dist.shape();
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";

Modified: sandbox/math_toolkit/boost/math/distributions/poisson.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/poisson.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/poisson.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -254,7 +254,7 @@
     template <class RealType, class Policy>
     inline RealType mode(const poisson_distribution<RealType, Policy>& dist)
     { // mode.
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       return floor(dist.mean());
     }
 
@@ -280,7 +280,7 @@
     template <class RealType, class Policy>
     inline RealType skewness(const poisson_distribution<RealType, Policy>& dist)
     { // skewness = sqrt(l).
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       return 1 / sqrt(dist.mean());
     }
 
@@ -311,7 +311,7 @@
       // Probability that there are EXACTLY k occurrences (or arrivals).
       BOOST_FPU_EXCEPTION_GUARD
 
- using namespace std; // for ADL of std functions.
+ BOOST_MATH_STD_USING // for ADL of std functions.
 
       RealType mean = dist.mean();
       // Error check:
@@ -372,7 +372,7 @@
       // The terms are not summed directly (at least for larger k)
       // instead the incomplete gamma integral is employed,
 
- using namespace std; // for ADL of std function exp.
+ BOOST_MATH_STD_USING // for ADL of std function exp.
 
       RealType mean = dist.mean();
       // Error checks:
@@ -477,7 +477,7 @@
         }
       }
       /*
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
       // if(p == 0) NOT necessarily zero!
       // Not necessarily any special value of k because is unlimited.
                         if (p <= exp(-dist.mean()))

Modified: sandbox/math_toolkit/boost/math/distributions/rayleigh.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/rayleigh.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/rayleigh.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -95,7 +95,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const rayleigh_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std function exp.
+ BOOST_MATH_STD_USING // for ADL of std function exp.
 
    RealType sigma = dist.sigma();
    RealType result;
@@ -116,7 +116,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const rayleigh_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType result;
    RealType sigma = dist.sigma();
@@ -136,7 +136,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const rayleigh_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType result;
    RealType sigma = dist.sigma();
@@ -161,7 +161,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<rayleigh_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType result;
    RealType sigma = c.dist.sigma();
@@ -182,7 +182,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<rayleigh_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions, log & sqrt.
+ BOOST_MATH_STD_USING // for ADL of std functions, log & sqrt.
 
    RealType result;
    RealType sigma = c.dist.sigma();

Modified: sandbox/math_toolkit/boost/math/distributions/students_t.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/students_t.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/students_t.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -79,7 +79,7 @@
 inline RealType pdf(const students_t_distribution<RealType, Policy>& dist, const RealType& t)
 {
    BOOST_FPU_EXCEPTION_GUARD
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    RealType degrees_of_freedom = dist.degrees_of_freedom();
    // Error check:
@@ -152,7 +152,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const students_t_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
    //
    // Obtain parameters:
    //

Modified: sandbox/math_toolkit/boost/math/distributions/triangular.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/triangular.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/triangular.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -266,7 +266,7 @@
   template <class RealType, class Policy>
   RealType quantile(const triangular_distribution<RealType, Policy>& dist, const RealType& p)
   {
- using namespace std; // for ADL of std functions (sqrt).
+ BOOST_MATH_STD_USING // for ADL of std functions (sqrt).
     static const char* function = "boost::math::quantile(const triangular_distribution<%1%>&, %1%)";
     RealType lower = dist.lower();
     RealType mode = dist.mode();
@@ -344,7 +344,7 @@
   template <class RealType, class Policy>
   RealType quantile(const complemented2_type<triangular_distribution<RealType, Policy>, RealType>& c)
   {
- using namespace std; // Aid ADL for sqrt.
+ BOOST_MATH_STD_USING // Aid ADL for sqrt.
     static const char* function = "boost::math::quantile(const triangular_distribution<%1%>&, %1%)";
     RealType l = c.dist.lower();
     RealType m = c.dist.mode();
@@ -437,7 +437,7 @@
   template <class RealType, class Policy>
   inline RealType median(const triangular_distribution<RealType, Policy>& dist)
   {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
     static const char* function = "boost::math::median(const triangular_distribution<%1%>&)";
     RealType mode = dist.mode();
     RealType result; // of checks.
@@ -460,7 +460,7 @@
   template <class RealType, class Policy>
   inline RealType skewness(const triangular_distribution<RealType, Policy>& dist)
   {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
     using namespace boost::math::constants; // for root_two
     static const char* function = "boost::math::skewness(const triangular_distribution<%1%>&)";
 

Modified: sandbox/math_toolkit/boost/math/distributions/weibull.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/weibull.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/weibull.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -117,7 +117,7 @@
 template <class RealType, class Policy>
 inline RealType pdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::pdf(const weibull_distribution<%1%>, %1%)";
 
@@ -142,7 +142,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const weibull_distribution<%1%>, %1%)";
 
@@ -163,7 +163,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const weibull_distribution<RealType, Policy>& dist, const RealType& p)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const weibull_distribution<%1%>, %1%)";
 
@@ -187,7 +187,7 @@
 template <class RealType, class Policy>
 inline RealType cdf(const complemented2_type<weibull_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::cdf(const weibull_distribution<%1%>, %1%)";
 
@@ -208,7 +208,7 @@
 template <class RealType, class Policy>
 inline RealType quantile(const complemented2_type<weibull_distribution<RealType, Policy>, RealType>& c)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::quantile(const weibull_distribution<%1%>, %1%)";
 
@@ -233,7 +233,7 @@
 template <class RealType, class Policy>
 inline RealType mean(const weibull_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::mean(const weibull_distribution<%1%>)";
 
@@ -271,7 +271,7 @@
 template <class RealType, class Policy>
 inline RealType mode(const weibull_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
 
    static const char* function = "boost::math::mode(const weibull_distribution<%1%>)";
 
@@ -290,7 +290,7 @@
 template <class RealType, class Policy>
 inline RealType median(const weibull_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std function pow.
+ BOOST_MATH_STD_USING // for ADL of std function pow.
 
    static const char* function = "boost::math::median(const weibull_distribution<%1%>)";
 
@@ -310,7 +310,7 @@
 template <class RealType, class Policy>
 inline RealType skewness(const weibull_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::skewness(const weibull_distribution<%1%>)";
 
@@ -336,7 +336,7 @@
 template <class RealType, class Policy>
 inline RealType kurtosis_excess(const weibull_distribution<RealType, Policy>& dist)
 {
- using namespace std; // for ADL of std functions
+ BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::kurtosis_excess(const weibull_distribution<%1%>)";
 

Modified: sandbox/math_toolkit/boost/math/policies/error_handling.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/policies/error_handling.hpp (original)
+++ sandbox/math_toolkit/boost/math/policies/error_handling.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -427,7 +427,7 @@
 template <class R, class T, class Policy>
 inline bool check_overflow(T val, R* result, const char* function, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    if(fabs(val) > tools::max_value<R>())
    {
       *result = static_cast<R>(boost::math::policies::detail::raise_overflow_error<R>(function, 0, pol));
@@ -448,7 +448,7 @@
 template <class R, class T, class Policy>
 inline bool check_denorm(T val, R* result, const char* function, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    if((fabs(val) < static_cast<T>(tools::min_value<R>())) && (static_cast<R>(val) != 0))
    {
       *result = static_cast<R>(boost::math::policies::detail::raise_denorm_error<R>(function, 0, static_cast<R>(val), pol));

Modified: sandbox/math_toolkit/boost/math/special_functions/bessel.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/bessel.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/bessel.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -35,7 +35,7 @@
    bessel_j_small_z_series_term(T v_, T x)
       : N(0), v(v_)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       mult = x / 2;
       term = pow(mult, v) / boost::math::tgamma(v+1, Policy());
       mult *= -mult;
@@ -62,7 +62,7 @@
    sph_bessel_j_small_z_series_term(unsigned v_, T x)
       : N(0), v(v_)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       mult = x / 2;
       term = pow(mult, T(v)) / boost::math::tgamma(v+1+T(0.5f), Policy());
       mult *= -mult;
@@ -94,7 +94,7 @@
 template <class T, class Policy>
 inline T sph_bessel_j_small_z_series(unsigned v, T x, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    sph_bessel_j_small_z_series_term<T, Policy> s(v, x);
    boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
    T result = boost::math::tools::sum_series(s, boost::math::policies::digits<T, Policy>(), max_iter);
@@ -105,7 +105,7 @@
 template <class T, class Policy>
 T cyl_bessel_j_imp(T v, T x, const bessel_no_int_tag& t, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    static const char* function = "boost::math::bessel_j<%1%>(%1%,%1%)";
    if(x < 0)
    {
@@ -142,7 +142,7 @@
 template <class T, class Policy>
 inline T cyl_bessel_j_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol)
 {
- using namespace std; // ADL of std names.
+ BOOST_MATH_STD_USING // ADL of std names.
    typedef typename bessel_asymptotic_tag<T, Policy>::type tag_type;
    if((fabs(v) < 200) && (floor(v) == v))
    {
@@ -157,7 +157,7 @@
 template <class T, class Policy>
 inline T cyl_bessel_j_imp(int v, T x, const bessel_int_tag&, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    typedef typename bessel_asymptotic_tag<T, Policy>::type tag_type;
    if(fabs(x) > asymptotic_bessel_j_limit<T>(abs(v), tag_type()))
    {
@@ -173,7 +173,7 @@
 template <class T, class Policy>
 inline T sph_bessel_j_imp(unsigned n, T x, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    if(x < 0)
       return policies::raise_domain_error<T>(
          "boost::math::sph_bessel_j<%1%>(%1%,%1%)",
@@ -205,7 +205,7 @@
    // algorithm is at least as inefficient as the general case (the general
    // case has better error handling too).
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    if(x < 0)
    {
       // better have integer v:
@@ -251,7 +251,7 @@
 inline T cyl_bessel_k_imp(T v, T x, const bessel_no_int_tag& /* t */, const Policy& pol)
 {
    static const char* function = "boost::math::cyl_bessel_k<%1%>(%1%,%1%)";
- using namespace std;
+ BOOST_MATH_STD_USING
    if(x < 0)
    {
       return policies::raise_domain_error<T>(
@@ -273,7 +273,7 @@
 template <class T, class Policy>
 inline T cyl_bessel_k_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    if((floor(v) == v))
    {
       return bessel_kn(tools::real_cast<int>(v), x, pol);
@@ -314,7 +314,7 @@
 template <class T, class Policy>
 inline T cyl_neumann_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    typedef typename bessel_asymptotic_tag<T, Policy>::type tag_type;
    if(floor(v) == v)
    {
@@ -334,7 +334,7 @@
 template <class T, class Policy>
 inline T cyl_neumann_imp(int v, T x, const bessel_int_tag&, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    typedef typename bessel_asymptotic_tag<T, Policy>::type tag_type;
    if((fabs(x) > asymptotic_bessel_y_limit<T>(tag_type())) && (fabs(x) > 5 * abs(v)))
    {
@@ -350,7 +350,7 @@
 template <class T, class Policy>
 inline T sph_neumann_imp(unsigned v, T x, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    static const char* function = "boost::math::sph_neumann<%1%>(%1%,%1%)";
    //
    // Nothing much to do here but check for errors, and

Modified: sandbox/math_toolkit/boost/math/special_functions/beta.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/beta.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/beta.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -27,7 +27,7 @@
 template <class T, class L, class Policy>
 T beta_imp(T a, T b, const L&, const Policy& pol)
 {
- using namespace std; // for ADL of std names
+ BOOST_MATH_STD_USING // for ADL of std names
 
    if(a <= 0)
       policies::raise_domain_error<T>("boost::math::beta<%1%>(%1%,%1%)", "The arguments to the beta function must be greater than zero (got a=%1%).", a, pol);
@@ -111,7 +111,7 @@
 template <class T, class Policy>
 T beta_imp(T a, T b, const lanczos::undefined_lanczos& /* l */, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(a <= 0)
       policies::raise_domain_error<T>("boost::math::beta<%1%>(%1%,%1%)", "The arguments to the beta function must be greater than zero (got a=%1%).", a, pol);
@@ -195,7 +195,7 @@
                         bool normalised,
                         const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(!normalised)
    {
@@ -352,7 +352,7 @@
                         bool normalised,
                         const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(!normalised)
    {
@@ -440,7 +440,7 @@
 template <class T, class L, class Policy>
 T ibeta_series(T a, T b, T x, T s0, const L&, bool normalised, T* p_derivative, T y, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T result;
 
@@ -487,7 +487,7 @@
 template <class T, class Policy>
 T ibeta_series(T a, T b, T x, T s0, const boost::math::lanczos::undefined_lanczos&, bool normalised, T* p_derivative, T y, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T result;
    BOOST_ASSERT((p_derivative == 0) || normalised);
@@ -598,7 +598,7 @@
 inline T ibeta_fraction2(T a, T b, T x, T y, const Policy& pol, bool normalised, T* p_derivative)
 {
    typedef typename lanczos::lanczos<T, Policy>::type lanczos_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    T result = ibeta_power_terms(a, b, x, y, lanczos_type(), normalised, pol);
    if(p_derivative)
    {
@@ -703,7 +703,7 @@
 T beta_small_b_large_a_series(T a, T b, T x, T y, T s0, T mult, const Policy& pol, bool normalised)
 {
    typedef typename lanczos::lanczos<T, Policy>::type lanczos_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // This is DiDonato and Morris's BGRAT routine, see Eq's 9 through 9.6.
    //
@@ -814,7 +814,7 @@
 template <class T>
 inline T binomial_ccdf(T n, T k, T x, T y)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    T result = pow(x, n);
    T term = result;
    for(unsigned i = tools::real_cast<unsigned>(n - 1); i > k; --i)
@@ -838,7 +838,7 @@
 {
    static const char* function = "boost::math::ibeta<%1%>(%1%, %1%, %1%)";
    typedef typename lanczos::lanczos<T, Policy>::type lanczos_type;
- using namespace std; // for ADL of std math functions.
+ BOOST_MATH_STD_USING // for ADL of std math functions.
 
    bool invert = inv;
    T fract;

Modified: sandbox/math_toolkit/boost/math/special_functions/binomial.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/binomial.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/binomial.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -15,7 +15,7 @@
 template <class T, class Policy>
 T binomial_coefficient(unsigned n, unsigned k, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    static const char* function = "boost::math::binomial_coefficient<%1%>(unsigned, unsigned)";
    if(k > n)
       return policies::raise_domain_error<T>(

Modified: sandbox/math_toolkit/boost/math/special_functions/cbrt.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/cbrt.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/cbrt.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -30,8 +30,8 @@
 template <class T, class Policy>
 T cbrt_imp(T z, const Policy&)
 {
- using namespace std;
- int exp, sign(1);
+ BOOST_MATH_STD_USING
+ int i_exp, sign(1);
    if(z < 0)
    {
       z = -z;
@@ -40,10 +40,10 @@
    if(z == 0)
       return 0;
 
- frexp(z, &exp);
- T min = static_cast<T>(ldexp(0.5, exp/3));
- T max = static_cast<T>(ldexp(2.0, exp/3));
- T guess = static_cast<T>(ldexp(1.0, exp/3));
+ frexp(z, &i_exp);
+ T min = static_cast<T>(ldexp(0.5, i_exp/3));
+ T max = static_cast<T>(ldexp(2.0, i_exp/3));
+ T guess = static_cast<T>(ldexp(1.0, i_exp/3));
    int digits = (policies::digits<T, Policy>()) / 2;
    return sign * tools::halley_iterate(detail::cbrt_functor<T>(z), guess, min, max, digits);
 }

Modified: sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -16,7 +16,7 @@
 template <class T>
 T cos_pi(T x)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    // cos of pi*x:
    bool invert = false;
    if(x < 0.5)

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i0.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i0.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i0.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -64,7 +64,7 @@
     };
     T value, factor, r;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     if (x < 0)

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_i1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -64,7 +64,7 @@
     };
     T value, factor, r, w;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     w = abs(x);

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_ik.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -27,7 +27,7 @@
     T a, b, c, d, sigma, gamma1, gamma2;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 
@@ -92,7 +92,7 @@
     T C, D, f, a, b, delta, tiny, tolerance;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
     // |x| <= |v|, CF1_ik converges rapidly
     // |x| > |v|, CF1_ik needs O(|x|) iterations to converge
@@ -132,7 +132,7 @@
 template <typename T, typename Policy>
 int CF2_ik(T v, T x, T* Kv, T* Kv1, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::constants;
 
     T S, C, Q, D, f, a, b, q, delta, tolerance, current, prev;
@@ -202,7 +202,7 @@
     bool reflect = false;
     unsigned n, k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j0.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j0.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j0.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -98,7 +98,7 @@
 
     T value, factor, r, rc, rs;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_j1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -102,7 +102,7 @@
 
     T value, factor, r, rc, rs, w;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jn.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jn.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jn.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -22,7 +22,7 @@
 {
     T value(0), factor, current, prev, next;
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
     if (n == 0)
     {

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -35,7 +35,7 @@
     T a, d, e, sigma;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 
@@ -104,7 +104,7 @@
     unsigned long k;
     int s = 1;
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
     // |x| <= |v|, CF1_jy converges rapidly
     // |x| > |v|, CF1_jy needs O(|x|) iterations to converge
@@ -149,7 +149,7 @@
 template <typename T, typename Policy>
 int CF2_jy(T v, T x, T* p, T* q, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
     typedef typename complex_trait<T>::type complex_type;
 
@@ -211,7 +211,7 @@
 
     static const char* function = "boost::math::bessel_jy<%1%>(%1%,%1%)";
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy_asym.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy_asym.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_jy_asym.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -49,7 +49,7 @@
    //
    // Also A&S 9.2.5
    //
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    T chi = fabs(x) - constants::pi<T>() * (2 * v + 1) / 4;
    return sqrt(2 / (constants::pi<T>() * x))
       * (asymptotic_bessel_j_large_x_P(v, x) * cos(chi)
@@ -64,7 +64,7 @@
    //
    // Also A&S 9.2.5
    //
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    T chi = fabs(x) - constants::pi<T>() * (2 * v + 1) / 4;
    return sqrt(2 / (constants::pi<T>() * x))
       * (asymptotic_bessel_j_large_x_P(v, x) * sin(chi)
@@ -76,7 +76,7 @@
 {
    // Calculate the amplitude of J(v, x) and Y(v, x) for large
    // x: see A&S 9.2.28.
- using namespace std;
+ BOOST_MATH_STD_USING
    T s = 1;
    T mu = 4 * v * v;
    T txq = 2 * x;
@@ -116,7 +116,7 @@
 inline T asymptotic_bessel_y_large_x_2(T v, T x)
 {
    // See A&S 9.2.19.
- using namespace std;
+ BOOST_MATH_STD_USING
    // Get the phase and amplitude:
    T ampl = asymptotic_bessel_amplitude(v, x);
    T phase = asymptotic_bessel_phase_mx(v, x);
@@ -132,7 +132,7 @@
 inline T asymptotic_bessel_j_large_x_2(T v, T x)
 {
    // See A&S 9.2.19.
- using namespace std;
+ BOOST_MATH_STD_USING
    // Get the phase and amplitude:
    T ampl = asymptotic_bessel_amplitude(v, x);
    T phase = asymptotic_bessel_phase_mx(v, x);
@@ -156,7 +156,7 @@
 inline T asymptotic_bessel_y_limit(const mpl::int_<0>&)
 {
    // default case:
- using namespace std;
+ BOOST_MATH_STD_USING
    return 2.25 / pow(100 * tools::epsilon<T>() / T(0.001f), T(0.2f));
 }
 template <class T>
@@ -203,7 +203,7 @@
 inline T asymptotic_bessel_j_limit(const T& v, const mpl::int_<0>&)
 {
    // default case:
- using namespace std;
+ BOOST_MATH_STD_USING
    T v2 = (std::max)(T(3), v * v);
    return v2 / pow(100 * tools::epsilon<T>() / T(2e-5f), T(0.17f));
 }
@@ -266,7 +266,7 @@
 template <class T, class Policy>
 T asymptotic_bessel_i_large_x(T v, T x, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    T s = 1;
    T mu = 4 * v * v;
    T ex = 8 * x;

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k0.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k0.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k0.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -74,7 +74,7 @@
     };
     T value, factor, r, r1, r2;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::bessel_k0<%1%>(%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_k1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -74,7 +74,7 @@
     };
     T value, factor, r, r1, r2;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::bessel_k1<%1%>(%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y0.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y0.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y0.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -119,7 +119,7 @@
     ;
     T value, factor, r, rc, rs;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/bessel_y1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -106,7 +106,7 @@
     ;
     T value, factor, r, rc, rs;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/erf_inv.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/erf_inv.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/erf_inv.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -16,7 +16,7 @@
 template <class T, class Policy>
 T erf_inv_imp(const T& p, const T& q, const Policy&, const boost::mpl::int_<64>*)
 {
- using namespace std; // for ADL of std names.
+ BOOST_MATH_STD_USING // for ADL of std names.
 
    T result = 0;
    
@@ -275,7 +275,7 @@
 {
    std::tr1::tuple<T,T,T> operator()(const T& guess)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       T derivative = sign * (2 / sqrt(constants::pi<T>())) * exp(-(guess * guess));
       T derivative2 = -2 * guess * derivative;
       return std::tr1::make_tuple(((sign > 0) ? boost::math::erf(guess, Policy()) : boost::math::erfc(guess, Policy())) - target, derivative, derivative2);

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/gamma_inva.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/gamma_inva.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/gamma_inva.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -34,7 +34,7 @@
 template <class T, class Policy>
 T inverse_poisson_cornish_fisher(T lambda, T p, T q, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    // mean:
    T m = lambda;
    // standard deviation:
@@ -65,7 +65,7 @@
 template <class T, class Policy>
 T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol)
 {
- using namespace std; // for ADL of std lib math functions
+ BOOST_MATH_STD_USING // for ADL of std lib math functions
    //
    // Special cases first:
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inv_ab.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inv_ab.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inv_ab.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -36,7 +36,7 @@
 template <class T, class Policy>
 T inverse_negative_binomial_cornish_fisher(T n, T sf, T sfc, T p, T q, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    // mean:
    T m = n * (sfc) / sf;
    T t = sqrt(n * (sfc));
@@ -69,7 +69,7 @@
 template <class T, class Policy>
 T ibeta_inv_ab_imp(const T& b, const T& z, const T& p, const T& q, bool swap_ab, const Policy& pol)
 {
- using namespace std; // for ADL of std lib math functions
+ BOOST_MATH_STD_USING // for ADL of std lib math functions
    //
    // Special cases first:
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -25,7 +25,7 @@
 
    std::tr1::tuple<T, T> operator()(T x)
    {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
       T y = 1 - x;
       if(y == 0)
@@ -55,7 +55,7 @@
 template <class T, class Policy>
 T temme_method_1_ibeta_inverse(T a, T b, T z, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    const T r2 = sqrt(T(2));
    //
@@ -133,7 +133,7 @@
 template <class T, class Policy>
 T temme_method_2_ibeta_inverse(T /*a*/, T /*b*/, T z, T r, T theta, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    //
    // Get first estimate for eta, see Eq 3.9 and 3.10,
@@ -310,7 +310,7 @@
 template <class T, class Policy>
 T temme_method_3_ibeta_inverse(T a, T b, T p, T q, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    //
    // Begin by getting an initial approximation for the quantity
@@ -414,7 +414,7 @@
 
    std::tr1::tuple<T, T, T> operator()(T x)
    {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
       BOOST_FPU_EXCEPTION_GUARD
       
@@ -448,7 +448,7 @@
 template <class T, class Policy>
 T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py)
 {
- using namespace std; // For ADL of math functions.
+ BOOST_MATH_STD_USING // For ADL of math functions.
 
    //
    // The flag invert is set to true if we swap a for b and p for q,

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -27,7 +27,7 @@
    //
    // See equation 32.
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    T t;
    if(p < 0.5)
    {
@@ -83,7 +83,7 @@
    //
    // See equation 34.
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    T u = log(p) + boost::math::lgamma(a + 1, pol);
    return exp((u + x - log(didonato_SN(a, x, N, tolerance))) / a);
 }
@@ -100,7 +100,7 @@
    // ACM Transactions on Mathematical Software, Vol. 12, No. 4,
    // December 1986, Pages 377-393.
    //
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T result;
 
@@ -302,7 +302,7 @@
          policies::discrete_quantile<>,
          policies::assert_undefined<> >::type forwarding_policy;
 
- using namespace std; // For ADL of std functions.
+ BOOST_MATH_STD_USING // For ADL of std functions.
 
       T f, f1;
       value_type ft;
@@ -341,7 +341,7 @@
 template <class T, class Policy>
 T gamma_p_inv_imp(T a, T p, const Policy& pol)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
 
    static const char* function = "boost::math::gamma_p_inv<%1%>(%1%, %1%)";
 
@@ -383,7 +383,7 @@
 template <class T, class Policy>
 T gamma_q_inv_imp(T a, T q, const Policy& pol)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
 
    static const char* function = "boost::math::gamma_q_inv<%1%>(%1%, %1%)";
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -64,7 +64,7 @@
 template <class T, class Policy>
 T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<64> const *)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
    T sigma = (x - a) / a;
    T phi = -log1pmx(sigma, pol);
    T y = a * phi;
@@ -269,7 +269,7 @@
 template <class T, class Policy>
 T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<53> const *)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
    T sigma = (x - a) / a;
    T phi = -log1pmx(sigma, pol);
    T y = a * phi;
@@ -411,7 +411,7 @@
 template <class T, class Policy>
 T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<24> const *)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
    T sigma = (x - a) / a;
    T phi = -log1pmx(sigma, pol);
    T y = a * phi;
@@ -467,7 +467,7 @@
 template <class T, class Policy>
 T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<113> const *)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
    T sigma = (x - a) / a;
    T phi = -log1pmx(sigma, pol);
    T y = a * phi;

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/lgamma_small.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/lgamma_small.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/lgamma_small.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -19,7 +19,7 @@
    // (80-bit long doubles), works well for 53-bit doubles as well.
    // L is only used to select the Lanczos function.
 
- using namespace std; // for ADL of std names
+ BOOST_MATH_STD_USING // for ADL of std names
    T result = 0;
    if(z < tools::epsilon<T>())
    {
@@ -208,7 +208,7 @@
    // values of z accurate enough for 113-bit mantissas
    // (128-bit long doubles).
    //
- using namespace std; // for ADL of std names
+ BOOST_MATH_STD_USING // for ADL of std names
    T result = 0;
    if(z < tools::epsilon<T>())
    {
@@ -467,7 +467,7 @@
    // what to do with.... we do have a Lanczos approximation
    // though, and that can be used to keep errors under control.
    //
- using namespace std; // for ADL of std names
+ BOOST_MATH_STD_USING // for ADL of std names
    T result = 0;
    if(z < tools::epsilon<T>())
    {

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/simple_complex.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/simple_complex.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/simple_complex.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -40,7 +40,7 @@
    }
    simple_complex& operator /= (const simple_complex& o)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       T lr;
       T li;
       if(fabs(o.r) > fabs(o.i))

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -20,7 +20,7 @@
 template <class T, class Policy>
 T inverse_students_t_hill(T ndf, T u, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    BOOST_ASSERT(u <= 0.5);
 
    T a, b, c, d, q, x, y;
@@ -70,7 +70,7 @@
 template <class T, class Policy>
 T inverse_students_t_tail_series(T df, T v, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    // Tail series expansion, see section 6 of Shaw's paper.
    // w is calculated using Eq 60:
    T w = boost::math::tgamma_delta_ratio(df / 2, constants::half<T>(), pol)
@@ -121,7 +121,7 @@
 template <class T, class Policy>
 T inverse_students_t_body_series(T df, T u, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // Body series for small N:
    //
@@ -181,7 +181,7 @@
    // v = 1 - u.
    // l = lanczos type to use.
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    bool invert = false;
    T result = 0;
    if(pexact)
@@ -393,7 +393,7 @@
 template <class T, class Policy>
 inline T fast_students_t_quantile_imp(T df, T p, const Policy& pol, const mpl::false_*)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // Need to use inverse incomplete beta to get
    // required precision so not so fast:
@@ -416,7 +416,7 @@
 template <class T, class Policy>
 T fast_students_t_quantile_imp(T df, T p, const Policy& pol, const mpl::true_*)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    bool invert = false;
    if((df < 2) && (floor(df) != df))
       return boost::math::detail::fast_students_t_quantile_imp(df, p, pol, static_cast<mpl::false_*>(0));

Modified: sandbox/math_toolkit/boost/math/special_functions/digamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/digamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/digamma.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -37,7 +37,7 @@
 template <class T>
 inline T digamma_imp_large(T x, const mpl::int_<0>*)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
    static const T P[] = {
       0.083333333333333333333333333333333333333333333333333L,
       -0.0083333333333333333333333333333333333333333333333333L,
@@ -70,7 +70,7 @@
 template <class T>
 inline T digamma_imp_large(T x, const mpl::int_<64>*)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
    static const T P[] = {
       0.083333333333333333333333333333333333333333333333333L,
       -0.0083333333333333333333333333333333333333333333333333L,
@@ -97,7 +97,7 @@
 template <class T>
 inline T digamma_imp_large(T x, const mpl::int_<53>*)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
    static const T P[] = {
       0.083333333333333333333333333333333333333333333333333L,
       -0.0083333333333333333333333333333333333333333333333333L,
@@ -121,7 +121,7 @@
 template <class T>
 inline T digamma_imp_large(T x, const mpl::int_<24>*)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
    static const T P[] = {
       0.083333333333333333333333333333333333333333333333333L,
       -0.0083333333333333333333333333333333333333333333333333L,
@@ -345,7 +345,7 @@
    // This handles reflection of negative arguments, and all our
    // error handling, then forwards to the T-specific approximation.
    //
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
 
    T result = 0;
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -32,7 +32,7 @@
 template <typename T, typename Policy>
 T ellint_f_imp(T phi, T k, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 
@@ -105,7 +105,7 @@
 template <typename T, typename Policy>
 T ellint_k_imp(T k, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_k<%1%>(%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_2.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_2.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_2.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -36,7 +36,7 @@
 template <typename T, typename Policy>
 T ellint_e_imp(T phi, T k, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 
@@ -95,7 +95,7 @@
 template <typename T, typename Policy>
 T ellint_e_imp(T k, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     if (abs(k) > 1)

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -42,7 +42,7 @@
     // Note vc = 1-v presumably without cancellation error.
     T value, x, y, z, p, t;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
     using namespace boost::math::constants;
 
@@ -227,7 +227,7 @@
 T ellint_pi_imp(T v, T k, T vc, const Policy& pol)
 {
     // Note arg vc = 1-v, possibly without cancellation errors
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_pi<%1%>(%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_rc.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_rc.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_rc.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -29,7 +29,7 @@
     T value, S, u, lambda, tolerance, prefix;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_rc<%1%>(%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_rd.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_rd.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_rd.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -28,7 +28,7 @@
     T X, Y, Z, EA, EB, EC, ED, EE, S1, S2;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_rd<%1%>(%1%,%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_rf.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_rf.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_rf.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -29,7 +29,7 @@
     T value, X, Y, Z, E2, E3, u, lambda, tolerance;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_rf<%1%>(%1%,%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_rj.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_rj.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_rj.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -31,7 +31,7 @@
     T X, Y, Z, P, EA, EB, EC, E2, E3, S1, S2, S3;
     unsigned long k;
 
- using namespace std;
+ BOOST_MATH_STD_USING
     using namespace boost::math::tools;
 
     static const char* function = "boost::math::ellint_rj<%1%>(%1%,%1%,%1%)";

Modified: sandbox/math_toolkit/boost/math/special_functions/erf.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/erf.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/erf.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -25,7 +25,7 @@
 {
    erf_asympt_series_t(T z) : xx(2 * -z * z), tk(1)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       result = -exp(-z * z) / sqrt(boost::math::constants::pi<T>());
       result /= z;
    }
@@ -34,7 +34,7 @@
 
    T operator()()
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       T r = result;
       result *= tk / xx;
       tk += 2;
@@ -111,7 +111,7 @@
 template <class T, class Policy, class Tag>
 T erf_imp(T z, bool invert, const Policy& pol, const Tag& t)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    BOOST_MATH_INSTRUMENT_CODE("Generic erf_imp called");
 
@@ -167,7 +167,7 @@
 template <class T, class Policy>
 T erf_imp(T z, bool invert, const Policy& pol, const mpl::int_<53>& t)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    BOOST_MATH_INSTRUMENT_CODE("53-bit precision erf_imp called");
 
@@ -320,7 +320,7 @@
 template <class T, class Policy>
 T erf_imp(T z, bool invert, const Policy& pol, const mpl::int_<64>& t)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    BOOST_MATH_INSTRUMENT_CODE("64-bit precision erf_imp called");
 
@@ -513,7 +513,7 @@
 template <class T, class Policy>
 T erf_imp(T z, bool invert, const Policy& pol, const mpl::int_<113>& t)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    BOOST_MATH_INSTRUMENT_CODE("113-bit precision erf_imp called");
 

Modified: sandbox/math_toolkit/boost/math/special_functions/expm1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/expm1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/expm1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -68,7 +68,7 @@
 template <class T, class Policy>
 T expm1_imp(T x, const mpl::int_<0>&, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T a = fabs(x);
    if(a > T(0.5L))
@@ -90,7 +90,7 @@
 template <class T, class P>
 T expm1_imp(T x, const mpl::int_<53>&, const P&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T a = fabs(x);
    if(a > T(0.5L))
@@ -109,7 +109,7 @@
 template <class T, class P>
 T expm1_imp(T x, const mpl::int_<64>&, const P&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T a = fabs(x);
    if(a > T(0.5L))
@@ -144,7 +144,7 @@
 template <class T, class P>
 T expm1_imp(T x, const mpl::int_<113>&, const P&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T a = fabs(x);
    if(a > T(0.5L))

Modified: sandbox/math_toolkit/boost/math/special_functions/factorials.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/factorials.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/factorials.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -26,7 +26,7 @@
 template <class T, class Policy>
 inline T factorial(unsigned i, const Policy& pol)
 {
- using namespace std; // Aid ADL for floor.
+ BOOST_MATH_STD_USING // Aid ADL for floor.
 
    if(i <= max_factorial<T>::value)
       return unchecked_factorial<T>(i);
@@ -62,7 +62,7 @@
 template <class T, class Policy>
 T double_factorial(unsigned i, const Policy& pol)
 {
- using namespace std; // ADL lookup of std names
+ BOOST_MATH_STD_USING // ADL lookup of std names
    if(i & 1)
    {
       // odd i:
@@ -139,7 +139,7 @@
 template <class T, class Policy>
 inline T falling_factorial_imp(T x, unsigned n, const Policy& pol)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    if(x == 0)
       return 0;
    if(x < 0)

Modified: sandbox/math_toolkit/boost/math/special_functions/gamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/gamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/gamma.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -75,7 +75,7 @@
 inline bool is_odd(T v, const boost::false_type&)
 {
    // Oh dear can't cast T to int!
- using namespace std;
+ BOOST_MATH_STD_USING
    T modulus = v - 2 * floor(v/2);
    return static_cast<bool>(modulus != 0);
 }
@@ -90,7 +90,7 @@
 {
    // Ad hoc function calculates x * sin(pi * x),
    // taking extra care near when x is near a whole number.
- using namespace std;
+ BOOST_MATH_STD_USING
    int sign = 1;
    if(z < 0)
    {
@@ -124,7 +124,7 @@
 template <class T, class Policy, class L>
 T gamma_imp(T z, const Policy& pol, const L& l)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T result = 1;
 
@@ -201,7 +201,7 @@
    }
 #endif
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
    static const char* function = "boost::math::lgamma<%1%>(%1%)";
 
@@ -337,7 +337,7 @@
 T gamma_imp(T z, const Policy& pol, const lanczos::undefined_lanczos& l)
 {
    static const char* function = "boost::math::tgamma<%1%>(%1%)";
- using namespace std;
+ BOOST_MATH_STD_USING
    if((z <= 0) && (floor(z) == z))
       return policies::raise_pole_error<T>(function, "Evaluation of tgamma at a negative integer %1%.", z, pol);
    if(z <= -20)
@@ -387,7 +387,7 @@
 template <class T, class Policy>
 T lgamma_imp(T z, const Policy& pol, const lanczos::undefined_lanczos& l, int*sign)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    static const char* function = "boost::math::lgamma<%1%>(%1%)";
    T result = 0;
@@ -427,7 +427,7 @@
 template <class T, class Policy, class L>
 T tgammap1m1_imp(T dz, Policy const& pol, const L& l)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename policies::precision<T,Policy>::type precision_type;
 
@@ -486,7 +486,7 @@
 inline T tgammap1m1_imp(T dz, Policy const& pol,
                  const ::boost::math::lanczos::undefined_lanczos& l)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    //
    // There should be a better solution than this, but the
    // algebra isn't easy for the general case....
@@ -541,7 +541,7 @@
 template <class T, class Policy>
 T full_igamma_prefix(T a, T z, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T prefix;
    T alz = a * log(z);
@@ -592,7 +592,7 @@
 template <class T, class Policy, class L>
 T regularised_gamma_prefix(T a, T z, const Policy& pol, const L& l)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    T agh = a + static_cast<T>(L::g()) - T(0.5);
    T prefix;
    T d = ((z - a) - static_cast<T>(L::g()) + T(0.5)) / agh;
@@ -674,7 +674,7 @@
 template <class T, class Policy>
 T regularised_gamma_prefix(T a, T z, const Policy& pol, const lanczos::undefined_lanczos&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T limit = (std::max)(T(10), a);
    T sum = detail::lower_gamma_series(a, limit, pol) / a;
@@ -722,7 +722,7 @@
 template <class T, class Policy>
 inline T tgamma_small_upper_part(T a, T x, const Policy& pol)
 {
- using namespace std; // ADL of std functions.
+ BOOST_MATH_STD_USING // ADL of std functions.
    //
    // Compute the full upper fraction (Q) when a is very small:
    //
@@ -748,7 +748,7 @@
    //
    // Calculates normalised Q when a is an integer:
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    T sum = exp(-x);
    if(sum != 0)
    {
@@ -771,7 +771,7 @@
    //
    // Calculates normalised Q when a is a half-integer:
    //
- using namespace std;
+ BOOST_MATH_STD_USING
    T e = boost::math::erfc(sqrt(x), pol);
    if((e != 0) && (a > 1))
    {
@@ -812,7 +812,7 @@
    if(x < 0)
       policies::raise_domain_error<T>(function, "Argument x to the incomplete gamma function must be >= 0 (got x=%1%).", x, pol);
 
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename lanczos::lanczos<T, Policy>::type lanczos_type;
 
@@ -1015,7 +1015,7 @@
 template <class T, class Policy, class L>
 T tgamma_delta_ratio_imp_lanczos(T z, T delta, const Policy& pol, const L&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    T zgh = z + L::g() - constants::half<T>();
    T result;
    if(fabs(delta) < 10)
@@ -1036,7 +1036,7 @@
 template <class T, class Policy>
 T tgamma_delta_ratio_imp_lanczos(T z, T delta, const Policy& pol, const lanczos::undefined_lanczos&)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // The upper gamma fraction is *very* slow for z < 6, actually it's very
    // slow to converge everywhere but recursing until z > 6 gets rid of the
@@ -1073,7 +1073,7 @@
 template <class T, class Policy>
 T tgamma_delta_ratio_imp(T z, T delta, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(z <= 0)
       policies::raise_domain_error<T>("boost::math::tgamma_delta_ratio<%1%>(%1%, %1%)", "Gamma function ratios only implemented for positive arguments (got a=%1%).", z, pol);

Modified: sandbox/math_toolkit/boost/math/special_functions/legendre.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/legendre.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/legendre.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -158,7 +158,7 @@
 template <class T, class Policy>
 inline T legendre_p_imp(int l, int m, T x, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    // TODO: we really could use that mythical "pow1p" function here:
    return legendre_p_imp(l, m, x, pow(1 - x*x, T(abs(m))/2), pol);
 }

Modified: sandbox/math_toolkit/boost/math/special_functions/log1p.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/log1p.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/log1p.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -71,7 +71,7 @@
 { // The function returns the natural logarithm of 1 + x.
   // A domain error occurs if x < -1. TODO should there be a check?
    typedef typename tools::promote_args<T>::type result_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    using std::abs;
 
    static const char* function = "boost::math::log1p<%1%>(%1%)";
@@ -231,7 +231,7 @@
    log1pmx(T x, const Policy& pol)
 {
    typedef typename tools::promote_args<T>::type result_type;
- using namespace std;
+ BOOST_MATH_STD_USING
    static const char* function = "boost::math::log1pmx<%1%>(%1%)";
 
    if(x < -1)

Modified: sandbox/math_toolkit/boost/math/special_functions/powm1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/powm1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/powm1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -16,7 +16,7 @@
 template <class T, class Policy>
 inline T powm1_imp(const T a, const T z, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if((fabs(a) < 1) || (fabs(z) < 1))
    {

Modified: sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -16,7 +16,7 @@
 template <class T>
 T sin_pi(T x)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
    // sin of pi*x:
    bool invert;
    if(x < 0.5)

Modified: sandbox/math_toolkit/boost/math/special_functions/sinc.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sinc.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sinc.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -112,7 +112,7 @@
         inline U<T> sinc_pi(const U<T> x)
         {
 #if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) || defined(__GNUC__)
- using namespace std;
+ BOOST_MATH_STD_USING
 #elif defined(BOOST_NO_STDC_NAMESPACE)
             using ::abs;
             using ::sin;

Modified: sandbox/math_toolkit/boost/math/special_functions/sinhc.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sinhc.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sinhc.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -109,7 +109,7 @@
         inline U<T> sinhc_pi(const U<T> x)
         {
 #if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) || defined(__GNUC__)
- using namespace std;
+ BOOST_MATH_STD_USING
 #elif defined(BOOST_NO_STDC_NAMESPACE)
             using ::abs;
             using ::sinh;

Modified: sandbox/math_toolkit/boost/math/special_functions/spherical_harmonic.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/spherical_harmonic.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/spherical_harmonic.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -23,7 +23,7 @@
 template <class T, class Policy>
 inline T spherical_harmonic_prefix(unsigned n, unsigned m, T theta, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(m > n)
       return 0;
@@ -44,7 +44,7 @@
 template <class T, class Policy>
 T spherical_harmonic_r(unsigned n, int m, T theta, T phi, const Policy& pol)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
 
    bool sign = false;
    if(m < 0)
@@ -71,7 +71,7 @@
 template <class T, class Policy>
 T spherical_harmonic_i(unsigned n, int m, T theta, T phi, const Policy& pol)
 {
- using namespace std; // ADL of std functions
+ BOOST_MATH_STD_USING // ADL of std functions
 
    bool sign = false;
    if(m < 0)
@@ -98,7 +98,7 @@
 template <class T, class U, class Policy>
 std::complex<T> spherical_harmonic(unsigned n, int m, U theta, U phi, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // Sort out the signs:
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/sqrt1pm1.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sqrt1pm1.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sqrt1pm1.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -20,7 +20,7 @@
 inline typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy& pol)
 {
    typedef typename tools::promote_args<T>::type result_type;
- using namespace std;
+ BOOST_MATH_STD_USING
 
    if(fabs(result_type(val)) > 0.75)
       return sqrt(1 + result_type(val)) - 1;

Modified: sandbox/math_toolkit/boost/math/tools/config.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/config.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/config.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -46,6 +46,34 @@
 #ifndef BOOST_MATH_INT_TABLE_TYPE
 # define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
 #endif
+//
+// Helper macro for using statements:
+//
+#define BOOST_MATH_STD_USING \
+ using std::abs;\
+ using std::acos;\
+ using std::cos;\
+ using std::fmod;\
+ using std::modf;\
+ using std::tan;\
+ using std::asin;\
+ using std::cosh;\
+ using std::frexp;\
+ using std::pow;\
+ using std::tanh;\
+ using std::atan;\
+ using std::exp;\
+ using std::ldexp;\
+ using std::sin;\
+ using std::atan2;\
+ using std::fabs;\
+ using std::log;\
+ using std::sinh;\
+ using std::ceil;\
+ using std::floor;\
+ using std::log10;\
+ using std::sqrt;
+
 
 namespace boost{ namespace math{
 namespace tools

Modified: sandbox/math_toolkit/boost/math/tools/fraction.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/fraction.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/fraction.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -83,7 +83,7 @@
 template <class Gen>
 typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, int bits)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    typedef detail::fraction_traits<Gen> traits;
    typedef typename traits::result_type result_type;
@@ -120,7 +120,7 @@
 template <class Gen>
 typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, int bits, boost::uintmax_t& max_terms)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    typedef detail::fraction_traits<Gen> traits;
    typedef typename traits::result_type result_type;
@@ -175,7 +175,7 @@
 template <class Gen>
 typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, int bits)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    typedef detail::fraction_traits<Gen> traits;
    typedef typename traits::result_type result_type;
@@ -213,7 +213,7 @@
 template <class Gen>
 typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, int bits, boost::uintmax_t& max_terms)
 {
- using namespace std; // ADL of std names
+ BOOST_MATH_STD_USING // ADL of std names
 
    typedef detail::fraction_traits<Gen> traits;
    typedef typename traits::result_type result_type;

Modified: sandbox/math_toolkit/boost/math/tools/minima.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/minima.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/minima.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -18,7 +18,7 @@
 template <class F, class T>
 std::pair<T, T> brent_find_minima(F f, T min, T max, int bits, boost::uintmax_t& max_iter)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    bits = (std::min)(policies::digits<T, policies::policy<> >() / 2, bits);
    T tolerance = static_cast<T>(ldexp(1.0, 1-bits));
    T x; // minima so far
@@ -129,7 +129,7 @@
 
    max_iter -= count;
 
- return make_pair(x, fx);
+ return std::make_pair(x, fx);
 }
 
 template <class F, class T>

Modified: sandbox/math_toolkit/boost/math/tools/precision.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/precision.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/precision.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -124,7 +124,7 @@
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
 #endif
- using namespace std;
+ BOOST_MATH_STD_USING
    static const T val = log((std::numeric_limits<T>::max)());
    return val;
 }
@@ -137,7 +137,7 @@
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
 #endif
- using namespace std;
+ BOOST_MATH_STD_USING
    static const T val = log((std::numeric_limits<T>::max)());
    return val;
 }
@@ -163,7 +163,7 @@
 template <class T>
 inline T epsilon(const mpl::false_& BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T))
 {
- using namespace std; // for ADL of std names
+ BOOST_MATH_STD_USING // for ADL of std names
    static const T eps = ldexp(static_cast<T>(1), 1-policies::digits<T, policies::policy<> >());
    return eps;
 }
@@ -185,7 +185,7 @@
    return detail::log_max_value<T>(tag_type());
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
- using namespace std;
+ BOOST_MATH_STD_USING
    static const T val = log((std::numeric_limits<T>::max)());
    return val;
 #endif
@@ -207,7 +207,7 @@
    return detail::log_min_value<T>(tag_type());
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
- using namespace std;
+ BOOST_MATH_STD_USING
    static const T val = log((std::numeric_limits<T>::min)());
    return val;
 #endif

Modified: sandbox/math_toolkit/boost/math/tools/remez.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/remez.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/remez.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -87,7 +87,7 @@
 
    T operator()(const T& x)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       return -fabs(func(x));
    }
 private:
@@ -192,7 +192,7 @@
 template <class T>
 void remez_minimax<T>::init_chebyshev()
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // Fill in the zeros:
    //
@@ -405,7 +405,7 @@
 template <class T>
 T remez_minimax<T>::iterate()
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    matrix_type A(unknowns, unknowns);
    vector_type b(unknowns);
 

Modified: sandbox/math_toolkit/boost/math/tools/roots.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/roots.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/roots.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -175,7 +175,7 @@
 template <class F, class T>
 T newton_raphson_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T f0(0), f1, last_f0(0);
    T result = guess;
@@ -263,7 +263,7 @@
 template <class F, class T>
 T halley_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T f0(0), f1, f2;
    T result = guess;
@@ -410,7 +410,7 @@
 template <class F, class T>
 T schroeder_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    T f0(0), f1, f2, last_f0(0);
    T result = guess;

Modified: sandbox/math_toolkit/boost/math/tools/series.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/series.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/series.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -8,6 +8,7 @@
 
 #include <cmath>
 #include <boost/cstdint.hpp>
+#include <boost/math/tools/config.hpp>
 
 namespace boost{ namespace math{ namespace tools{
 
@@ -17,7 +18,7 @@
 template <class Functor>
 typename Functor::result_type sum_series(Functor& func, int bits)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 
@@ -35,7 +36,7 @@
 template <class Functor>
 typename Functor::result_type sum_series(Functor& func, int bits, boost::uintmax_t& max_terms)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 
@@ -59,7 +60,7 @@
 template <class Functor, class U>
 typename Functor::result_type sum_series(Functor& func, int bits, U init_value)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 
@@ -78,7 +79,7 @@
 template <class Functor, class U>
 typename Functor::result_type sum_series(Functor& func, int bits, boost::uintmax_t& max_terms, U init_value)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 
@@ -114,7 +115,7 @@
 template <class Functor>
 typename Functor::result_type kahan_sum_series(Functor& func, int bits)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 
@@ -137,7 +138,7 @@
 template <class Functor>
 typename Functor::result_type kahan_sum_series(Functor& func, int bits, boost::uintmax_t& max_terms)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 
    typedef typename Functor::result_type result_type;
 

Modified: sandbox/math_toolkit/boost/math/tools/stats.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/stats.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/stats.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -40,7 +40,7 @@
    boost::uintmax_t count()const{ return m_count; }
    T variance()const
    {
- using namespace std;
+ BOOST_MATH_STD_USING
 
       T t = m_squared_total - m_total * m_total / m_count;
       t /= m_count;
@@ -48,7 +48,7 @@
    }
    T variance1()const
    {
- using namespace std;
+ BOOST_MATH_STD_USING
 
       T t = m_squared_total - m_total * m_total / m_count;
       t /= (m_count-1);
@@ -56,7 +56,7 @@
    }
    T rms()const
    {
- using namespace std;
+ BOOST_MATH_STD_USING
 
       return sqrt(m_squared_total / static_cast<T>(m_count));
    }

Modified: sandbox/math_toolkit/boost/math/tools/test.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/test.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/test.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -54,7 +54,7 @@
 template <class T>
 T relative_error(T a, T b)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
 #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    //
    // If math.h has no long double support we can't rely
@@ -106,7 +106,7 @@
 template <>
 inline double relative_error<double>(double a, double b)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    //
    // On Mac OS X we evaluate "double" functions at "long double" precision,
    // but "long double" actually has a very slightly narrower range than "double"!

Modified: sandbox/math_toolkit/boost/math/tools/toms748_solve.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/toms748_solve.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/toms748_solve.hpp 2007-09-03 07:51:07 EDT (Mon, 03 Sep 2007)
@@ -21,12 +21,12 @@
 public:
    eps_tolerance(unsigned bits)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       eps = (std::max)(T(ldexp(1.0F, 1-bits)), 2 * tools::epsilon<T>());
    }
    bool operator()(const T& a, const T& b)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       return (fabs(a - b) / (std::min)(fabs(a), fabs(b))) <= eps;
    }
 private:
@@ -39,7 +39,7 @@
    template <class T>
    bool operator()(const T& a, const T& b)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       return floor(a) == floor(b);
    }
 };
@@ -50,7 +50,7 @@
    template <class T>
    bool operator()(const T& a, const T& b)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       return ceil(a) == ceil(b);
    }
 };
@@ -61,7 +61,7 @@
    template <class T>
    bool operator()(const T& a, const T& b)
    {
- using namespace std;
+ BOOST_MATH_STD_USING
       return floor(a + 0.5f) == floor(b + 0.5f);
    }
 };
@@ -79,7 +79,7 @@
    // the interval. In other words d is the third best guess
    // to the root.
    //
- using namespace std; // For ADL of std math functions
+ BOOST_MATH_STD_USING // For ADL of std math functions
    T tol = tools::epsilon<T>() * 2;
    //
    // If the interval [a,b] is very small, or if c is too close
@@ -139,7 +139,7 @@
    // return num / denom without overflow,
    // return r if overflow would occur.
    //
- using namespace std; // For ADL of std math functions
+ BOOST_MATH_STD_USING // For ADL of std math functions
 
    if(fabs(denom) < 1)
    {
@@ -161,7 +161,7 @@
    // that the function is unlikely to be smooth with a root very
    // close to a or b.
    //
- using namespace std; // For ADL of std math functions
+ BOOST_MATH_STD_USING // For ADL of std math functions
 
    T tol = tools::epsilon<T>() * 5;
    T c = a - (fa / (fb - fa)) * (b - a);
@@ -282,7 +282,7 @@
    // Main entry point and logic for Toms Algorithm 748
    // root finder.
    //
- using namespace std; // For ADL of std math functions
+ BOOST_MATH_STD_USING // For ADL of std math functions
 
    static const char* function = "boost::math::tools::toms748_solve<%1%>";
 
@@ -474,7 +474,7 @@
 template <class F, class T, class Tol, class Policy>
 std::pair<T, T> bracket_and_solve_root(F f, const T& guess, const T& factor, bool rising, Tol tol, boost::uintmax_t& max_iter, const Policy& pol)
 {
- using namespace std;
+ BOOST_MATH_STD_USING
    static const char* function = "boost::math::tools::bracket_and_solve_root<%1%>";
    //
    // Set up inital brackets:


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