Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86193 - trunk/boost/multiprecision/cpp_int
From: john_at_[hidden]
Date: 2013-10-07 14:16:19


Author: johnmaddock
Date: 2013-10-07 14:16:19 EDT (Mon, 07 Oct 2013)
New Revision: 86193
URL: http://svn.boost.org/trac/boost/changeset/86193

Log:
Enable divide_qr for mixed arguments.

Text files modified:
   trunk/boost/multiprecision/cpp_int/misc.hpp | 25 +++++++++++++++++++++++++
   1 files changed, 25 insertions(+), 0 deletions(-)

Modified: trunk/boost/multiprecision/cpp_int/misc.hpp
==============================================================================
--- trunk/boost/multiprecision/cpp_int/misc.hpp Mon Oct 7 13:41:43 2013 (r86192)
+++ trunk/boost/multiprecision/cpp_int/misc.hpp 2013-10-07 14:16:19 EDT (Mon, 07 Oct 2013) (r86193)
@@ -240,6 +240,31 @@
    r.sign(x.sign());
 }
 
+template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
+inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
+ eval_qr(
+ const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x,
+ limb_type y,
+ cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& q,
+ cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& r) BOOST_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
+{
+ divide_unsigned_helper(&q, x, y, r);
+ q.sign(x.sign());
+ r.sign(x.sign());
+}
+
+template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class U>
+inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
+ eval_qr(
+ const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x,
+ U y,
+ cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& q,
+ cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& r) BOOST_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
+{
+ cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> t(y);
+ eval_qr(x, t, q, r);
+}
+
 template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class Integer>
 inline typename enable_if_c<is_unsigned<Integer>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, Integer>::type
    eval_integer_modulus(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x, Integer val)


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