|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74355 - in trunk/boost/math: distributions distributions/detail special_functions special_functions/detail
From: john_at_[hidden]
Date: 2011-09-12 04:36:55
Author: johnmaddock
Date: 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
New Revision: 74355
URL: http://svn.boost.org/trac/boost/changeset/74355
Log:
Fix expression template compilation issues.
Text files modified:
trunk/boost/math/distributions/beta.hpp | 2 +-
trunk/boost/math/distributions/detail/generic_quantile.hpp | 4 ++--
trunk/boost/math/distributions/detail/inv_discrete_quantile.hpp | 2 +-
trunk/boost/math/distributions/non_central_beta.hpp | 4 ++--
trunk/boost/math/distributions/non_central_chi_squared.hpp | 8 ++++----
trunk/boost/math/special_functions/beta.hpp | 2 +-
trunk/boost/math/special_functions/detail/lgamma_small.hpp | 4 ++--
trunk/boost/math/special_functions/gamma.hpp | 4 ++--
8 files changed, 15 insertions(+), 15 deletions(-)
Modified: trunk/boost/math/distributions/beta.hpp
==============================================================================
--- trunk/boost/math/distributions/beta.hpp (original)
+++ trunk/boost/math/distributions/beta.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -109,7 +109,7 @@
inline bool check_dist_and_x(const char* function, const RealType& alpha, const RealType& beta, RealType x, RealType* result, const Policy& pol)
{
return check_dist(function, alpha, beta, result, pol)
- && check_x(function, x, result, pol);
+ && beta_detail::check_x(function, x, result, pol);
} // bool check_dist_and_x
template <class RealType, class Policy>
Modified: trunk/boost/math/distributions/detail/generic_quantile.hpp
==============================================================================
--- trunk/boost/math/distributions/detail/generic_quantile.hpp (original)
+++ trunk/boost/math/distributions/detail/generic_quantile.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -20,8 +20,8 @@
value_type operator()(const value_type& x)
{
return comp ?
- target - cdf(complement(dist, x))
- : cdf(dist, x) - target;
+ value_type(target - cdf(complement(dist, x)))
+ : value_type(cdf(dist, x) - target);
}
private:
Modified: trunk/boost/math/distributions/detail/inv_discrete_quantile.hpp
==============================================================================
--- trunk/boost/math/distributions/detail/inv_discrete_quantile.hpp (original)
+++ trunk/boost/math/distributions/detail/inv_discrete_quantile.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -24,7 +24,7 @@
value_type operator()(value_type const& x)
{
- return comp ? target - cdf(complement(dist, x)) : cdf(dist, x) - target;
+ return comp ? value_type(target - cdf(complement(dist, x))) : value_type(cdf(dist, x) - target);
}
private:
Modified: trunk/boost/math/distributions/non_central_beta.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_beta.hpp (original)
+++ trunk/boost/math/distributions/non_central_beta.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -282,8 +282,8 @@
T operator()(const T& x)
{
return comp ?
- target - cdf(complement(dist, x))
- : cdf(dist, x) - target;
+ T(target - cdf(complement(dist, x)))
+ : T(cdf(dist, x) - target);
}
private:
Modified: trunk/boost/math/distributions/non_central_chi_squared.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_chi_squared.hpp (original)
+++ trunk/boost/math/distributions/non_central_chi_squared.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -525,8 +525,8 @@
{
non_central_chi_squared_distribution<RealType, Policy> d(v, lam);
return comp ?
- p - cdf(complement(d, x))
- : cdf(d, x) - p;
+ RealType(p - cdf(complement(d, x)))
+ : RealType(cdf(d, x) - p);
}
private:
RealType lam;
@@ -581,8 +581,8 @@
{
non_central_chi_squared_distribution<RealType, Policy> d(v, lam);
return comp ?
- p - cdf(complement(d, x))
- : cdf(d, x) - p;
+ RealType(p - cdf(complement(d, x)))
+ : RealType(cdf(d, x) - p);
}
private:
RealType v;
Modified: trunk/boost/math/special_functions/beta.hpp
==============================================================================
--- trunk/boost/math/special_functions/beta.hpp (original)
+++ trunk/boost/math/special_functions/beta.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -157,7 +157,7 @@
// set integration limits:
T la = (std::max)(T(10), a);
T lb = (std::max)(T(10), b);
- T lc = (std::max)(T(10), a+b);
+ T lc = (std::max)(T(10), T(a+b));
// calculate the fraction parts:
T sa = detail::lower_gamma_series(a, la, pol) / a;
Modified: trunk/boost/math/special_functions/detail/lgamma_small.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/lgamma_small.hpp (original)
+++ trunk/boost/math/special_functions/detail/lgamma_small.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -410,7 +410,7 @@
-0.17194794958274081373243161848194745111e-5L
};
T r = zm2 * zm1;
- T R = tools::evaluate_polynomial(P, 0.625 - zm1) / tools::evaluate_polynomial(Q, 0.625 - zm1);
+ T R = tools::evaluate_polynomial(P, T(0.625 - zm1)) / tools::evaluate_polynomial(Q, T(0.625 - zm1));
result += r * Y + r * R;
BOOST_MATH_INSTRUMENT_CODE(result);
@@ -452,7 +452,7 @@
};
// (2 - x) * (1 - x) * (c + R(2 - x))
T r = zm2 * zm1;
- T R = tools::evaluate_polynomial(P, -zm2) / tools::evaluate_polynomial(Q, -zm2);
+ T R = tools::evaluate_polynomial(P, T(-zm2)) / tools::evaluate_polynomial(Q, T(-zm2));
result += r * Y + r * R;
BOOST_MATH_INSTRUMENT_CODE(result);
Modified: trunk/boost/math/special_functions/gamma.hpp
==============================================================================
--- trunk/boost/math/special_functions/gamma.hpp (original)
+++ trunk/boost/math/special_functions/gamma.hpp 2011-09-12 04:36:54 EDT (Mon, 12 Sep 2011)
@@ -365,7 +365,7 @@
return policies::raise_pole_error<T>(function, "Evaluation of tgamma at a negative integer %1%.", z, pol);
if(z <= -20)
{
- T result = gamma_imp(-z, pol, l) * sinpx(z);
+ T result = gamma_imp(T(-z), pol, l) * sinpx(z);
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;
@@ -515,7 +515,7 @@
// algebra isn't easy for the general case....
// Start by subracting 1 from tgamma:
//
- T result = gamma_imp(1 + dz, pol, l) - 1;
+ T result = gamma_imp(T(1 + dz), pol, l) - 1;
BOOST_MATH_INSTRUMENT_CODE(result);
//
// Test the level of cancellation error observed: we loose one bit
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