[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:53:26 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit 1a93e3ca1cd8580f30340620270230373576f1ce
Author: Martin Lee <martinlee84 at web.de>
Date: Thu Feb 23 13:00:13 2012 +0100
fixes from spielwiese
diff --git a/factory/gfops.cc b/factory/gfops.cc
index 3b153e4..e41b2ac 100644
--- a/factory/gfops.cc
+++ b/factory/gfops.cc
@@ -28,16 +28,18 @@ const int gf_maxtable = 63001;
const int gf_maxbuffer = 200;
const int gf_primes_len = 42;
-//static unsigned short gf_primes [] =
-//{
-// 2, 3, 5, 7, 11, 13, 17, 19,
-// 23, 29, 31, 37, 41, 43, 47, 53,
-// 59, 61, 67, 71, 73, 79, 83, 89,
-// 97, 101, 103, 107, 109, 113, 127, 131,
-// 137, 139, 149, 151, 157, 163, 167, 173,
-// 179, 181, 191, 193, 197, 199, 223, 211,
-// 227, 229, 233, 239, 241, 251
-//};
+#ifndef NOASSERT
+static unsigned short gf_primes [] =
+{
+ 2, 3, 5, 7, 11, 13, 17, 19,
+ 23, 29, 31, 37, 41, 43, 47, 53,
+ 59, 61, 67, 71, 73, 79, 83, 89,
+ 97, 101, 103, 107, 109, 113, 127, 131,
+ 137, 139, 149, 151, 157, 163, 167, 173,
+ 179, 181, 191, 193, 197, 199, 223, 211,
+ 227, 229, 233, 239, 241, 251
+};
+#endif
int gf_q = 0;
int gf_p = 0;
@@ -187,31 +189,33 @@ static void gf_get_table ( int p, int n )
(void)fclose( inputfile );
}
-//static bool gf_valid_combination ( int p, int n )
-//{
-// int i = 0;
-// while ( i < gf_primes_len && gf_primes[i] != p ) i++;
-// if ( i == gf_primes_len )
-// return false;
-// else
-// {
-// i = n;
-// int a = 1;
-// while ( a < gf_maxtable && i > 0 )
-// {
-// a *= p;
-// i--;
-// }
-// if ( i > 0 || a > gf_maxtable )
-// return false;
-// else
-// return true;
-// }
-//}
+#ifndef NOASSERT
+static bool gf_valid_combination ( int p, int n )
+{
+ int i = 0;
+ while ( i < gf_primes_len && gf_primes[i] != p ) i++;
+ if ( i == gf_primes_len )
+ return false;
+ else
+ {
+ i = n;
+ int a = 1;
+ while ( a < gf_maxtable && i > 0 )
+ {
+ a *= p;
+ i--;
+ }
+ if ( i > 0 || a > gf_maxtable )
+ return false;
+ else
+ return true;
+ }
+}
+#endif
void gf_setcharacteristic ( int p, int n, char name )
{
- //ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" );
+ ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" );
gf_name = name;
gf_get_table( p, n );
}
diff --git a/factory/variable.cc b/factory/variable.cc
index 31d53cd..4025b62 100644
--- a/factory/variable.cc
+++ b/factory/variable.cc
@@ -149,15 +149,6 @@ OSTREAM & operator << ( OSTREAM & os, const Variable & v )
}
#endif /* NOSTREAMIO */
-//static bool legal_mipo( const CanonicalForm & mipo )
-//{
-// ASSERT( mipo.inPolyDomain(), "not a legal extension" );
-// bool ok = true;
-// for ( CFIterator i = mipo; ok && i.hasTerms(); i++ )
-// ok = i.coeff().inBaseDomain();
-// return ok;
-//}
-
static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alpha )
{
CanonicalForm result;
@@ -168,7 +159,7 @@ static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alph
Variable rootOf( const CanonicalForm & mipo, char name )
{
- //ASSERT( legal_mipo( mipo ), "not a legal extension" );
+ ASSERT (mipo.inPolyDomain() && 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