[SCM] polybori: Polynomials over Boolean Rings branch, upstream-hg, updated. b4a5cffaa908c53e1d958a42110f8c4dad853aa3

Alexander Dreyer adreyer at gmx.de
Fri Mar 23 08:01:29 UTC 2012


The following commit has been merged in the upstream-hg branch:
commit 61f0a23dca6bd35c29f931c6a52a21275cd68e3c
Author: Alexander Dreyer <adreyer at gmx.de>
Date:   Sun Feb 26 22:57:49 2012 +0100

    ADD: explaining comments

diff --git a/groebner/include/polybori/groebner/DelayedLongProduct.h b/groebner/include/polybori/groebner/DelayedLongProduct.h
index 25a9177..d3815d7 100644
--- a/groebner/include/polybori/groebner/DelayedLongProduct.h
+++ b/groebner/include/polybori/groebner/DelayedLongProduct.h
@@ -38,8 +38,11 @@ public:
   DelayedLongProduct(const long_type& high, const long_type & low):
     base(high, low) {}
 
+  // a,b != 0,  a <= c/b:  a*b <= (c/b)*b  <= (c/b)*b + (c%b) = c
+  // a,b != 0,  a >  c/b:  Assume a*b  <= c = (c/b)*b + (c%b) ->
+  //   (c/b)*b < a*b  <= (c/b)*b + (c%b)  ->  c/b < a < c/b+1 (contradicts int)
   bool greater(long_type rhs) const {
-    if (high(first) && high(second))
+    if (high(first) && high(second)) 
       return (first > rhs/second);
 
     return (first * second) > rhs;

-- 
polybori: Polynomials over Boolean Rings



More information about the debian-science-commits mailing list