Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71672 - in trunk/boost/math: concepts distributions policies special_functions special_functions/detail tools
From: john_at_[hidden]
Date: 2011-05-02 11:36:55


Author: johnmaddock
Date: 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
New Revision: 71672
URL: http://svn.boost.org/trac/boost/changeset/71672

Log:
Suppress a whole bunch of new gcc-4.6 warnings.
Add code to verify that the radix of the type is 2 wherever that assumption is made.
Add some more instrumentation code.
Text files modified:
   trunk/boost/math/concepts/distributions.hpp | 95 ++++++++++++++++++++++++++++++++--------
   trunk/boost/math/concepts/real_type_concept.hpp | 12 +++++
   trunk/boost/math/distributions/bernoulli.hpp | 10 ++--
   trunk/boost/math/distributions/beta.hpp | 18 +++---
   trunk/boost/math/distributions/binomial.hpp | 16 +++---
   trunk/boost/math/distributions/cauchy.hpp | 6 +-
   trunk/boost/math/distributions/exponential.hpp | 14 ++--
   trunk/boost/math/distributions/extreme_value.hpp | 14 ++--
   trunk/boost/math/distributions/fisher_f.hpp | 20 ++++----
   trunk/boost/math/distributions/gamma.hpp | 20 ++++----
   trunk/boost/math/distributions/geometric.hpp | 18 +++---
   trunk/boost/math/distributions/hypergeometric.hpp | 10 ++--
   trunk/boost/math/distributions/inverse_gamma.hpp | 22 ++++----
   trunk/boost/math/distributions/inverse_gaussian.hpp | 10 ++--
   trunk/boost/math/distributions/laplace.hpp | 10 ++--
   trunk/boost/math/distributions/logistic.hpp | 10 ++--
   trunk/boost/math/distributions/lognormal.hpp | 22 ++++----
   trunk/boost/math/distributions/negative_binomial.hpp | 18 +++---
   trunk/boost/math/distributions/normal.hpp | 10 ++--
   trunk/boost/math/distributions/pareto.hpp | 24 +++++-----
   trunk/boost/math/distributions/poisson.hpp | 10 ++--
   trunk/boost/math/distributions/rayleigh.hpp | 14 ++--
   trunk/boost/math/distributions/triangular.hpp | 24 +++++-----
   trunk/boost/math/distributions/uniform.hpp | 22 ++++----
   trunk/boost/math/distributions/weibull.hpp | 22 ++++----
   trunk/boost/math/policies/error_handling.hpp | 2
   trunk/boost/math/policies/policy.hpp | 6 ++
   trunk/boost/math/special_functions/beta.hpp | 8 ++-
   trunk/boost/math/special_functions/cbrt.hpp | 2
   trunk/boost/math/special_functions/detail/t_distribution_inv.hpp | 5 +
   trunk/boost/math/special_functions/gamma.hpp | 15 ++++++
   trunk/boost/math/tools/config.hpp | 6 ++
   trunk/boost/math/tools/precision.hpp | 6 +
   33 files changed, 312 insertions(+), 209 deletions(-)

Modified: trunk/boost/math/concepts/distributions.hpp
==============================================================================
--- trunk/boost/math/concepts/distributions.hpp (original)
+++ trunk/boost/math/concepts/distributions.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -130,66 +130,118 @@
        // The result values are ignored in all these checks.
        value_type v = cdf(dist, x);
       v = cdf(complement(dist, x));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, x);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, x);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, x));
+ suppress_unused_variable_warning(v);
       v = mean(dist);
+ suppress_unused_variable_warning(v);
       v = mode(dist);
+ suppress_unused_variable_warning(v);
       v = standard_deviation(dist);
+ suppress_unused_variable_warning(v);
       v = variance(dist);
+ suppress_unused_variable_warning(v);
       v = hazard(dist, x);
+ suppress_unused_variable_warning(v);
       v = chf(dist, x);
+ suppress_unused_variable_warning(v);
       v = coefficient_of_variation(dist);
+ suppress_unused_variable_warning(v);
       v = skewness(dist);
+ suppress_unused_variable_warning(v);
       v = kurtosis(dist);
+ suppress_unused_variable_warning(v);
       v = kurtosis_excess(dist);
+ suppress_unused_variable_warning(v);
       v = median(dist);
+ suppress_unused_variable_warning(v);
       std::pair<value_type, value_type> pv;
       pv = range(dist);
+ suppress_unused_variable_warning(pv);
       pv = support(dist);
+ suppress_unused_variable_warning(pv);
 
       float f = 1;
       v = cdf(dist, f);
+ suppress_unused_variable_warning(v);
       v = cdf(complement(dist, f));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, f);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, f);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, f));
+ suppress_unused_variable_warning(v);
       v = hazard(dist, f);
+ suppress_unused_variable_warning(v);
       v = chf(dist, f);
+ suppress_unused_variable_warning(v);
       double d = 1;
       v = cdf(dist, d);
+ suppress_unused_variable_warning(v);
       v = cdf(complement(dist, d));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, d);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, d);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, d));
+ suppress_unused_variable_warning(v);
       v = hazard(dist, d);
+ suppress_unused_variable_warning(v);
       v = chf(dist, d);
+ suppress_unused_variable_warning(v);
 #ifndef TEST_MPFR
       long double ld = 1;
       v = cdf(dist, ld);
+ suppress_unused_variable_warning(v);
       v = cdf(complement(dist, ld));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, ld);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, ld);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, ld));
+ suppress_unused_variable_warning(v);
       v = hazard(dist, ld);
+ suppress_unused_variable_warning(v);
       v = chf(dist, ld);
+ suppress_unused_variable_warning(v);
 #endif
       int i = 1;
       v = cdf(dist, i);
+ suppress_unused_variable_warning(v);
       v = cdf(complement(dist, i));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, i);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, i);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, i));
+ suppress_unused_variable_warning(v);
       v = hazard(dist, i);
+ suppress_unused_variable_warning(v);
       v = chf(dist, i);
+ suppress_unused_variable_warning(v);
       unsigned long li = 1;
       v = cdf(dist, li);
+ suppress_unused_variable_warning(v);
       v = cdf(complement(dist, li));
+ suppress_unused_variable_warning(v);
       v = pdf(dist, li);
+ suppress_unused_variable_warning(v);
       v = quantile(dist, li);
+ suppress_unused_variable_warning(v);
       v = quantile(complement(dist, li));
+ suppress_unused_variable_warning(v);
       v = hazard(dist, li);
+ suppress_unused_variable_warning(v);
       v = chf(dist, li);
+ suppress_unused_variable_warning(v);
       test_extra_members(dist);
    }
    template <class D>
@@ -207,11 +259,13 @@
       value_type r1 = d.alpha();
       value_type r2 = d.beta();
       r1 = boost::math::beta_distribution<R, P>::find_alpha(r1, r2);
+ suppress_unused_variable_warning(r1);
       r1 = boost::math::beta_distribution<R, P>::find_beta(r1, r2);
+ suppress_unused_variable_warning(r1);
       r1 = boost::math::beta_distribution<R, P>::find_alpha(r1, r2, r1);
+ suppress_unused_variable_warning(r1);
       r1 = boost::math::beta_distribution<R, P>::find_beta(r1, r2, r1);
- (void)r1; // warning suppression
- (void)r2; // warning suppression
+ suppress_unused_variable_warning(r1);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::binomial_distribution<R, P>& d)
@@ -226,14 +280,14 @@
       r = Distribution::find_upper_bound_on_p(r, r, r, Distribution::jeffreys_prior_interval);
       r = Distribution::find_minimum_number_of_trials(r, r, r);
       r = Distribution::find_maximum_number_of_trials(r, r, r);
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::cauchy_distribution<R, P>& d)
    {
       value_type r = d.location();
       r = d.scale();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::chi_squared_distribution<R, P>& d)
@@ -241,48 +295,48 @@
       value_type r = d.degrees_of_freedom();
       r = Distribution::find_degrees_of_freedom(r, r, r, r);
       r = Distribution::find_degrees_of_freedom(r, r, r, r, r);
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::exponential_distribution<R, P>& d)
    {
       value_type r = d.lambda();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::extreme_value_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.location();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::fisher_f_distribution<R, P>& d)
    {
       value_type r = d.degrees_of_freedom1();
       r = d.degrees_of_freedom2();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::gamma_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.shape();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::inverse_chi_squared_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.degrees_of_freedom();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::inverse_gamma_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.shape();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::hypergeometric_distribution<R, P>& d)
@@ -290,28 +344,28 @@
       unsigned u = d.defective();
       u = d.sample_count();
       u = d.total();
- (void)u; // warning suppression
+ suppress_unused_variable_warning(u);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::laplace_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.location();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::logistic_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.location();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::lognormal_distribution<R, P>& d)
    {
       value_type r = d.scale();
       r = d.location();
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::negative_binomial_distribution<R, P>& d)
@@ -322,7 +376,7 @@
       r = Distribution::find_upper_bound_on_p(r, r, r);
       r = Distribution::find_minimum_number_of_trials(r, r, r);
       r = Distribution::find_maximum_number_of_trials(r, r, r);
- (void)r; // warning suppression
+ suppress_unused_variable_warning(r);
    }
    template <class R, class P>
    static void test_extra_members(const boost::math::non_central_beta_distribution<R, P>& d)
@@ -418,14 +472,17 @@
       (void)r; // warning suppression
    }
 private:
+ static Distribution* pd;
    static Distribution& get_object()
    {
- // will never get called:
- static char buf[sizeof(Distribution)];
- return * reinterpret_cast<Distribution*>(buf);
+ // In reality this will never get called:
+ return *pd;
    }
 }; // struct DistributionConcept
 
+template <class Distribution>
+Distribution* DistributionConcept<Distribution>::pd = 0;
+
 } // namespace concepts
 } // namespace math
 } // namespace boost

Modified: trunk/boost/math/concepts/real_type_concept.hpp
==============================================================================
--- trunk/boost/math/concepts/real_type_concept.hpp (original)
+++ trunk/boost/math/concepts/real_type_concept.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -44,17 +44,29 @@
       r = o / r;
       bool b;
       b = r == o;
+ suppress_unused_variable_warning(b);
       b = o == r;
+ suppress_unused_variable_warning(b);
       b = r != o;
+ suppress_unused_variable_warning(b);
       b = o != r;
+ suppress_unused_variable_warning(b);
       b = r <= o;
+ suppress_unused_variable_warning(b);
       b = o <= r;
+ suppress_unused_variable_warning(b);
       b = r >= o;
+ suppress_unused_variable_warning(b);
       b = o >= r;
+ suppress_unused_variable_warning(b);
       b = r < o;
+ suppress_unused_variable_warning(b);
       b = o < r;
+ suppress_unused_variable_warning(b);
       b = r > o;
+ suppress_unused_variable_warning(b);
       b = o > r;
+ suppress_unused_variable_warning(b);
    }
 
    void constraints()

Modified: trunk/boost/math/distributions/bernoulli.hpp
==============================================================================
--- trunk/boost/math/distributions/bernoulli.hpp (original)
+++ trunk/boost/math/distributions/bernoulli.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -153,7 +153,7 @@
     { // Probability Density/Mass Function.
       BOOST_FPU_EXCEPTION_GUARD
       // Error check:
- RealType result; // of checks.
+ RealType result = 0; // of checks.
       if(false == bernoulli_detail::check_dist_and_k(
         "boost::math::pdf(bernoulli_distribution<%1%>, %1%)",
         dist.success_fraction(), // 0 to 1
@@ -178,7 +178,7 @@
     { // Cumulative Distribution Function Bernoulli.
       RealType p = dist.success_fraction();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == bernoulli_detail::check_dist_and_k(
         "boost::math::cdf(bernoulli_distribution<%1%>, %1%)",
         p,
@@ -204,7 +204,7 @@
       bernoulli_distribution<RealType, Policy> const& dist = c.dist;
       RealType p = dist.success_fraction();
       // Error checks:
- RealType result;
+ RealType result = 0;
       if(false == bernoulli_detail::check_dist_and_k(
         "boost::math::cdf(bernoulli_distribution<%1%>, %1%)",
         p,
@@ -229,7 +229,7 @@
       // Return the number of expected successes k either 0 or 1.
       // for a given probability p.
 
- RealType result; // of error checks:
+ RealType result = 0; // of error checks:
       if(false == bernoulli_detail::check_dist_and_prob(
         "boost::math::quantile(bernoulli_distribution<%1%>, %1%)",
         dist.success_fraction(),
@@ -257,7 +257,7 @@
       // Error checks:
       RealType q = c.param;
       const bernoulli_distribution<RealType, Policy>& dist = c.dist;
- RealType result;
+ RealType result = 0;
       if(false == bernoulli_detail::check_dist_and_prob(
         "boost::math::quantile(bernoulli_distribution<%1%>, %1%)",
         dist.success_fraction(),

Modified: trunk/boost/math/distributions/beta.hpp
==============================================================================
--- trunk/boost/math/distributions/beta.hpp (original)
+++ trunk/boost/math/distributions/beta.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -187,7 +187,7 @@
         RealType variance) // Expected value of variance.
       {
         static const char* function = "boost::math::beta_distribution<%1%>::find_alpha";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         if(false ==
           beta_detail::check_mean(
           function, mean, &result, Policy())
@@ -206,7 +206,7 @@
         RealType variance) // Expected value of variance.
       {
         static const char* function = "boost::math::beta_distribution<%1%>::find_beta";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         if(false ==
           beta_detail::check_mean(
           function, mean, &result, Policy())
@@ -229,7 +229,7 @@
         RealType probability) // cdf
       {
         static const char* function = "boost::math::beta_distribution<%1%>::find_alpha";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         if(false ==
           beta_detail::check_prob(
           function, probability, &result, Policy())
@@ -253,7 +253,7 @@
         RealType probability) // probability cdf.
       {
         static const char* function = "boost::math::beta_distribution<%1%>::find_beta";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         if(false ==
           beta_detail::check_prob(
           function, probability, &result, Policy())
@@ -376,7 +376,7 @@
       RealType b = dist.beta();
 
       // Argument checks:
- RealType result;
+ RealType result = 0;
       if(false == beta_detail::check_dist_and_x(
         function,
         a, b, x,
@@ -399,7 +399,7 @@
       RealType b = dist.beta();
 
       // Argument checks:
- RealType result;
+ RealType result = 0;
       if(false == beta_detail::check_dist_and_x(
         function,
         a, b, x,
@@ -433,7 +433,7 @@
       RealType b = dist.beta();
 
       // Argument checks:
- RealType result;
+ RealType result = 0;
       if(false == beta_detail::check_dist_and_x(
         function,
         a, b, x,
@@ -468,7 +468,7 @@
 
       static const char* function = "boost::math::quantile(beta_distribution<%1%> const&, %1%)";
 
- RealType result; // of argument checks:
+ RealType result = 0; // of argument checks:
       RealType a = dist.alpha();
       RealType b = dist.beta();
       if(false == beta_detail::check_dist_and_prob(
@@ -502,7 +502,7 @@
       // Error checks:
       RealType q = c.param;
       const beta_distribution<RealType, Policy>& dist = c.dist;
- RealType result;
+ RealType result = 0;
       RealType a = dist.alpha();
       RealType b = dist.beta();
       if(false == beta_detail::check_dist_and_prob(

Modified: trunk/boost/math/distributions/binomial.hpp
==============================================================================
--- trunk/boost/math/distributions/binomial.hpp (original)
+++ trunk/boost/math/distributions/binomial.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -203,7 +203,7 @@
         //
         // Error checks:
         BOOST_MATH_STD_USING // ADL of std names
- RealType result;
+ RealType result = 0;
         RealType trials = dist.trials();
         RealType success_fraction = dist.success_fraction();
         if(false == binomial_detail::check_dist_and_prob(
@@ -317,7 +317,7 @@
       {
         static const char* function = "boost::math::binomial_distribution<%1%>::find_lower_bound_on_p";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            function, trials, RealType(0), successes, &result, Policy())
             &&
@@ -342,7 +342,7 @@
       {
         static const char* function = "boost::math::binomial_distribution<%1%>::find_upper_bound_on_p";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            function, trials, RealType(0), successes, &result, Policy())
             &&
@@ -369,7 +369,7 @@
       {
         static const char* function = "boost::math::binomial_distribution<%1%>::find_minimum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            function, k, p, k, &result, Policy())
             &&
@@ -388,7 +388,7 @@
       {
         static const char* function = "boost::math::binomial_distribution<%1%>::find_maximum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            function, k, p, k, &result, Policy())
             &&
@@ -446,7 +446,7 @@
         RealType n = dist.trials();
 
         // Error check:
- RealType result;
+ RealType result = 0; // initialization silences some compiler warnings
         if(false == binomial_detail::check_dist_and_k(
            "boost::math::pdf(binomial_distribution<%1%> const&, %1%)",
            n,
@@ -524,7 +524,7 @@
         RealType p = dist.success_fraction();
 
         // Error check:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            "boost::math::cdf(binomial_distribution<%1%> const&, %1%)",
            n,
@@ -598,7 +598,7 @@
         RealType p = dist.success_fraction();
 
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == binomial_detail::check_dist_and_k(
            "boost::math::cdf(binomial_distribution<%1%> const&, %1%)",
            n,

Modified: trunk/boost/math/distributions/cauchy.hpp
==============================================================================
--- trunk/boost/math/distributions/cauchy.hpp (original)
+++ trunk/boost/math/distributions/cauchy.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -56,7 +56,7 @@
    //
    BOOST_MATH_STD_USING // for ADL of std functions
    static const char* function = "boost::math::cdf(cauchy<%1%>&, %1%)";
- RealType result;
+ RealType result = 0;
    RealType location = dist.location();
    RealType scale = dist.scale();
    if(false == detail::check_location(function, location, &result, Policy()))
@@ -105,7 +105,7 @@
    static const char* function = "boost::math::quantile(cauchy<%1%>&, %1%)";
    BOOST_MATH_STD_USING // for ADL of std functions
 
- RealType result;
+ RealType result = 0;
    RealType location = dist.location();
    RealType scale = dist.scale();
    if(false == detail::check_location(function, location, &result, Policy()))
@@ -197,7 +197,7 @@
    BOOST_MATH_STD_USING // for ADL of std functions
 
    static const char* function = "boost::math::pdf(cauchy<%1%>&, %1%)";
- RealType result;
+ RealType result = 0;
    RealType location = dist.location();
    RealType scale = dist.scale();
    if(false == detail::check_scale("boost::math::pdf(cauchy<%1%>&, %1%)", scale, &result, Policy()))

Modified: trunk/boost/math/distributions/exponential.hpp
==============================================================================
--- trunk/boost/math/distributions/exponential.hpp (original)
+++ trunk/boost/math/distributions/exponential.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -102,7 +102,7 @@
    static const char* function = "boost::math::pdf(const exponential_distribution<%1%>&, %1%)";
 
    RealType lambda = dist.lambda();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
       return result;
    if(0 == detail::verify_exp_x(function, x, &result, Policy()))
@@ -118,7 +118,7 @@
 
    static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    RealType lambda = dist.lambda();
    if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
       return result;
@@ -136,7 +136,7 @@
 
    static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    RealType lambda = dist.lambda();
    if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
       return result;
@@ -159,7 +159,7 @@
 
    static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    RealType lambda = c.dist.lambda();
    if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
       return result;
@@ -177,7 +177,7 @@
 
    static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    RealType lambda = c.dist.lambda();
    if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
       return result;
@@ -198,7 +198,7 @@
 template <class RealType, class Policy>
 inline RealType mean(const exponential_distribution<RealType, Policy>& dist)
 {
- RealType result;
+ RealType result = 0;
    RealType lambda = dist.lambda();
    if(0 == detail::verify_lambda("boost::math::mean(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
       return result;
@@ -208,7 +208,7 @@
 template <class RealType, class Policy>
 inline RealType standard_deviation(const exponential_distribution<RealType, Policy>& dist)
 {
- RealType result;
+ RealType result = 0;
    RealType lambda = dist.lambda();
    if(0 == detail::verify_lambda("boost::math::standard_deviation(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
       return result;

Modified: trunk/boost/math/distributions/extreme_value.hpp
==============================================================================
--- trunk/boost/math/distributions/extreme_value.hpp (original)
+++ trunk/boost/math/distributions/extreme_value.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -94,7 +94,7 @@
 
    RealType a = dist.location();
    RealType b = dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b("boost::math::pdf(const extreme_value_distribution<%1%>&, %1%)", b, &result, Policy()))
       return result;
    result = exp((a-x)/b) * exp(-exp((a-x)/b)) / b;
@@ -108,7 +108,7 @@
 
    RealType a = dist.location();
    RealType b = dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b("boost::math::cdf(const extreme_value_distribution<%1%>&, %1%)", b, &result, Policy()))
       return result;
 
@@ -126,7 +126,7 @@
 
    RealType a = dist.location();
    RealType b = dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b(function, b, &result, Policy()))
       return result;
    if(0 == detail::check_probability(function, p, &result, Policy()))
@@ -149,7 +149,7 @@
 
    RealType a = c.dist.location();
    RealType b = c.dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b("boost::math::cdf(const extreme_value_distribution<%1%>&, %1%)", b, &result, Policy()))
       return result;
 
@@ -168,7 +168,7 @@
    RealType a = c.dist.location();
    RealType b = c.dist.scale();
    RealType q = c.param;
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b(function, b, &result, Policy()))
       return result;
    if(0 == detail::check_probability(function, q, &result, Policy()))
@@ -189,7 +189,7 @@
 {
    RealType a = dist.location();
    RealType b = dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b("boost::math::mean(const extreme_value_distribution<%1%>&)", b, &result, Policy()))
       return result;
    return a + constants::euler<RealType>() * b;
@@ -201,7 +201,7 @@
    BOOST_MATH_STD_USING // for ADL of std functions.
 
    RealType b = dist.scale();
- RealType result;
+ RealType result = 0;
    if(0 == detail::verify_scale_b("boost::math::standard_deviation(const extreme_value_distribution<%1%>&)", b, &result, Policy()))
       return result;
    return constants::pi<RealType>() * b / sqrt(static_cast<RealType>(6));

Modified: trunk/boost/math/distributions/fisher_f.hpp
==============================================================================
--- trunk/boost/math/distributions/fisher_f.hpp (original)
+++ trunk/boost/math/distributions/fisher_f.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -76,7 +76,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    static const char* function = "boost::math::pdf(fisher_f_distribution<%1%> const&, %1%)";
    if(false == detail::check_df(
          function, df1, &error_result, Policy())
@@ -133,7 +133,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
          function, df1, &error_result, Policy())
          && detail::check_df(
@@ -168,7 +168,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -194,7 +194,7 @@
    RealType df2 = c.dist.degrees_of_freedom2();
    RealType x = c.param;
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
          function, df1, &error_result, Policy())
          && detail::check_df(
@@ -230,7 +230,7 @@
    RealType df2 = c.dist.degrees_of_freedom2();
    RealType p = c.param;
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -253,7 +253,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -274,7 +274,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -295,7 +295,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -326,7 +326,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(
@@ -357,7 +357,7 @@
    RealType df1 = dist.degrees_of_freedom1();
    RealType df2 = dist.degrees_of_freedom2();
    // Error check:
- RealType error_result;
+ RealType error_result = 0;
    if(false == detail::check_df(
             function, df1, &error_result, Policy())
          && detail::check_df(

Modified: trunk/boost/math/distributions/gamma.hpp
==============================================================================
--- trunk/boost/math/distributions/gamma.hpp (original)
+++ trunk/boost/math/distributions/gamma.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -125,7 +125,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_gamma_x(function, x, &result, Policy()))
@@ -149,7 +149,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_gamma_x(function, x, &result, Policy()))
@@ -169,7 +169,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, p, &result, Policy()))
@@ -193,7 +193,7 @@
    RealType shape = c.dist.shape();
    RealType scale = c.dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_gamma_x(function, c.param, &result, Policy()))
@@ -215,7 +215,7 @@
    RealType scale = c.dist.scale();
    RealType q = c.param;
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, q, &result, Policy()))
@@ -239,7 +239,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
 
@@ -257,7 +257,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
 
@@ -275,7 +275,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
 
@@ -304,7 +304,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
 
@@ -322,7 +322,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_gamma(function, scale, shape, &result, Policy()))
       return result;
 

Modified: trunk/boost/math/distributions/geometric.hpp
==============================================================================
--- trunk/boost/math/distributions/geometric.hpp (original)
+++ trunk/boost/math/distributions/geometric.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -146,7 +146,7 @@
         RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
       {
         static const char* function = "boost::math::geometric<%1%>::find_lower_bound_on_p";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         RealType successes = 1;
         RealType failures = trials - successes;
         if(false == detail::check_probability(function, alpha, &result, Policy())
@@ -171,7 +171,7 @@
         RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
       {
         static const char* function = "boost::math::geometric<%1%>::find_upper_bound_on_p";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         RealType successes = 1;
         RealType failures = trials - successes;
         if(false == geometric_detail::check_dist_and_k(
@@ -205,7 +205,7 @@
       {
         static const char* function = "boost::math::geometric<%1%>::find_minimum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == geometric_detail::check_dist_and_k(
           function, p, k, &result, Policy())
           && detail::check_probability(function, alpha, &result, Policy()))
@@ -223,7 +223,7 @@
       {
         static const char* function = "boost::math::geometric<%1%>::find_maximum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == geometric_detail::check_dist_and_k(
           function, p, k, &result, Policy())
           && detail::check_probability(function, alpha, &result, Policy()))
@@ -317,7 +317,7 @@
       static const char* function = "boost::math::pdf(const geometric_distribution<%1%>&, %1%)";
 
       RealType p = dist.success_fraction();
- RealType result;
+ RealType result = 0;
       if(false == geometric_detail::check_dist_and_k(
         function,
         p,
@@ -356,7 +356,7 @@
       // If necessary, it has already been promoted from an integral type.
       RealType p = dist.success_fraction();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == geometric_detail::check_dist_and_k(
         function,
         p,
@@ -389,7 +389,7 @@
       geometric_distribution<RealType, Policy> const& dist = c.dist;
       RealType p = dist.success_fraction();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == geometric_detail::check_dist_and_k(
         function,
         p,
@@ -416,7 +416,7 @@
 
       RealType success_fraction = dist.success_fraction();
       // Check dist and x.
- RealType result;
+ RealType result = 0;
       if(false == geometric_detail::check_dist_and_prob
         (function, success_fraction, x, &result, Policy()))
       {
@@ -465,7 +465,7 @@
        RealType x = c.param;
        const geometric_distribution<RealType, Policy>& dist = c.dist;
        RealType success_fraction = dist.success_fraction();
- RealType result;
+ RealType result = 0;
        if(false == geometric_detail::check_dist_and_prob(
           function,
           success_fraction,

Modified: trunk/boost/math/distributions/hypergeometric.hpp
==============================================================================
--- trunk/boost/math/distributions/hypergeometric.hpp (original)
+++ trunk/boost/math/distributions/hypergeometric.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -120,7 +120,7 @@
    inline RealType pdf(const hypergeometric_distribution<RealType, Policy>& dist, const unsigned& x)
    {
       static const char* function = "boost::math::pdf(const hypergeometric_distribution<%1%>&, const %1%&)";
- RealType result;
+ RealType result = 0;
       if(!dist.check_params(function, &result))
          return result;
       if(!dist.check_x(x, function, &result))
@@ -148,7 +148,7 @@
    inline RealType cdf(const hypergeometric_distribution<RealType, Policy>& dist, const unsigned& x)
    {
       static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
- RealType result;
+ RealType result = 0;
       if(!dist.check_params(function, &result))
          return result;
       if(!dist.check_x(x, function, &result))
@@ -176,7 +176,7 @@
    inline RealType cdf(const complemented2_type<hypergeometric_distribution<RealType, Policy>, unsigned>& c)
    {
       static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
- RealType result;
+ RealType result = 0;
       if(!c.dist.check_params(function, &result))
          return result;
       if(!c.dist.check_x(c.param, function, &result))
@@ -206,7 +206,7 @@
       BOOST_MATH_STD_USING // for ADL of std functions
 
          // Checking function argument
- RealType result;
+ RealType result = 0;
       const char* function = "boost::math::quantile(const hypergeometric_distribution<%1%>&, %1%)";
       if (false == dist.check_params(function, &result)) return result;
       if(false == detail::check_probability(function, p, &result, Policy())) return result;
@@ -220,7 +220,7 @@
       BOOST_MATH_STD_USING // for ADL of std functions
 
       // Checking function argument
- RealType result;
+ RealType result = 0;
       const char* function = "quantile(const complemented2_type<hypergeometric_distribution<%1%>, %1%>&)";
       if (false == c.dist.check_params(function, &result)) return result;
       if(false == detail::check_probability(function, c.param, &result, Policy())) return result;

Modified: trunk/boost/math/distributions/inverse_gamma.hpp
==============================================================================
--- trunk/boost/math/distributions/inverse_gamma.hpp (original)
+++ trunk/boost/math/distributions/inverse_gamma.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -150,7 +150,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
    { // distribution parameters bad.
       return result;
@@ -198,7 +198,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
    { // distribution parameters bad.
       return result;
@@ -227,7 +227,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, p, &result, Policy()))
@@ -253,7 +253,7 @@
    RealType shape = c.dist.shape();
    RealType scale = c.dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_inverse_gamma_x(function, c.param, &result, Policy()))
@@ -275,7 +275,7 @@
    RealType scale = c.dist.scale();
    RealType q = c.param;
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, q, &result, Policy()))
@@ -302,7 +302,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
 
    if(false == detail::check_scale(function, scale, &result, Policy()))
    {
@@ -329,7 +329,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
       if(false == detail::check_scale(function, scale, &result, Policy()))
    {
      return result;
@@ -355,7 +355,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_inverse_gamma(function, scale, shape, &result, Policy()))
    {
       return result;
@@ -381,7 +381,7 @@
 
    RealType shape = dist.shape();
    RealType scale = dist.scale();
- RealType result;
+ RealType result = 0;
 
    if(false == detail::check_scale(function, scale, &result, Policy()))
    {
@@ -408,7 +408,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, scale, &result, Policy()))
    {
      return result;
@@ -431,7 +431,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
 
   if(false == detail::check_scale(function, scale, &result, Policy()))
    {

Modified: trunk/boost/math/distributions/inverse_gaussian.hpp
==============================================================================
--- trunk/boost/math/distributions/inverse_gaussian.hpp (original)
+++ trunk/boost/math/distributions/inverse_gaussian.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -136,7 +136,7 @@
 
    RealType scale = dist.scale();
    RealType mean = dist.mean();
- RealType result;
+ RealType result = 0;
    static const char* function = "boost::math::pdf(const inverse_gaussian_distribution<%1%>&, %1%)";
    if(false == detail::check_scale(function, scale, &result, Policy()))
    {
@@ -170,7 +170,7 @@
    RealType scale = dist.scale();
    RealType mean = dist.mean();
    static const char* function = "boost::math::cdf(const inverse_gaussian_distribution<%1%>&, %1%)";
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, scale, &result, Policy()))
    {
       return result;
@@ -317,7 +317,7 @@
    RealType scale = dist.scale();
    static const char* function = "boost::math::quantile(const inverse_gaussian_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, scale, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))
@@ -375,7 +375,7 @@
    //{ // cdf complement -infinity is unity.
    // return 1;
    //}
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, scale, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))
@@ -407,7 +407,7 @@
    RealType scale = c.dist.scale();
    RealType mean = c.dist.mean();
    static const char* function = "boost::math::quantile(const complement(inverse_gaussian_distribution<%1%>&), %1%)";
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, scale, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))

Modified: trunk/boost/math/distributions/laplace.hpp
==============================================================================
--- trunk/boost/math/distributions/laplace.hpp (original)
+++ trunk/boost/math/distributions/laplace.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -97,7 +97,7 @@
    BOOST_MATH_STD_USING // for ADL of std functions
 
    // Checking function argument
- RealType result;
+ RealType result = 0;
    const char* function = "boost::math::pdf(const laplace_distribution<%1%>&, %1%))";
    if (false == dist.check_parameters(function, &result)) return result;
    if (false == detail::check_x(function, x, &result, Policy())) return result;
@@ -126,7 +126,7 @@
    BOOST_MATH_STD_USING // for ADL of std functions
 
    // Checking function argument
- RealType result;
+ RealType result = 0;
    const char* function = "boost::math::cdf(const laplace_distribution<%1%>&, %1%)";
    if (false == dist.check_parameters(function, &result)) return result;
    if (false == detail::check_x(function, x, &result, Policy())) return result;
@@ -157,7 +157,7 @@
    BOOST_MATH_STD_USING // for ADL of std functions.
 
    // Checking function argument
- RealType result;
+ RealType result = 0;
    const char* function = "boost::math::quantile(const laplace_distribution<%1%>&, %1%)";
    if (false == dist.check_parameters(function, &result)) return result;
    if(false == detail::check_probability(function, p, &result, Policy())) return result;
@@ -199,7 +199,7 @@
    RealType x = c.param;
 
    // Checking function argument
- RealType result;
+ RealType result = 0;
    const char* function = "boost::math::cdf(const complemented2_type<laplace_distribution<%1%>, %1%>&)";
    if(false == detail::check_x(function, x, &result, Policy()))return result;
 
@@ -233,7 +233,7 @@
    RealType q = c.param;
 
    // Checking function argument
- RealType result;
+ RealType result = 0;
    const char* function = "quantile(const complemented2_type<laplace_distribution<%1%>, %1%>&)";
    if(false == detail::check_probability(function, q, &result, Policy())) return result;
 

Modified: trunk/boost/math/distributions/logistic.hpp
==============================================================================
--- trunk/boost/math/distributions/logistic.hpp (original)
+++ trunk/boost/math/distributions/logistic.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -77,7 +77,7 @@
           return 0; // pdf + and - infinity is zero.
        }
 
- RealType result;
+ RealType result = 0;
        if(false == detail::check_scale(function, scale , &result, Policy()))
        {
           return result;
@@ -106,7 +106,7 @@
     {
        RealType scale = dist.scale();
        RealType location = dist.location();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
        static const char* function = "boost::math::cdf(const logistic_distribution<%1%>&, %1%)";
        if(false == detail::check_scale(function, scale, &result, Policy()))
        {
@@ -145,7 +145,7 @@
 
        static const char* function = "boost::math::quantile(const logistic_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
        if(false == detail::check_scale(function, scale, &result, Policy()))
           return result;
        if(false == detail::check_location(function, location, &result, Policy()))
@@ -186,7 +186,7 @@
           if(x < 0) return 1; // cdf complement -infinity is unity.
           return 0; // cdf complement +infinity is zero
        }
- RealType result;
+ RealType result = 0;
        if(false == detail::check_scale(function, scale, &result, Policy()))
           return result;
        if(false == detail::check_location(function, location, &result, Policy()))
@@ -208,7 +208,7 @@
        RealType scale = c.dist.scale();
        RealType location = c.dist.location();
        static const char* function = "boost::math::quantile(const complement(logistic_distribution<%1%>&), %1%)";
- RealType result;
+ RealType result = 0;
        if(false == detail::check_scale(function, scale, &result, Policy()))
           return result;
        if(false == detail::check_location(function, location, &result, Policy()))

Modified: trunk/boost/math/distributions/lognormal.hpp
==============================================================================
--- trunk/boost/math/distributions/lognormal.hpp (original)
+++ trunk/boost/math/distributions/lognormal.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -99,7 +99,7 @@
 
    static const char* function = "boost::math::pdf(const lognormal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale(function, sigma, &result, Policy()))
       return result;
    if(0 == detail::check_lognormal_x(function, x, &result, Policy()))
@@ -125,7 +125,7 @@
 
    static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_lognormal_x(function, x, &result, Policy()))
       return result;
 
@@ -143,7 +143,7 @@
 
    static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_probability(function, p, &result, Policy()))
       return result;
 
@@ -163,7 +163,7 @@
 
    static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_lognormal_x(function, c.param, &result, Policy()))
       return result;
 
@@ -181,7 +181,7 @@
 
    static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_probability(function, c.param, &result, Policy()))
       return result;
 
@@ -202,7 +202,7 @@
    RealType mu = dist.location();
    RealType sigma = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::mean(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 
@@ -217,7 +217,7 @@
    RealType mu = dist.location();
    RealType sigma = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::variance(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 
@@ -232,7 +232,7 @@
    RealType mu = dist.location();
    RealType sigma = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::mode(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 
@@ -258,7 +258,7 @@
    RealType ss = sigma * sigma;
    RealType ess = exp(ss);
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::skewness(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 
@@ -274,7 +274,7 @@
    RealType sigma = dist.scale();
    RealType ss = sigma * sigma;
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::kurtosis(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 
@@ -290,7 +290,7 @@
    RealType sigma = dist.scale();
    RealType ss = sigma * sigma;
 
- RealType result;
+ RealType result = 0;
    if(0 == detail::check_scale("boost::math::kurtosis_excess(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
       return result;
 

Modified: trunk/boost/math/distributions/negative_binomial.hpp
==============================================================================
--- trunk/boost/math/distributions/negative_binomial.hpp (original)
+++ trunk/boost/math/distributions/negative_binomial.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -165,7 +165,7 @@
         RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
       {
         static const char* function = "boost::math::negative_binomial<%1%>::find_lower_bound_on_p";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         RealType failures = trials - successes;
         if(false == detail::check_probability(function, alpha, &result, Policy())
           && negative_binomial_detail::check_dist_and_k(
@@ -190,7 +190,7 @@
         RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
       {
         static const char* function = "boost::math::negative_binomial<%1%>::find_upper_bound_on_p";
- RealType result; // of error checks.
+ RealType result = 0; // of error checks.
         RealType failures = trials - successes;
         if(false == negative_binomial_detail::check_dist_and_k(
           function, successes, RealType(0), failures, &result, Policy())
@@ -222,7 +222,7 @@
       {
         static const char* function = "boost::math::negative_binomial<%1%>::find_minimum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == negative_binomial_detail::check_dist_and_k(
           function, RealType(1), p, k, &result, Policy())
           && detail::check_probability(function, alpha, &result, Policy()))
@@ -239,7 +239,7 @@
       {
         static const char* function = "boost::math::negative_binomial<%1%>::find_maximum_number_of_trials";
         // Error checks:
- RealType result;
+ RealType result = 0;
         if(false == negative_binomial_detail::check_dist_and_k(
           function, RealType(1), p, k, &result, Policy())
           && detail::check_probability(function, alpha, &result, Policy()))
@@ -343,7 +343,7 @@
 
       RealType r = dist.successes();
       RealType p = dist.success_fraction();
- RealType result;
+ RealType result = 0;
       if(false == negative_binomial_detail::check_dist_and_k(
         function,
         r,
@@ -370,7 +370,7 @@
       RealType p = dist.success_fraction();
       RealType r = dist.successes();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == negative_binomial_detail::check_dist_and_k(
         function,
         r,
@@ -399,7 +399,7 @@
       RealType p = dist.success_fraction();
       RealType r = dist.successes();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == negative_binomial_detail::check_dist_and_k(
         function,
         r,
@@ -435,7 +435,7 @@
       RealType p = dist.success_fraction();
       RealType r = dist.successes();
       // Check dist and P.
- RealType result;
+ RealType result = 0;
       if(false == negative_binomial_detail::check_dist_and_prob
         (function, r, p, P, &result, Policy()))
       {
@@ -509,7 +509,7 @@
        const negative_binomial_distribution<RealType, Policy>& dist = c.dist;
        RealType p = dist.success_fraction();
        RealType r = dist.successes();
- RealType result;
+ RealType result = 0;
        if(false == negative_binomial_detail::check_dist_and_prob(
           function,
           r,

Modified: trunk/boost/math/distributions/normal.hpp
==============================================================================
--- trunk/boost/math/distributions/normal.hpp (original)
+++ trunk/boost/math/distributions/normal.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -106,7 +106,7 @@
    // return 0;
    //}
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, sd, &result, Policy()))
    {
       return result;
@@ -138,7 +138,7 @@
    RealType sd = dist.standard_deviation();
    RealType mean = dist.mean();
    static const char* function = "boost::math::cdf(const normal_distribution<%1%>&, %1%)";
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, sd, &result, Policy()))
    {
       return result;
@@ -179,7 +179,7 @@
    RealType mean = dist.mean();
    static const char* function = "boost::math::quantile(const normal_distribution<%1%>&, %1%)";
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, sd, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))
@@ -218,7 +218,7 @@
    //{ // cdf complement -infinity is unity.
    // return 1;
    //}
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, sd, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))
@@ -239,7 +239,7 @@
    RealType sd = c.dist.standard_deviation();
    RealType mean = c.dist.mean();
    static const char* function = "boost::math::quantile(const complement(normal_distribution<%1%>&), %1%)";
- RealType result;
+ RealType result = 0;
    if(false == detail::check_scale(function, sd, &result, Policy()))
       return result;
    if(false == detail::check_location(function, mean, &result, Policy()))

Modified: trunk/boost/math/distributions/pareto.hpp
==============================================================================
--- trunk/boost/math/distributions/pareto.hpp (original)
+++ trunk/boost/math/distributions/pareto.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -139,7 +139,7 @@
       pareto_distribution(RealType scale = 1, RealType shape = 1)
         : m_scale(scale), m_shape(shape)
       { // Constructor.
- RealType result;
+ RealType result = 0;
         detail::check_pareto("boost::math::pareto_distribution<%1%>::pareto_distribution", scale, shape, &result, Policy());
       }
 
@@ -182,7 +182,7 @@
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";
       RealType scale = dist.scale();
       RealType shape = dist.shape();
- RealType result;
+ RealType result = 0;
       if(false == (detail::check_pareto_x(function, x, &result, Policy())
          && detail::check_pareto(function, scale, shape, &result, Policy())))
          return result;
@@ -201,7 +201,7 @@
       static const char* function = "boost::math::cdf(const pareto_distribution<%1%>&, %1%)";
       RealType scale = dist.scale();
       RealType shape = dist.shape();
- RealType result;
+ RealType result = 0;
 
       if(false == (detail::check_pareto_x(function, x, &result, Policy())
          && detail::check_pareto(function, scale, shape, &result, Policy())))
@@ -222,7 +222,7 @@
     {
       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 result = 0;
       RealType scale = dist.scale();
       RealType shape = dist.shape();
       if(false == (detail::check_probability(function, p, &result, Policy())
@@ -249,7 +249,7 @@
     {
        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 result = 0;
        RealType x = c.param;
        RealType scale = c.dist.scale();
        RealType shape = c.dist.shape();
@@ -271,7 +271,7 @@
     {
       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 result = 0;
       RealType q = c.param;
       RealType scale = c.dist.scale();
       RealType shape = c.dist.shape();
@@ -296,7 +296,7 @@
     template <class RealType, class Policy>
     inline RealType mean(const pareto_distribution<RealType, Policy>& dist)
     {
- RealType result;
+ RealType result = 0;
       static const char* function = "boost::math::mean(const pareto_distribution<%1%>&, %1%)";
       if(false == detail::check_pareto(function, dist.scale(), dist.shape(), &result, Policy()))
       {
@@ -322,7 +322,7 @@
     template <class RealType, class Policy>
     inline RealType median(const pareto_distribution<RealType, Policy>& dist)
     {
- RealType result;
+ RealType result = 0;
       static const char* function = "boost::math::median(const pareto_distribution<%1%>&, %1%)";
       if(false == detail::check_pareto(function, dist.scale(), dist.shape(), &result, Policy()))
       {
@@ -335,7 +335,7 @@
     template <class RealType, class Policy>
     inline RealType variance(const pareto_distribution<RealType, Policy>& dist)
     {
- RealType result;
+ RealType result = 0;
       RealType scale = dist.scale();
       RealType shape = dist.shape();
       static const char* function = "boost::math::variance(const pareto_distribution<%1%>&, %1%)";
@@ -361,7 +361,7 @@
     inline RealType skewness(const pareto_distribution<RealType, Policy>& dist)
     {
       BOOST_MATH_STD_USING
- RealType result;
+ RealType result = 0;
       RealType shape = dist.shape();
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";
       if(false == detail::check_pareto(function, dist.scale(), shape, &result, Policy()))
@@ -386,7 +386,7 @@
     template <class RealType, class Policy>
     inline RealType kurtosis(const pareto_distribution<RealType, Policy>& dist)
     {
- RealType result;
+ RealType result = 0;
       RealType shape = dist.shape();
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";
       if(false == detail::check_pareto(function, dist.scale(), shape, &result, Policy()))
@@ -410,7 +410,7 @@
     template <class RealType, class Policy>
     inline RealType kurtosis_excess(const pareto_distribution<RealType, Policy>& dist)
     {
- RealType result;
+ RealType result = 0;
       RealType shape = dist.shape();
       static const char* function = "boost::math::pdf(const pareto_distribution<%1%>&, %1%)";
       if(false == detail::check_pareto(function, dist.scale(), shape, &result, Policy()))

Modified: trunk/boost/math/distributions/poisson.hpp
==============================================================================
--- trunk/boost/math/distributions/poisson.hpp (original)
+++ trunk/boost/math/distributions/poisson.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -316,7 +316,7 @@
 
       RealType mean = dist.mean();
       // Error check:
- RealType result;
+ RealType result = 0;
       if(false == poisson_detail::check_dist_and_k(
         "boost::math::pdf(const poisson_distribution<%1%>&, %1%)",
         mean,
@@ -362,7 +362,7 @@
 
       RealType mean = dist.mean();
       // Error checks:
- RealType result;
+ RealType result = 0;
       if(false == poisson_detail::check_dist_and_k(
         "boost::math::cdf(const poisson_distribution<%1%>&, %1%)",
         mean,
@@ -414,7 +414,7 @@
       RealType mean = dist.mean();
 
       // Error checks:
- RealType result;
+ RealType result = 0;
       if(false == poisson_detail::check_dist_and_k(
         "boost::math::cdf(const poisson_distribution<%1%>&, %1%)",
         mean,
@@ -443,7 +443,7 @@
     inline RealType quantile(const poisson_distribution<RealType, Policy>& dist, const RealType& p)
     { // Quantile (or Percent Point) Poisson function.
       // Return the number of expected events k for a given probability p.
- RealType result; // of Argument checks:
+ RealType result = 0; // of Argument checks:
       if(false == poisson_detail::check_prob(
         "boost::math::quantile(const poisson_distribution<%1%>&, %1%)",
         p,
@@ -514,7 +514,7 @@
       // Error checks:
       RealType q = c.param;
       const poisson_distribution<RealType, Policy>& dist = c.dist;
- RealType result; // of argument checks.
+ RealType result = 0; // of argument checks.
       if(false == poisson_detail::check_prob(
         "boost::math::quantile(const poisson_distribution<%1%>&, %1%)",
         q,

Modified: trunk/boost/math/distributions/rayleigh.hpp
==============================================================================
--- trunk/boost/math/distributions/rayleigh.hpp (original)
+++ trunk/boost/math/distributions/rayleigh.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -98,7 +98,7 @@
    BOOST_MATH_STD_USING // for ADL of std function exp.
 
    RealType sigma = dist.sigma();
- RealType result;
+ RealType result = 0;
    static const char* function = "boost::math::pdf(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
    {
@@ -118,7 +118,7 @@
 {
    BOOST_MATH_STD_USING // for ADL of std functions
 
- RealType result;
+ RealType result = 0;
    RealType sigma = dist.sigma();
    static const char* function = "boost::math::cdf(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
@@ -138,7 +138,7 @@
 {
    BOOST_MATH_STD_USING // for ADL of std functions
 
- RealType result;
+ RealType result = 0;
    RealType sigma = dist.sigma();
    static const char* function = "boost::math::quantile(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
@@ -163,7 +163,7 @@
 {
    BOOST_MATH_STD_USING // for ADL of std functions
 
- RealType result;
+ RealType result = 0;
    RealType sigma = c.dist.sigma();
    static const char* function = "boost::math::cdf(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
@@ -184,7 +184,7 @@
 {
    BOOST_MATH_STD_USING // for ADL of std functions, log & sqrt.
 
- RealType result;
+ RealType result = 0;
    RealType sigma = c.dist.sigma();
    static const char* function = "boost::math::quantile(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
@@ -211,7 +211,7 @@
 template <class RealType, class Policy>
 inline RealType mean(const rayleigh_distribution<RealType, Policy>& dist)
 {
- RealType result;
+ RealType result = 0;
    RealType sigma = dist.sigma();
    static const char* function = "boost::math::mean(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))
@@ -225,7 +225,7 @@
 template <class RealType, class Policy>
 inline RealType variance(const rayleigh_distribution<RealType, Policy>& dist)
 {
- RealType result;
+ RealType result = 0;
    RealType sigma = dist.sigma();
    static const char* function = "boost::math::variance(const rayleigh_distribution<%1%>&, %1%)";
    if(false == detail::verify_sigma(function, sigma, &result, Policy()))

Modified: trunk/boost/math/distributions/triangular.hpp
==============================================================================
--- trunk/boost/math/distributions/triangular.hpp (original)
+++ trunk/boost/math/distributions/triangular.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -199,7 +199,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -237,7 +237,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -273,7 +273,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks
+ RealType result = 0; // of checks
     if(false == detail::check_triangular(function,lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -316,7 +316,7 @@
     RealType mode = c.dist.mode();
     RealType upper = c.dist.upper();
     RealType x = c.param;
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -352,7 +352,7 @@
     RealType m = c.dist.mode();
     RealType u = c.dist.upper();
     RealType q = c.param; // probability 0 to 1.
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, l, m, u, &result, Policy()))
     {
       return result;
@@ -399,7 +399,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -415,7 +415,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function, lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -428,7 +428,7 @@
   {
     static const char* function = "boost::math::mode(const triangular_distribution<%1%>&)";
     RealType mode = dist.mode();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular_mode(function, mode, &result, Policy()))
     { // This should never happen!
       return result;
@@ -442,7 +442,7 @@
     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.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular_mode(function, mode, &result, Policy()))
     { // This should never happen!
       return result;
@@ -469,7 +469,7 @@
     RealType lower = dist.lower();
     RealType mode = dist.mode();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function,lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -485,7 +485,7 @@
     RealType lower = dist.lower();
     RealType upper = dist.upper();
     RealType mode = dist.mode();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function,lower, mode, upper, &result, Policy()))
     {
       return result;
@@ -500,7 +500,7 @@
     RealType lower = dist.lower();
     RealType upper = dist.upper();
     RealType mode = dist.mode();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_triangular(function,lower, mode, upper, &result, Policy()))
     {
       return result;

Modified: trunk/boost/math/distributions/uniform.hpp
==============================================================================
--- trunk/boost/math/distributions/uniform.hpp (original)
+++ trunk/boost/math/distributions/uniform.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -161,7 +161,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::pdf(const uniform_distribution<%1%>&, %1%)", lower, upper, &result, Policy()))
     {
       return result;
@@ -186,7 +186,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::cdf(const uniform_distribution<%1%>&, %1%)",lower, upper, &result, Policy()))
     {
       return result;
@@ -211,7 +211,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks
+ RealType result = 0; // of checks
     if(false == detail::check_uniform("boost::math::quantile(const uniform_distribution<%1%>&, %1%)",lower, upper, &result, Policy()))
     {
       return result;
@@ -237,7 +237,7 @@
     RealType lower = c.dist.lower();
     RealType upper = c.dist.upper();
     RealType x = c.param;
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::cdf(const uniform_distribution<%1%>&, %1%)", lower, upper, &result, Policy()))
     {
       return result;
@@ -263,7 +263,7 @@
     RealType lower = c.dist.lower();
     RealType upper = c.dist.upper();
     RealType q = c.param;
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::quantile(const uniform_distribution<%1%>&, %1%)", lower, upper, &result, Policy()))
     {
       return result;
@@ -285,7 +285,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::mean(const uniform_distribution<%1%>&)", lower, upper, &result, Policy()))
     {
       return result;
@@ -298,7 +298,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::variance(const uniform_distribution<%1%>&)", lower, upper, &result, Policy()))
     {
       return result;
@@ -312,7 +312,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::mode(const uniform_distribution<%1%>&)", lower, upper, &result, Policy()))
     {
       return result;
@@ -326,7 +326,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::median(const uniform_distribution<%1%>&)", lower, upper, &result, Policy()))
     {
       return result;
@@ -338,7 +338,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::skewness(const uniform_distribution<%1%>&)",lower, upper, &result, Policy()))
     {
       return result;
@@ -351,7 +351,7 @@
   {
     RealType lower = dist.lower();
     RealType upper = dist.upper();
- RealType result; // of checks.
+ RealType result = 0; // of checks.
     if(false == detail::check_uniform("boost::math::kurtosis_execess(const uniform_distribution<%1%>&)", lower, upper, &result, Policy()))
     {
       return result;

Modified: trunk/boost/math/distributions/weibull.hpp
==============================================================================
--- trunk/boost/math/distributions/weibull.hpp (original)
+++ trunk/boost/math/distributions/weibull.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -126,7 +126,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_weibull_x(function, x, &result, Policy()))
@@ -152,7 +152,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_weibull_x(function, x, &result, Policy()))
@@ -173,7 +173,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, p, &result, Policy()))
@@ -197,7 +197,7 @@
    RealType shape = c.dist.shape();
    RealType scale = c.dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_weibull_x(function, c.param, &result, Policy()))
@@ -219,7 +219,7 @@
    RealType scale = c.dist.scale();
    RealType q = c.param;
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
    if(false == detail::check_probability(function, q, &result, Policy()))
@@ -243,7 +243,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
 
@@ -259,7 +259,7 @@
 
    static const char* function = "boost::math::variance(const weibull_distribution<%1%>)";
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
    {
       return result;
@@ -281,7 +281,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
    {
       return result;
@@ -302,7 +302,7 @@
    RealType shape = dist.shape(); // Wikipedia k
    RealType scale = dist.scale(); // Wikipedia lambda
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
    {
       return result;
@@ -322,7 +322,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
    {
       return result;
@@ -348,7 +348,7 @@
    RealType shape = dist.shape();
    RealType scale = dist.scale();
 
- RealType result;
+ RealType result = 0;
    if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
       return result;
 

Modified: trunk/boost/math/policies/error_handling.hpp
==============================================================================
--- trunk/boost/math/policies/error_handling.hpp (original)
+++ trunk/boost/math/policies/error_handling.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -616,7 +616,7 @@
    //
    // Most of what follows will evaluate to a no-op:
    //
- R result;
+ R result = 0;
    if(detail::check_overflow<R>(val, &result, function, overflow_type()))
       return result;
    if(detail::check_underflow<R>(val, &result, function, underflow_type()))

Modified: trunk/boost/math/policies/policy.hpp
==============================================================================
--- trunk/boost/math/policies/policy.hpp (original)
+++ trunk/boost/math/policies/policy.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -738,6 +738,7 @@
 template <class Real, class Policy>
 struct precision
 {
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<Real>::radix == 2);
    typedef typename Policy::precision_type precision_type;
    typedef basic_digits<Real> digits_t;
    typedef typename mpl::if_<
@@ -775,6 +776,7 @@
 template <class Real, class Policy>
 struct precision
 {
+ BOOST_STATIC_ASSERT((::std::numeric_limits<Real>::radix == 2) || ((::std::numeric_limits<Real>::is_specialized == 0) || (::std::numeric_limits<Real>::digits == 0)));
 #ifndef __BORLANDC__
    typedef typename Policy::precision_type precision_type;
    typedef typename mpl::if_c<
@@ -896,8 +898,10 @@
 {
 #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
    BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::radix == 2);
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
+ BOOST_ASSERT(::std::numeric_limits<T>::radix == 2);
 #endif
    typedef typename boost::math::policies::precision<T, Policy>::type p_t;
    typedef mpl::bool_<p_t::value <= std::numeric_limits<boost::uintmax_t>::digits> is_small_int;
@@ -916,7 +920,7 @@
 template <class T, class Policy>
 inline T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
 {
- typedef mpl::bool_< std::numeric_limits<T>::is_specialized > tag_type;
+ typedef mpl::bool_< (std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::radix == 2)) > tag_type;
    return detail::get_epsilon_imp<T, Policy>(tag_type());
 }
 

Modified: trunk/boost/math/special_functions/beta.hpp
==============================================================================
--- trunk/boost/math/special_functions/beta.hpp (original)
+++ trunk/boost/math/special_functions/beta.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -326,6 +326,10 @@
       T b2 = (y * cgh) / bgh;
       l1 = a * log(b1);
       l2 = b * log(b2);
+ BOOST_MATH_INSTRUMENT_VARIABLE(b1);
+ BOOST_MATH_INSTRUMENT_VARIABLE(b2);
+ BOOST_MATH_INSTRUMENT_VARIABLE(l1);
+ BOOST_MATH_INSTRUMENT_VARIABLE(l2);
       if((l1 >= tools::log_max_value<T>())
          || (l1 <= tools::log_min_value<T>())
          || (l2 >= tools::log_max_value<T>())
@@ -384,9 +388,8 @@
       return pow(x, a) * pow(y, b);
    }
 
- T result;
+ T result= 0; // assignment here silences warnings later
 
- T prefix = 1;
    T c = a + b;
 
    // integration limits for the gamma functions:
@@ -519,7 +522,6 @@
 
    if(normalised)
    {
- T prefix = 1;
       T c = a + b;
 
       // figure out integration limits for the gamma function:

Modified: trunk/boost/math/special_functions/cbrt.hpp
==============================================================================
--- trunk/boost/math/special_functions/cbrt.hpp (original)
+++ trunk/boost/math/special_functions/cbrt.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -90,6 +90,8 @@
 
    typedef typename largest_cbrt_int_type<T>::type shift_type;
 
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<shift_type>::radix == 2);
+
    if(abs(i_exp3) < std::numeric_limits<shift_type>::digits)
    {
       if(i_exp3 > 0)

Modified: trunk/boost/math/special_functions/detail/t_distribution_inv.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/t_distribution_inv.hpp (original)
+++ trunk/boost/math/special_functions/detail/t_distribution_inv.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -529,7 +529,10 @@
    typedef mpl::bool_<
       (std::numeric_limits<T>::digits <= 53)
        &&
- (std::numeric_limits<T>::is_specialized)> tag_type;
+ (std::numeric_limits<T>::is_specialized)
+ &&
+ (std::numeric_limits<T>::radix == 2)
+ > tag_type;
    return policies::checked_narrowing_cast<T, forwarding_policy>(fast_students_t_quantile_imp(static_cast<value_type>(df), static_cast<value_type>(p), pol, static_cast<tag_type*>(0)), "boost::math::students_t_quantile<%1%>(%1%,%1%,%1%)");
 }
 

Modified: trunk/boost/math/special_functions/gamma.hpp
==============================================================================
--- trunk/boost/math/special_functions/gamma.hpp (original)
+++ trunk/boost/math/special_functions/gamma.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -1,3 +1,4 @@
+
 // Copyright John Maddock 2006-7.
 // Copyright Paul A. Bristow 2007.
 
@@ -150,6 +151,7 @@
       if(z <= -20)
       {
          result = gamma_imp(T(-z), pol, l) * sinpx(z);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
          if((fabs(result) < 1) && (tools::max_value<T>() * fabs(result) < boost::math::constants::pi<T>()))
             return policies::raise_overflow_error<T>(function, "Result of tgamma is too large to represent.", pol);
          result = -boost::math::constants::pi<T>() / result;
@@ -157,6 +159,7 @@
             return policies::raise_underflow_error<T>(function, "Result of tgamma is too small to represent.", pol);
          if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL)
             return policies::raise_denorm_error<T>(function, "Result of tgamma is denormalized.", result, pol);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
          return result;
       }
 
@@ -167,29 +170,41 @@
          z += 1;
       }
    }
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
    if((floor(z) == z) && (z < max_factorial<T>::value))
    {
       result *= unchecked_factorial<T>(itrunc(z, pol) - 1);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
    }
    else
    {
       result *= L::lanczos_sum(z);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
+ BOOST_MATH_INSTRUMENT_VARIABLE(tools::log_max_value<T>());
       if(z * log(z) > tools::log_max_value<T>())
       {
          // we're going to overflow unless this is done with care:
          T zgh = (z + static_cast<T>(L::g()) - boost::math::constants::half<T>());
+ BOOST_MATH_INSTRUMENT_VARIABLE(zgh);
          if(log(zgh) * z / 2 > tools::log_max_value<T>())
             return policies::raise_overflow_error<T>(function, "Result of tgamma is too large to represent.", pol);
          T hp = pow(zgh, (z / 2) - T(0.25));
+ BOOST_MATH_INSTRUMENT_VARIABLE(hp);
          result *= hp / exp(zgh);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
          if(tools::max_value<T>() / hp < result)
             return policies::raise_overflow_error<T>(function, "Result of tgamma is too large to represent.", pol);
          result *= hp;
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
       }
       else
       {
          T zgh = (z + static_cast<T>(L::g()) - boost::math::constants::half<T>());
+ BOOST_MATH_INSTRUMENT_VARIABLE(zgh);
+ BOOST_MATH_INSTRUMENT_VARIABLE(pow(zgh, z - boost::math::constants::half<T>()));
+ BOOST_MATH_INSTRUMENT_VARIABLE(exp(zgh));
          result *= pow(zgh, z - boost::math::constants::half<T>()) / exp(zgh);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
       }
    }
    return result;

Modified: trunk/boost/math/tools/config.hpp
==============================================================================
--- trunk/boost/math/tools/config.hpp (original)
+++ trunk/boost/math/tools/config.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -253,6 +253,12 @@
    return (std::max)((std::max)(a, b), (std::max)(c, d));
 }
 } // namespace tools
+
+template <class T>
+void suppress_unused_variable_warning(const T&)
+{
+}
+
 }} // namespace boost namespace math
 
 #if ((defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H)

Modified: trunk/boost/math/tools/precision.hpp
==============================================================================
--- trunk/boost/math/tools/precision.hpp (original)
+++ trunk/boost/math/tools/precision.hpp 2011-05-02 11:36:51 EDT (Mon, 02 May 2011)
@@ -45,8 +45,10 @@
 {
 #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
    BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::radix == 2);
 #else
    BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
+ BOOST_ASSERT(::std::numeric_limits<T>::radix == 2);
 #endif
    return std::numeric_limits<T>::digits;
 }
@@ -303,14 +305,14 @@
 template <class T>
 inline T root_epsilon()
 {
- typedef mpl::int_<std::numeric_limits<T>::digits> tag_type;
+ typedef mpl::int_< (::std::numeric_limits<T>::radix == 2) ? std::numeric_limits<T>::digits : 0> tag_type;
    return detail::root_epsilon_imp(static_cast<T const*>(0), tag_type());
 }
 
 template <class T>
 inline T forth_root_epsilon()
 {
- typedef mpl::int_<std::numeric_limits<T>::digits> tag_type;
+ typedef mpl::int_< (::std::numeric_limits<T>::radix == 2) ? std::numeric_limits<T>::digits : 0> tag_type;
    return detail::forth_root_epsilon_imp(static_cast<T const*>(0), tag_type());
 }
 


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