updated boost on windows
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
#include <boost/math/tools/complex.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{
|
||||
|
||||
@@ -68,6 +69,22 @@ namespace detail
|
||||
{
|
||||
};
|
||||
|
||||
template <class T, bool = is_complex_type<T>::value>
|
||||
struct tiny_value
|
||||
{
|
||||
static T get() {
|
||||
return tools::min_value<T>();
|
||||
}
|
||||
};
|
||||
template <class T>
|
||||
struct tiny_value<T, true>
|
||||
{
|
||||
typedef typename T::value_type value_type;
|
||||
static T get() {
|
||||
return tools::min_value<value_type>();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//
|
||||
@@ -93,14 +110,19 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
|
||||
typedef detail::fraction_traits<Gen> traits;
|
||||
typedef typename traits::result_type result_type;
|
||||
typedef typename traits::value_type value_type;
|
||||
typedef typename integer_scalar_type<result_type>::type integer_type;
|
||||
typedef typename scalar_type<result_type>::type scalar_type;
|
||||
|
||||
result_type tiny = tools::min_value<result_type>();
|
||||
integer_type const zero(0), one(1);
|
||||
|
||||
result_type tiny = detail::tiny_value<result_type>::get();
|
||||
scalar_type terminator = abs(factor);
|
||||
|
||||
value_type v = g();
|
||||
|
||||
result_type f, C, D, delta;
|
||||
f = traits::b(v);
|
||||
if(f == 0)
|
||||
if(f == zero)
|
||||
f = tiny;
|
||||
C = f;
|
||||
D = 0;
|
||||
@@ -110,15 +132,15 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
|
||||
do{
|
||||
v = g();
|
||||
D = traits::b(v) + traits::a(v) * D;
|
||||
if(D == 0)
|
||||
if(D == result_type(0))
|
||||
D = tiny;
|
||||
C = traits::b(v) + traits::a(v) / C;
|
||||
if(C == 0)
|
||||
if(C == zero)
|
||||
C = tiny;
|
||||
D = 1/D;
|
||||
D = one/D;
|
||||
delta = C*D;
|
||||
f = f * delta;
|
||||
}while((fabs(delta - 1) > factor) && --counter);
|
||||
}while((abs(delta - one) > terminator) && --counter);
|
||||
|
||||
max_terms = max_terms - counter;
|
||||
|
||||
@@ -183,15 +205,20 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(G
|
||||
typedef detail::fraction_traits<Gen> traits;
|
||||
typedef typename traits::result_type result_type;
|
||||
typedef typename traits::value_type value_type;
|
||||
typedef typename integer_scalar_type<result_type>::type integer_type;
|
||||
typedef typename scalar_type<result_type>::type scalar_type;
|
||||
|
||||
result_type tiny = tools::min_value<result_type>();
|
||||
integer_type const zero(0), one(1);
|
||||
|
||||
result_type tiny = detail::tiny_value<result_type>::get();
|
||||
scalar_type terminator = abs(factor);
|
||||
|
||||
value_type v = g();
|
||||
|
||||
result_type f, C, D, delta, a0;
|
||||
f = traits::b(v);
|
||||
a0 = traits::a(v);
|
||||
if(f == 0)
|
||||
if(f == zero)
|
||||
f = tiny;
|
||||
C = f;
|
||||
D = 0;
|
||||
@@ -201,15 +228,15 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(G
|
||||
do{
|
||||
v = g();
|
||||
D = traits::b(v) + traits::a(v) * D;
|
||||
if(D == 0)
|
||||
if(D == zero)
|
||||
D = tiny;
|
||||
C = traits::b(v) + traits::a(v) / C;
|
||||
if(C == 0)
|
||||
if(C == zero)
|
||||
C = tiny;
|
||||
D = 1/D;
|
||||
D = one/D;
|
||||
delta = C*D;
|
||||
f = f * delta;
|
||||
}while((fabs(delta - 1) > factor) && --counter);
|
||||
}while((abs(delta - one) > terminator) && --counter);
|
||||
|
||||
max_terms = max_terms - counter;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user