[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 69873061641aea40fd6cb393bd94166078480ac7
Author: Martin Lee <martinlee84 at web.de>
Date: Wed Apr 4 13:30:52 2012 +0200
fix: wrong/unneccessary asserts
diff --git a/factory/cf_char.cc b/factory/cf_char.cc
index 78d99d1..5b93424 100644
--- a/factory/cf_char.cc
+++ b/factory/cf_char.cc
@@ -72,7 +72,7 @@ int getExp()
int getGFDegree()
{
- ASSERT( theDegree > 0, "not in GF(q)" );
+ //ASSERT( theDegree > 0, "not in GF(q)" );
return theDegree;
}
diff --git a/factory/cf_gcd_smallp.cc b/factory/cf_gcd_smallp.cc
index 7b8ed2f..39c53d3 100755
--- a/factory/cf_gcd_smallp.cc
+++ b/factory/cf_gcd_smallp.cc
@@ -3986,7 +3986,7 @@ Evaluation optimize4Lift (const CanonicalForm& F, CFMap & M,
Evaluation result= Evaluation (A.min(), A.max());
ASSERT (A.min() == 2, "expected A.min() == 2");
- ASSERT (A.max() == n, "expected A.max() == n");
+ ASSERT (A.max() >= n, "expected A.max() >= n");
int max_deg;
int k= n;
int l= 1;
diff --git a/factory/cf_map_ext.cc b/factory/cf_map_ext.cc
index 5bf452f..2d8a29b 100644
--- a/factory/cf_map_ext.cc
+++ b/factory/cf_map_ext.cc
@@ -282,7 +282,7 @@ CanonicalForm mapUp (const CanonicalForm& F, const CanonicalForm& G,
counter++;
if (buf == buf2) break;
}
- ASSERT (counter >= bound, "alpha is not primitive");
+ ASSERT (counter <= bound, "alpha is not primitive");
if (pos == 0)
{
H_power= buf*power (H, counter);
diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index b91fc91..c103968 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -143,7 +143,8 @@ CFList
uniFactorizer (const CanonicalForm& A, const Variable& alpha, const bool& GF)
{
Variable x= A.mvar();
- ASSERT (A.isUnivariate(), "univariate polynomial expected");
+ ASSERT (A.isUnivariate() || A.inCoeffDomain(),
+ "univariate polynomial expected or constant expected");
CFFList factorsA;
ZZ p= to_ZZ (getCharacteristic());
ZZ_p::init (p);
diff --git a/factory/facFqBivarUtil.cc b/factory/facFqBivarUtil.cc
index a596281..216d33d 100644
--- a/factory/facFqBivarUtil.cc
+++ b/factory/facFqBivarUtil.cc
@@ -544,8 +544,8 @@ writeInMatrix (CFMatrix& M, const CFArray& A, const int column,
const int startIndex
)
{
- ASSERT (A.size () - startIndex > 0, "wrong starting index");
- ASSERT (A.size () - startIndex == M.rows(), "wrong starting index");
+ ASSERT (A.size () - startIndex >= 0, "wrong starting index");
+ ASSERT (A.size () - startIndex <= M.rows(), "wrong starting index");
ASSERT (column > 0 && column <= M.columns(), "wrong column");
if (A.size() - startIndex <= 0) return;
int j= 1;
@@ -555,7 +555,7 @@ writeInMatrix (CFMatrix& M, const CFArray& A, const int column,
CFArray getCoeffs (const CanonicalForm& F, const int k)
{
- ASSERT (F.isUnivariate(), "univariate input expected");
+ ASSERT (F.isUnivariate() || F.inCoeffDomain(), "univariate input expected");
if (degree (F, 2) < k)
return CFArray();
@@ -578,7 +578,7 @@ CFArray getCoeffs (const CanonicalForm& F, const int k)
CFArray getCoeffs (const CanonicalForm& F, const int k, const Variable& alpha)
{
- ASSERT (F.isUnivariate(), "univariate input expected");
+ ASSERT (F.isUnivariate() || F.inCoeffDomain(), "univariate input expected");
if (degree (F, 2) < k)
return CFArray ();
@@ -621,7 +621,7 @@ getCoeffs (const CanonicalForm& G, const int k, const int l, const int degMipo,
const Variable& alpha, const CanonicalForm& evaluation,
const mat_zz_p& M)
{
- ASSERT (G.isUnivariate(), "univariate input expected");
+ ASSERT (G.isUnivariate() || G.inCoeffDomain(), "univariate input expected");
CanonicalForm F= G (G.mvar() - evaluation, G.mvar());
if (F.isZero())
return CFArray ();
diff --git a/factory/facMul.cc b/factory/facMul.cc
index cb8c779..79f9419 100644
--- a/factory/facMul.cc
+++ b/factory/facMul.cc
@@ -2420,7 +2420,6 @@ newtonDiv (const CanonicalForm& F, const CanonicalForm& G, const CanonicalForm&
M)
{
ASSERT (getCharacteristic() > 0, "positive characteristic expected");
- ASSERT (CFFactory::gettype() != GaloisFieldDomain, "no GF expected");
CanonicalForm A= mod (F, M);
CanonicalForm B= mod (G, M);
@@ -2573,7 +2572,6 @@ void divrem21 (const CanonicalForm& F, const CanonicalForm& G, CanonicalForm& Q,
R= A;
return;
}
- ASSERT (2*degB > degA, "expected degree (F, 1) < 2*degree (G, 1)");
if (degB < 1)
{
divrem (A, B, Q, R);
@@ -2581,8 +2579,8 @@ void divrem21 (const CanonicalForm& F, const CanonicalForm& G, CanonicalForm& Q,
R= mod (R, M);
return;
}
-
int m= (int) ceil ((double) (degB + 1)/2.0) + 1;
+ ASSERT (4*m >= degA, "expected degree (F, 1) < 2*degree (G, 1)");
CFList splitA= split (A, m, x);
if (splitA.length() == 3)
splitA.insert (0);
@@ -2645,7 +2643,6 @@ void divrem32 (const CanonicalForm& F, const CanonicalForm& G, CanonicalForm& Q,
R= A;
return;
}
- ASSERT (3*(degB/2) > degA, "expected degree (F, 1) < 3*(degree (G, 1)/2)");
if (degB < 1)
{
divrem (A, B, Q, R);
@@ -2654,7 +2651,7 @@ void divrem32 (const CanonicalForm& F, const CanonicalForm& G, CanonicalForm& Q,
return;
}
int m= (int) ceil ((double) (degB + 1)/ 2.0);
-
+ ASSERT (3*m > degA, "expected degree (F, 1) < 3*degree (G, 1)");
CFList splitA= split (A, m, x);
CFList splitB= split (B, m, x);
diff --git a/factory/variable.cc b/factory/variable.cc
index 4025b62..38acd82 100644
--- a/factory/variable.cc
+++ b/factory/variable.cc
@@ -159,7 +159,7 @@ static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alph
Variable rootOf( const CanonicalForm & mipo, char name )
{
- ASSERT (mipo.inPolyDomain() && mipo.isUnivariate(), "not a legal extension");
+ ASSERT (mipo.isUnivariate(), "not a legal extension");
int l;
if ( var_names_ext == 0 ) {
--
an open source computer algebra system
More information about the debian-science-commits
mailing list