[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:55:35 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit fa88d80878454e6375d1f7ef3085dc9501af4810
Author: Martin Lee <martinlee84 at web.de>
Date: Wed Apr 4 13:26:03 2012 +0200
fix: init of variable of negative level
diff --git a/factory/cf_gcd_smallp.cc b/factory/cf_gcd_smallp.cc
index e79b205..7b8ed2f 100755
--- a/factory/cf_gcd_smallp.cc
+++ b/factory/cf_gcd_smallp.cc
@@ -719,8 +719,12 @@ GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (substitute > 1)
@@ -739,8 +743,12 @@ GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
(gcdlcAlcB(random_element, x)/uni_lcoeff (G_random_element))
* G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 < d)
{
m= gcdlcAlcB;
@@ -992,8 +1000,12 @@ CanonicalForm GCD_GF (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (inextension)
@@ -1024,8 +1036,11 @@ CanonicalForm GCD_GF (const CanonicalForm& F, const CanonicalForm& G,
G_random_element=
(gcdlcAlcB(random_element, x)/uni_lcoeff(G_random_element)) *
G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
if (d0 < d)
{
@@ -1351,8 +1366,11 @@ CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
if (d0 == 0)
{
@@ -1372,8 +1390,11 @@ CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm& G,
*G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
if (d0 < d)
{
@@ -2983,8 +3004,12 @@ CanonicalForm sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (substitute > 1)
@@ -3004,8 +3029,12 @@ CanonicalForm sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
* G_random_element;
skeleton= G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 < d)
{
m= gcdlcAlcB;
@@ -3161,8 +3190,12 @@ CanonicalForm sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (substitute > 1)
@@ -3181,8 +3214,12 @@ CanonicalForm sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
(gcdlcAlcB(random_element, x)/uni_lcoeff (G_random_element))
* G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 < d)
{
m= gcdlcAlcB;
@@ -3468,8 +3505,12 @@ CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
DEBOUTLN (cerr, "G_random_element= " << G_random_element);
}
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (substitute > 1)
@@ -3490,8 +3531,12 @@ CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
skeleton= G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 < d)
{
m= gcdlcAlcB;
@@ -3684,8 +3729,12 @@ CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
if (sparseFail)
break;
- d0= totaldegree (G_random_element, Variable(2),
- Variable (G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 == 0)
{
if (substitute > 1)
@@ -3704,8 +3753,12 @@ CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
(gcdlcAlcB(random_element, x)/uni_lcoeff (G_random_element))
* G_random_element;
- d0= totaldegree (G_random_element, Variable(2),
- Variable(G_random_element.level()));
+ if (!G_random_element.inCoeffDomain())
+ d0= totaldegree (G_random_element, Variable(2),
+ Variable (G_random_element.level()));
+ else
+ d0= 0;
+
if (d0 < d)
{
m= gcdlcAlcB;
--
an open source computer algebra system
More information about the debian-science-commits
mailing list