Changeset f894fe in git


Ignore:
Timestamp:
Jul 30, 1997, 9:55:02 AM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
Children:
257f751511c7fc8d664312e3e88cf8a49a117a05
Parents:
281760cd009d9463e865ca83f18012a15ee659dc
Message:
	* canonicalform.cc (initCanonicalForm): initialization of switches
	  removed since they are initialized by constructor

	* canonicalform.cc (fillVarsRec, getNumVars, getVars): moved to
	  cf_ops.cc


git-svn-id: file:///usr/local/Singular/svn/trunk@581 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/canonicalform.cc

    r281760 rf894fe  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: canonicalform.cc,v 1.10 1997-07-16 10:16:08 schmidt Exp $ */
     2/* $Id: canonicalform.cc,v 1.11 1997-07-30 07:55:02 schmidt Exp $ */
    33
    44#include <config.h>
     
    11561156#endif
    11571157
    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 
    11671158        (void)initializeCharacteristic();
    11681159        (void)initializeGMP();
     
    12531244}
    12541245
    1255 static void
    1256 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 
    12671246CanonicalForm
    12681247CanonicalForm::sqrt ( ) const
     
    13181297//}}}
    13191298
    1320 int
    1321 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 CanonicalForm
    1343 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 
    13641299bool
    13651300divides ( const CanonicalForm & f, const CanonicalForm & g )
Note: See TracChangeset for help on using the changeset viewer.