Changeset ebc602 in git
- Timestamp:
- May 16, 2006, 3:43:19 PM (17 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- dbcf42a937f51948f4de74902429b68c1b54592b
- Parents:
- b8b01af0e7839f5203fa9378d74dad8732160032
- Location:
- factory
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_algorithm.cc
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_algorithm.cc,v 1.1 0 2005-12-09 08:35:37Singular Exp $ */2 /* $Id: cf_algorithm.cc,v 1.11 2006-05-16 13:43:18 Singular Exp $ */ 3 3 4 4 //{{{ docu … … 293 293 //}}} 294 294 295 //{{{ bool divides ( const CanonicalForm & f, const CanonicalForm & g )296 //{{{ docu 297 // 298 // divides() - check whether `f' divides `g'.295 //{{{ bool fdivides ( const CanonicalForm & f, const CanonicalForm & g ) 296 //{{{ docu 297 // 298 // fdivides() - check whether `f' divides `g'. 299 299 // 300 300 // Returns true iff `f' divides `g'. Uses some extra heuristic … … 315 315 // Developers note: 316 316 // ---------------- 317 // One may consider the the test ` divides( f.LC(), g.LC() )' in317 // One may consider the the test `fdivides( f.LC(), g.LC() )' in 318 318 // the main `if'-test superfluous since `divremt()' in the 319 319 // `if'-body repeats the test. However, `divremt()' does not use 320 320 // any heuristic to do so. 321 321 // 322 // It seems not reasonable to call ` divides()' from `divremt()'323 // to check divisibility of leading coefficients. ` divides()' is322 // It seems not reasonable to call `fdivides()' from `divremt()' 323 // to check divisibility of leading coefficients. `fdivides()' is 324 324 // on a relatively high level compared to `divremt()'. 325 325 // 326 326 //}}} 327 327 bool 328 divides ( const CanonicalForm & f, const CanonicalForm & g )328 fdivides ( const CanonicalForm & f, const CanonicalForm & g ) 329 329 { 330 330 // trivial cases … … 351 351 // f and g are polynomials in the same main variable 352 352 if ( degree( f ) <= degree( g ) 353 && divides( f.tailcoeff(), g.tailcoeff() )354 && divides( f.LC(), g.LC() ) ) {353 && fdivides( f.tailcoeff(), g.tailcoeff() ) 354 && fdivides( f.LC(), g.LC() ) ) { 355 355 CanonicalForm q, r; 356 356 return divremt( g, f, q, r ) && r.isZero(); -
factory/cf_algorithm.h
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_algorithm.h,v 1.1 3 2006-05-15 08:17:36Singular Exp $ */2 /* $Id: cf_algorithm.h,v 1.14 2006-05-16 13:43:18 Singular Exp $ */ 3 3 4 4 #ifndef INCL_CF_ALGORITHM_H … … 40 40 CanonicalForm bCommonDen ( const CanonicalForm & f ); 41 41 42 bool divides ( const CanonicalForm & f, const CanonicalForm & g );42 bool fdivides ( const CanonicalForm & f, const CanonicalForm & g ); 43 43 44 44 CanonicalForm maxNorm ( const CanonicalForm & f ); -
factory/cf_gcd.cc
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_gcd.cc,v 1.4 6 2006-05-08 12:24:04 pohlExp $ */2 /* $Id: cf_gcd.cc,v 1.47 2006-05-16 13:43:18 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 270 270 // now balance D mod q 271 271 D = pp( balance( D, q ) ); 272 if ( divides( D, f ) &÷s( D, g ) )272 if ( fdivides( D, f ) && fdivides( D, g ) ) 273 273 return D * c; 274 274 else … … 620 620 else 621 621 { 622 if ( divides( f, g ) )622 if ( fdivides( f, g ) ) 623 623 return abs( f ); 624 else if ( divides( g, f ) )624 else if ( fdivides( g, f ) ) 625 625 return abs( g ); 626 626 if ( !( getCharacteristic() == 0 && isOn( SW_RATIONAL ) ) ) … … 628 628 CanonicalForm d; 629 629 do{ d = gcd_poly( f, g ); } 630 while ((! divides(d,f)) || (!divides(d,g)));630 while ((!fdivides(d,f)) || (!fdivides(d,g))); 631 631 return abs( d ); 632 632 } … … 641 641 Off( SW_RATIONAL ); 642 642 do { l = gcd_poly( F, G ); } 643 while ((! divides(l,F)) || (!divides(l,G)));643 while ((!fdivides(l,F)) || (!fdivides(l,G))); 644 644 On( SW_RATIONAL ); 645 645 return abs( l ); -
factory/fac_distrib.cc
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_distrib.cc,v 1. 7 2002-10-10 17:43:40Singular Exp $ */2 /* $Id: fac_distrib.cc,v 1.8 2006-05-16 13:43:18 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 79 79 ut = lc( G[j] ); 80 80 DEBOUTLN( cerr, "checking with " << ut ); 81 while ( m > 0 && divides( D[i], ut ) ) {81 while ( m > 0 && fdivides( D[i], ut ) ) { 82 82 DEBOUTLN( cerr, "match found" ); 83 83 m--; ut /= D[i]; … … 129 129 continue; 130 130 } 131 while ( divides( h, f ) )131 while ( fdivides( h, f ) ) 132 132 f /= h; 133 133 CFList D( h ); -
factory/fac_ezgcd.cc
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_ezgcd.cc,v 1.2 6 2006-01-30 09:06:18 pohlExp $ */2 /* $Id: fac_ezgcd.cc,v 1.27 2006-05-16 13:43:18 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 110 110 DEBOUTLN( cerr, "now after A4, delta = " << delta ); 111 111 /// ---> A5 112 if ( degF <= degG && delta == degF && divides( F, G ) )112 if ( degF <= degG && delta == degF && fdivides( F, G ) ) 113 113 { 114 114 DEBDECLEVEL( cerr, "ezgcd" ); 115 115 return d*F; 116 116 } 117 if ( degG < degF && delta == degG && divides( G, F ) )117 if ( degG < degF && delta == degG && fdivides( G, F ) ) 118 118 { 119 119 DEBDECLEVEL( cerr, "ezgcd" ); … … 183 183 CanonicalForm cand=DD[2] / xxx; //content(DD[2],Variable(1)); 184 184 #if 0 185 gcdfound= divides(cand,G) &÷s(cand,F);185 gcdfound= fdivides(cand,G) && fdivides(cand,F); 186 186 #else 187 187 if (B_is_F /*B==F*lcF*/) 188 188 { 189 189 DEBOUTLN( cerr, "(test) G: "<<G<<" % gcd:"<<cand<<" -> " << G%cand ); 190 gcdfound= divides(cand,G);190 gcdfound= fdivides(cand,G); 191 191 } 192 192 else 193 193 { 194 194 DEBOUTLN( cerr, "(test) F: "<<F<<" % gcd:"<<cand<<" -> " << F%cand); 195 gcdfound= divides(cand,F);195 gcdfound= fdivides(cand,F); 196 196 } 197 197 #endif -
factory/sm_sparsemod.cc
rb8b01a rebc602 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: sm_sparsemod.cc,v 1. 8 2000-04-05 10:03:09 Singular Exp $ */2 /* $Id: sm_sparsemod.cc,v 1.9 2006-05-16 13:43:19 Singular Exp $ */ 3 3 4 4 //{{{ docu … … 454 454 //cout << " lcggt = " << lcggt << endl; 455 455 //bool ja; 456 //ja = divides( lcggt, lc( G[levU] ) );456 //ja = fdivides( lcggt, lc( G[levU] ) ); 457 457 //cout << " ja = " << ja << endl; 458 458 //cout << " vor Verlassen " << endl; … … 537 537 res = result; 538 538 539 if ( divides( res, primif ) &÷s( res, primig ) )539 if ( fdivides( res, primif ) && fdivides( res, primig ) ) 540 540 return N(NN(res))*N(ggt) ; /// compress rueckgaengig machen! 541 541 else … … 587 587 res = result; 588 588 589 if ( ( divides( res, primif )) && (divides ( res, primig ) ))589 if ( ( fdivides( res, primif )) && ( fdivides ( res, primig ) )) 590 590 { 591 591 // make monic ////
Note: See TracChangeset
for help on using the changeset viewer.