Changeset f894fe in git
 Timestamp:
 Jul 30, 1997, 9:55:02 AM (27 years ago)
 Branches:
 (u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
 Children:
 257f751511c7fc8d664312e3e88cf8a49a117a05
 Parents:
 281760cd009d9463e865ca83f18012a15ee659dc
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/canonicalform.cc
r281760 rf894fe 1 1 /* emacs edit mode for this file is * C++ * */ 2 /* $Id: canonicalform.cc,v 1.1 0 19970716 10:16:08schmidt Exp $ */2 /* $Id: canonicalform.cc,v 1.11 19970730 07:55:02 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 1156 1156 #endif 1157 1157 1158 Off( SW_RATIONAL );1159 Off( SW_QUOTIENT );1160 Off( SW_SYMMETRIC_FF );1161 Off( SW_BERLEKAMP );1162 Off( SW_FAC_USE_BIG_PRIMES );1163 Off( SW_FAC_QUADRATICLIFT );1164 Off( SW_USE_EZGCD );1165 Off( SW_USE_SPARSEMOD );1166 1167 1158 (void)initializeCharacteristic(); 1168 1159 (void)initializeGMP(); … … 1253 1244 } 1254 1245 1255 static void1256 fillVarsRec ( const CanonicalForm & f, int * vars )1257 {1258 int n;1259 if ( (n = f.level()) > 0 ) {1260 vars[n] = 1;1261 CFIterator i;1262 for ( i = f; i.hasTerms(); ++i )1263 fillVarsRec( i.coeff(), vars );1264 }1265 }1266 1267 1246 CanonicalForm 1268 1247 CanonicalForm::sqrt ( ) const … … 1318 1297 //}}} 1319 1298 1320 int1321 getNumVars( const CanonicalForm & f )1322 {1323 int n;1324 if ( f.inCoeffDomain() )1325 return 0;1326 else if ( (n = f.level()) == 1 )1327 return 1;1328 else {1329 int * vars = new int[ n+1 ];1330 int i;1331 for ( i = 0; i < n; i++ ) vars[i] = 0;1332 for ( CFIterator I = f; I.hasTerms(); ++I )1333 fillVarsRec( I.coeff(), vars );1334 int m = 0;1335 for ( i = 1; i < n; i++ )1336 if ( vars[i] != 0 ) m++;1337 delete [] vars;1338 return m+1;1339 }1340 }1341 1342 CanonicalForm1343 getVars( const CanonicalForm & f )1344 {1345 int n;1346 if ( f.inCoeffDomain() )1347 return 1;1348 else if ( (n = f.level()) == 1 )1349 return Variable( 1 );1350 else {1351 int * vars = new int[ n+1 ];1352 int i;1353 for ( i = 0; i <= n; i++ ) vars[i] = 0;1354 for ( CFIterator I = f; I.hasTerms(); ++I )1355 fillVarsRec( I.coeff(), vars );1356 CanonicalForm result = 1;1357 for ( i = n; i > 0; i )1358 if ( vars[i] != 0 ) result *= Variable( i );1359 delete [] vars;1360 return f.mvar() * result;1361 }1362 }1363 1364 1299 bool 1365 1300 divides ( const CanonicalForm & f, const CanonicalForm & g )
Note: See TracChangeset
for help on using the changeset viewer.