diff options
Diffstat (limited to 'boost/math/bindings')
-rw-r--r-- | boost/math/bindings/detail/big_lanczos.hpp | 11 | ||||
-rw-r--r-- | boost/math/bindings/e_float.hpp | 5 | ||||
-rw-r--r-- | boost/math/bindings/mpfr.hpp | 6 | ||||
-rw-r--r-- | boost/math/bindings/rr.hpp | 11 |
4 files changed, 32 insertions, 1 deletions
diff --git a/boost/math/bindings/detail/big_lanczos.hpp b/boost/math/bindings/detail/big_lanczos.hpp index a11f1b8196..314b4f88c4 100644 --- a/boost/math/bindings/detail/big_lanczos.hpp +++ b/boost/math/bindings/detail/big_lanczos.hpp @@ -32,6 +32,7 @@ struct lanczos22UDT : public mpl::int_<120> template <class T> static T lanczos_sum(const T& z) { + lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T num[22] = { static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 46198410803245094237463011094.12173081986)), static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 43735859291852324413622037436.321513777)), @@ -86,6 +87,7 @@ struct lanczos22UDT : public mpl::int_<120> template <class T> static T lanczos_sum_expG_scaled(const T& z) { + lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T num[22] = { static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6939996264376682180.277485395074954356211)), static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6570067992110214451.87201438870245659384)), @@ -141,6 +143,7 @@ struct lanczos22UDT : public mpl::int_<120> template<class T> static T lanczos_sum_near_1(const T& dz) { + lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T d[21] = { static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 8.318998691953337183034781139546384476554)), static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -63.15415991415959158214140353299240638675)), @@ -219,6 +222,7 @@ struct lanczos31UDT template <class T> static T lanczos_sum(const T& z) { + lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T num[31] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.2579646553333513328235723061836959833277e46)), static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.2444796504337453845497419271639377138264e46)), @@ -291,6 +295,7 @@ struct lanczos31UDT template <class T> static T lanczos_sum_expG_scaled(const T& z) { + lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T num[31] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 30137154810677525966583148469478.52374216)), static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 28561746428637727032849890123131.36314653)), @@ -364,6 +369,7 @@ struct lanczos31UDT template<class T> static T lanczos_sum_near_1(const T& dz) { + lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T d[30] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 11.80038544942943603508206880307972596807)), static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, -130.6355975335626214564236363322099481079)), @@ -407,6 +413,7 @@ struct lanczos31UDT template<class T> static T lanczos_sum_near_2(const T& dz) { + lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() static const T d[30] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 147.9979641587472136175636384176549713358)), static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, -1638.404318611773924210055619836375434296)), @@ -461,6 +468,7 @@ struct lanczos61UDT template <class T> static T lanczos_sum(const T& z) { + lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() using namespace boost; static const T d[61] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 2.50662827463100050241576528481104525300698674060993831662992357634229365460784197494659584)), @@ -536,6 +544,7 @@ struct lanczos61UDT template <class T> static T lanczos_sum_expG_scaled(const T& z) { + lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() using namespace boost; static const T d[61] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.901751806425638853077358552989167785490911341809902155556127108480303870921448984935411583e-27)), @@ -611,6 +620,7 @@ struct lanczos61UDT template<class T> static T lanczos_sum_near_1(const T& dz) { + lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() using namespace boost; static const T d[60] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 23.2463658527729692390378860713647146932236940604550445351214987229819352880524561852919518)), @@ -685,6 +695,7 @@ struct lanczos61UDT template<class T> static T lanczos_sum_near_2(const T& dz) { + lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main() using namespace boost; static const T d[60] = { static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 557.56438192770795764344217888434355281097193198928944200046501607026919782564033547346298)), diff --git a/boost/math/bindings/e_float.hpp b/boost/math/bindings/e_float.hpp index 959bff109b..d7f9a73508 100644 --- a/boost/math/bindings/e_float.hpp +++ b/boost/math/bindings/e_float.hpp @@ -318,6 +318,11 @@ inline e_float atan(const e_float& v) return ::ef::atan(v.value()); } +inline e_float atan2(const e_float& v, const e_float& u) +{ + return ::ef::atan2(v.value(), u.value()); +} + inline e_float ldexp(const e_float& v, int e) { return v.value() * ::ef::pow2(e); diff --git a/boost/math/bindings/mpfr.hpp b/boost/math/bindings/mpfr.hpp index 95be0ee2ba..e5c6ba071d 100644 --- a/boost/math/bindings/mpfr.hpp +++ b/boost/math/bindings/mpfr.hpp @@ -860,7 +860,11 @@ inline mpfr_class bessel_i1(mpfr_class x) } // namespace detail -}} +} + +template<> struct is_convertible<long double, mpfr_class> : public mpl::false_{}; + +} #endif // BOOST_MATH_MPLFR_BINDINGS_HPP diff --git a/boost/math/bindings/rr.hpp b/boost/math/bindings/rr.hpp index 58c22b8891..6ec79f953d 100644 --- a/boost/math/bindings/rr.hpp +++ b/boost/math/bindings/rr.hpp @@ -763,6 +763,17 @@ namespace ntl{ NTL::RR::precision()); } + inline RR atan2(RR y, RR x) + { + if(x > 0) + return atan(y / x); + if(x < 0) + { + return y < 0 ? atan(y / x) - boost::math::constants::pi<RR>() : atan(y / x) + boost::math::constants::pi<RR>(); + } + return y < 0 ? -boost::math::constants::half_pi<RR>() : boost::math::constants::half_pi<RR>() ; + } + inline RR sinh(RR z) { return (expm1(z.value()) - expm1(-z.value())) / 2; |