[singular] 02/09: 440: Factoring over a finite field returns reducible factor

felix salfelder felix-guest at alioth.debian.org
Tue Sep 3 20:24:44 UTC 2013


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master-3-1-5
in repository singular.

commit 77890570ffe3fc8d287f654e4c6427c568b6c6fb
Author: Felix Salfelder <felix at salfelder.org>
Date:   Tue Sep 3 20:05:34 2013 +0200

    440: Factoring over a finite field returns reducible factor
---
 factory/cf_util.cc    |   16 ++++++++++++++++
 factory/cf_util.h     |    1 +
 factory/facFqBivar.cc |    2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/factory/cf_util.cc b/factory/cf_util.cc
index 02ecb42..91c3303 100644
--- a/factory/cf_util.cc
+++ b/factory/cf_util.cc
@@ -46,6 +46,22 @@ int ilog2 (int a)
   return n;
 }
 
+int igcd( int a, int b )
+{
+    if ( a < 0 ) a = -a;
+    if ( b < 0 ) b = -b;
+
+    int c;
+
+    while ( b != 0 )
+    {
+        c = a % b;
+        a = b;
+        b = c;
+    }
+    return a;
+}
+
 #include<stdio.h>
 #include<stdlib.h>
 
diff --git a/factory/cf_util.h b/factory/cf_util.h
index 17baf35..e7309b0 100644
--- a/factory/cf_util.h
+++ b/factory/cf_util.h
@@ -13,6 +13,7 @@
 
 int ipower ( int b, int n );
 int ilog2 (int a);
+int igcd (int a, int b);
 
 /*BEGINPUBLIC*/
 void factoryError_intern(const char *s);
diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index 79b968b..f526883 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -5928,7 +5928,7 @@ biFactorize (const CanonicalForm& F, const ExtensionInfo& info)
   
   //check trivial case
   if (degree (A) == 1 || degree (A, 1) == 1 || 
-      (size (A) == 2 && gcd (degree (A), degree (A,1)).isOne()))
+      (size (A) == 2 && igcd (degree (A), degree (A,1))==1))
   {
     factors.append (A);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/singular.git



More information about the debian-science-commits mailing list