Changeset 4a81ec in git for libfac/charset
- Timestamp:
- Sep 12, 1997, 9:20:02 AM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 0fbdd16f374f7f4570da62a453e2328e4d8a4b4c
- Parents:
- 0479e09dbc0fb17be7ebce384df4ba0318ba20eb
- Location:
- libfac/charset
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/charset/alg_factor.cc
r0479e09 r4a81ec 3 3 // emacs edit mode for this file is -*- C++ -*- 4 4 //////////////////////////////////////////////////////////// 5 static char * rcsid = "$Id: alg_factor.cc,v 1. 1.1.1 1997-09-11 10:58:22Singular Exp $";5 static char * rcsid = "$Id: alg_factor.cc,v 1.2 1997-09-12 07:19:37 Singular Exp $"; 6 6 //////////////////////////////////////////////////////////// 7 7 // FACTORY - Includes … … 155 155 temp= gcd(R, R.deriv(vf)); 156 156 DEBOUTLN(cout, "sqrf_norm_sub: temp= ", temp); 157 if (degree(temp ) != 0 || temp == temp.genZero() ){ sqfreetest= 0; }157 if (degree(temp,vf) != 0 || temp == temp.genZero() ){ sqfreetest= 0; } 158 158 else { sqfreetest= 1; } 159 159 DEBOUTLN(cout, "sqrf_norm_sub: sqfreetest= ", sqfreetest); … … 336 336 DEBOUTLN(cout, "alg_factor: R= ", R); 337 337 Off(SW_RATIONAL); 338 Factorlist = Factorize(R ,1);338 Factorlist = Factorize(R); 339 339 On(SW_RATIONAL); 340 340 DEBOUTLN(cout, "alg_factor: Factorize(R)= ", Factorlist); … … 410 410 if ( x != 0 ){ 411 411 divrem(ii.getItem(), gg, q,r); 412 cout << ii.getItem() << " divided by " << gg << endl;412 // cout << ii.getItem() << " divided by " << gg << endl; 413 413 DEBOUTLN(cout, "q= ", q); DEBOUTLN(cout, "r= ", r); 414 414 ii.append(ii.getItem()+q*g); ii.remove(1); … … 614 614 $Log: not supported by cvs2svn $ 615 615 */ 616 -
libfac/charset/alg_factor.h
r0479e09 r4a81ec 3 3 // emacs edit mode for this file is -*- C++ -*- 4 4 //////////////////////////////////////////////////////////// 5 // $Id: alg_factor.h,v 1. 1.1.1 1997-09-11 10:58:22Singular Exp $5 // $Id: alg_factor.h,v 1.2 1997-09-12 07:19:37 Singular Exp $ 6 6 //////////////////////////////////////////////////////////// 7 7 -
libfac/charset/algfactor.cc
r0479e09 r4a81ec 3 3 // emacs edit mode for this file is -*- C++ -*- 4 4 //////////////////////////////////////////////////////////// 5 static char * rcsid = "$Id: algfactor.cc,v 1. 1.1.1 1997-09-11 10:58:22Singular Exp $";5 static char * rcsid = "$Id: algfactor.cc,v 1.2 1997-09-12 07:19:38 Singular Exp $"; 6 6 //////////////////////////////////////////////////////////// 7 7 // FACTORY - Includes -
libfac/charset/algfactor.h
r0479e09 r4a81ec 3 3 // emacs edit mode for this file is -*- C++ -*- 4 4 //////////////////////////////////////////////////////////// 5 // $Id: algfactor.h,v 1. 1.1.1 1997-09-11 10:58:22Singular Exp $5 // $Id: algfactor.h,v 1.2 1997-09-12 07:19:39 Singular Exp $ 6 6 //////////////////////////////////////////////////////////// 7 7 -
libfac/charset/charset.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: charset.cc,v 1. 2 1997-06-09 15:55:53Singular Exp $";4 static char * rcsid = "$Id: charset.cc,v 1.3 1997-09-12 07:19:40 Singular Exp $"; 5 5 ///////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 12 12 // Charset - Includes 13 13 #include "csutil.h" 14 #include "algfactor.h" 15 #include "alg_factor.h" 16 // Some CC's need this: 17 #include "charset.h" 14 18 15 19 #ifdef BASICSETDEBUG … … 47 51 b = lowestRank( QS ); 48 52 cb = rank( b ); 53 DEBOUTLN(cout, "BasicSet: choose b = ", b); 54 DEBOUTLN(cout, "BasicSet: it's rank = ", cb); 49 55 BS=Union(CFList(b),BS);//BS.append( b ); 50 56 if ( rank( b ) == 0 ) … … 65 71 } 66 72 67 68 69 70 71 72 73 74 73 int 74 checkok( const CFList & PS, CFList & FS2){ 75 CanonicalForm elem; 76 77 for ( CFListIterator i=PS; i.hasItem(); i++){ 78 elem= i.getItem(); 79 for (CFListIterator j=FS2; j.hasItem(); j++){ 80 if (elem == j.getItem()){ 75 81 // FS2= Difference(FS2,CFList(elem)); 76 82 return 0; 77 78 79 80 81 83 } 84 } 85 } 86 return 1; 87 } 82 88 83 89 #ifdef MCHARSETNDEBUG … … 147 153 } 148 154 155 156 CFList 157 mcharset( const CFList &PS, PremForm & Remembern ){ 158 CFList cs= MCharSetN(PS, Remembern ); 159 CFList rs= remsetb(Difference(PS,cs),cs); 160 161 DEBOUTLN(cout, "mcharset: cs= ", cs); 162 DEBOUTLN(cout, "mcharset: rs= ", rs); 163 if ( rs.length() > 0 ) 164 cs= mcharset(Union(PS,Union(cs,rs)), Remembern); 165 return cs; 166 } 167 149 168 // the "original" extended characteristic set 150 169 CFList … … 311 330 } 312 331 332 static int 333 choosefrom(){ 334 int choice; 335 cout << "choose from qhi! ->"; 336 cin >> choice; 337 return choice; 338 } 339 313 340 static ListCFList 314 341 msort( const ListCFList & list_to_sort ){ … … 333 360 334 361 ListCFList 335 IrrCharSeries( const CFList &PS ){362 IrrCharSeries( const CFList &PS, int opt ){ 336 363 CanonicalForm reducible,reducible2; 337 364 CFList qs,cs,factorset,is,ts; 338 365 ListCFList pi,ppi,qqi,qsi,iss,qhi= ListCFList(PS); 339 int nr_of_iteration=0,ts2,highestlevel=0; 366 int nr_of_iteration=0,ts2,highestlevel=0; 367 #ifdef EXPERIMENTAL 368 int choice=1;; 369 #endif 340 370 341 371 DEBOUTMSG(cout, rcsid); 372 // cout << getCharacteristic() << endl; 342 373 for ( CFListIterator Ps=PS; Ps.hasItem(); Ps++ ) 343 374 if ( level(Ps.getItem() ) > highestlevel ) highestlevel = level(Ps.getItem()) ; 344 375 // for ( int xx=1; xx <= highestlevel; xx++) 376 // cout << Variable(xx) ; 377 // cout << endl; 378 // for ( CFListIterator Ps=PS; Ps.hasItem(); Ps++ ) 379 // cout << Ps.getItem() << ", " ;//<< endl; 380 // cout << endl; 345 381 while ( ! qhi.isEmpty() ) { 346 382 qhi=sort(qhi); 347 383 DEBOUTLN(cout, "qhi is: ", qhi); 384 #ifdef EXPERIMENTAL 385 choice=choosefrom(); 386 cout <<"/n Choose " << choice << endl; 387 qs= getItemNr(choice, qhi); 388 #else 348 389 qs=qhi.getFirst(); 390 #endif 349 391 DEBOUTLN(cout, "qs is: ", qs); 350 392 DEBOUTLN(cout, "ppi is: ", ppi); … … 454 496 } 455 497 if ( ! qsi.isEmpty() ){ 456 return contract( qsi ); 498 DEBOUTLN(cout, "qsi before contract= ", qsi); 499 if ( opt == 0 ){ 500 return contract( qsi ); 501 } 502 else { return qsi; } 457 503 } 458 504 else{ return ListCFList() ; } … … 474 520 CFList ts,as; 475 521 CanonicalForm elem; 476 int ind=1,nr=0; 522 int ind=1,nr=0, success=-1; 523 CFListIterator i; 477 524 478 525 ja = 0; 479 526 DEBOUTLN(cout, "irras: called with: AS= ", AS); 480 for ( CFListIteratori=AS; i.hasItem(); i++ ){527 for ( i=AS; i.hasItem(); i++ ){ 481 528 elem = i.getItem(); 482 529 nr += 1; 483 530 DEBOUT(cout, "irras: factoring: ", elem); 484 qs = Factorize(elem); 485 531 if ( degree(elem) > 1 ) // linear poly's are irreduzible 532 qs = Factorize(elem); 533 else{ 534 qs=(CFFactor(elem,1)); 535 qs.insert(CFFactor(CanonicalForm(1),1)); 536 } 537 DEBOUTLN(cout, " = ", qs); 486 538 // INTERRUPTHANDLER 487 539 if ( interrupt_handle() ) return CFList() ; 488 540 // INTERRUPTHANDLER 489 490 541 qs.removeFirst(); 491 DEBOUTLN(cout, " = ", qs);492 // if ( num(qs.getFirst().factor() / LC(qs.getFirst().factor())) !=493 // num(elem / LC(elem))){494 542 if ( (qs.length() >= 2 ) || (qs.getFirst().exp() > 1)){ 495 543 DEBOUTLN(cout, "irras: Setting ind=0, ja= ", nr); 496 544 ja=nr; ind=0; reducible= elem; 497 // return(qs); // ist das nicht genauso gut?498 545 break; 499 546 } 500 else{ as.append(elem) ; } 501 } 502 AS=as; // warum das? 503 if ( (ind == 1) && ( AS.length() > 1) ){ 504 if ( irreducible(AS) ) ja = 0; 547 // else{ as.append(elem) ; } 548 } 549 // cout << "ind= " << ind << endl; 550 if ( (ind == 1) ){ //&& ( as.length() > 1) ){ 551 if ( irreducible(AS) ){ // as quasilinear? => irreducible! 552 ja = 0; 553 DEBOUTLN(cout, "as is irreducible. as= ", AS); 554 } 505 555 else { 506 #ifdef HAVE_SINGULAR 507 extern void WerrorS(char *); 508 WerrorS("libfac: Factorization over algebraic function field required!"); 509 #else 510 cerr << "Factorization over algebraic function field required!" << endl; 511 #endif 512 ja = -1; 556 //#ifdef HAVE_SINGULAR 557 // extern void WerrorS(char *); 558 // WerrorS("libfac: Factoring over algebraic function field!"); 559 //#else 560 // cerr << "libfac: Factoring over algebraic function field!" << endl; 561 //#endif 562 i=AS; 563 for ( nr=1; nr< AS.length(); nr++){ 564 as.append(i.getItem()); 565 i++; 566 if ( degree(i.getItem()) > 1 ){// search for a non linear elem 567 elem=i.getItem(); 568 // cout << "f= " << elem << endl; 569 // cout << "as= " << as << endl; 570 qs= newfactoras(elem,as,success); 571 // cout << "irras:newfactoras qs= " << qs << endl; 572 // qs= factoras(elem,as,success); 573 // cout << "irras:factoras qs= " << qs << endl; 574 if ( qs.length() > 1 || qs.getFirst().exp() > 1 ){ //found elem is reducible 575 reducible=elem; 576 ja=nr+1; 577 break; 578 } 579 } 580 } 513 581 } 514 582 } -
libfac/charset/charset.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: charset.h,v 1. 2 1997-06-09 15:55:53Singular Exp $4 // $Id: charset.h,v 1.3 1997-09-12 07:19:41 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 … … 13 13 CFList BasicSet( const CFList &PS ); 14 14 CFList CharSet( const CFList &PS ); 15 CFList mcharset( const CFList &PS, PremForm & Remembern ); 16 int checkok( const CFList & PS, CFList & FS2); 15 17 /*BEGINPUBLIC*/ 16 18 CFList MCharSetN( const CFList &PS, PremForm & Remembern ); 17 ListCFList IrrCharSeries( const CFList &PS );19 ListCFList IrrCharSeries( const CFList &PS, int opt=0 ); 18 20 /*ENDPUBLIC*/ 19 21 -
libfac/charset/csutil.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: csutil.cc,v 1. 2 1997-06-09 15:55:54Singular Exp $";4 static char * rcsid = "$Id: csutil.cc,v 1.3 1997-09-12 07:19:41 Singular Exp $"; 5 5 ///////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 10 10 #include <Factor.h> 11 11 #include <SqrFree.h> 12 #include <helpstuff.h> 13 #include <homogfactor.h> 12 14 // Charset - Includes 13 15 #include "csutil.h" 14 16 15 17 static bool 16 lowerRank ( const CanonicalForm & f, const CanonicalForm & g )18 lowerRank ( const CanonicalForm & f, const CanonicalForm & g, int & ind ) 17 19 { 18 20 int df, dg; 19 21 Variable vf = f.mvar(), vg = g.mvar(); 20 22 21 if ( f.inCoeffDomain() ) return true;//( vg > vf ); 22 else 23 if ( g.inCoeffDomain() ) return false; 24 else 25 if ( vf < vg ) return true; 26 else 27 if ( vf == vg ) { 28 df = degree( f ); dg = degree( g ); 29 if ( df < dg ) return true; 30 else 31 if ( df == dg ) return lowerRank( LC( f ), LC( g ) ); 32 else return false; 33 } 23 if ( f.inCoeffDomain() ) { 24 if ( g.inCoeffDomain() ) ind= 1; 25 return true;//( vg > vf ); 26 } 27 else if ( g.inCoeffDomain() ) return false; 28 else if ( vf < vg ) return true; 29 else if ( vf == vg ) { 30 df = degree( f ); dg = degree( g ); 31 if ( df < dg ) return true; 32 else if ( df == dg ) return lowerRank( LC( f ), LC( g ) , ind); 33 else return false; 34 } 34 35 return false; 35 36 } … … 40 41 CFListIterator i = F; 41 42 CanonicalForm f; 43 int ind=0; 42 44 if ( ! i.hasItem() ) return f; 43 45 f = i.getItem(); ++i; 44 46 while ( i.hasItem() ) { 45 if ( lowerRank( i.getItem(), f ) ) f = i.getItem(); 47 //cout << "comparing " << f << " and " << i.getItem() 48 // << " == " << lowerRank( i.getItem(), f, ind ) << endl; 49 if ( lowerRank( i.getItem(), f, ind ) ) { 50 if ( ind ){ 51 CFList Itemlist= get_Terms(i.getItem()); 52 CFList Flist= get_Terms(f); 53 54 // Have to further compare number of terms! 55 //cout << "compare terms! f= " << Flist.length() << " item= " 56 // << Itemlist.length() <<endl; 57 if ( Itemlist.length() < Flist.length()) f = i.getItem(); 58 ind=0; 59 } 60 else{ 61 f = i.getItem(); 62 } 63 } 46 64 ++i; 47 65 } … … 85 103 CanonicalForm 86 104 Prem ( const CanonicalForm &f, const CanonicalForm &g ){ 87 CanonicalForm ff, gg, cg, l, test, lu, lv, t;105 CanonicalForm ff, gg, l, test, lu, lv, t, retvalue; 88 106 int df, dg; 89 107 bool reord; 90 108 Variable vf, vg, v; 91 109 92 110 if ( (vf = f.mvar()) < (vg = g.mvar()) ) return f; 93 111 else { … … 103 121 reord=true; 104 122 } 105 cg = LC( gg, v );106 123 dg = degree( gg, v ); 107 124 df = degree( ff, v ); … … 111 128 // cout << "Start gcd..." << endl; 112 129 test = gcd(l,LC(ff)); 113 // cout << "End gcd..."<< endl;130 //cout << "gcd(" << l << "," << LC(ff) << ")= " << test << endl; 114 131 lu = l/test; lv = LC(ff)/test; 115 132 t = power(v,df-dg) * gg * lv; … … 119 136 df = degree( ff, v ); 120 137 } 121 if ( reord ) return swapvar( ff, vg, v ); 122 else return ff; 123 } 138 if ( reord ) { 139 retvalue= swapvar( ff, vg, v ); 140 } 141 else { 142 retvalue= ff; 143 } 144 return retvalue; 145 } 146 } 147 148 static CanonicalForm 149 Sprem ( const CanonicalForm &f, const CanonicalForm &g, CanonicalForm & m, CanonicalForm & q ){ 150 CanonicalForm ff, gg, l, test, retvalue; 151 int df, dg,n; 152 bool reord; 153 Variable vf, vg, v; 154 155 if ( (vf = f.mvar()) < (vg = g.mvar()) ) { 156 m=CanonicalForm(0); q=CanonicalForm(0); 157 return f; 158 } 159 else { 160 if ( vf == vg ) { 161 ff = f; gg = g; 162 reord = false; 163 v = vg; // == x 164 } 165 else { 166 v = Variable(level(f.mvar()) + 1); 167 ff = swapvar(f,vg,v); // == r 168 gg = swapvar(g,vg,v); // == v 169 reord=true; 170 } 171 dg = degree( gg, v ); // == dv 172 df = degree( ff, v ); // == dr 173 if (dg <= df) {l=LC(gg); gg = gg -LC(gg)*power(v,dg);} 174 else { l = 1; } 175 n= 0; 176 while ( ( dg <= df ) && ( ff != ff.genZero()) ){ 177 test= power(v,df-dg) * gg * LC(ff); 178 if ( df == 0 ){ff= ff.genZero();} 179 else {ff= ff - LC(ff)*power(v,df);} 180 ff = l*ff-test; 181 df= degree(ff,v); 182 n++; 183 } 184 if ( reord ) { 185 retvalue= swapvar( ff, vg, v ); 186 } 187 else { 188 retvalue= ff; 189 } 190 m= power(l,n); 191 if ( divides(g,m*f-retvalue) ) 192 q= (m*f-retvalue)/g; 193 else { 194 q= CanonicalForm(0); 195 } 196 return retvalue; 197 } 198 } 199 200 CanonicalForm 201 divide( const CanonicalForm & ff, const CanonicalForm & f, const CFList & as){ 202 CanonicalForm r,m,q; 203 204 r= Sprem(ff,f,m,q); 205 //cout << "r= " << r << " , m= " << m << " , q= " << q << endl; 206 r= Prem(q,as); 207 //cout << "r= " << r << endl; 208 return r; 209 } 210 211 static CanonicalForm 212 myfitting( const CanonicalForm &f ){ 213 CanonicalForm rem=f; 214 215 if ( rem!=0 ){ 216 if ( getCharacteristic() > 0 ) 217 return num((rem/lc(rem))); 218 else{ 219 On(SW_RATIONAL); 220 CanonicalForm temp= mapinto(rem); 221 // cout << "temp= " << temp << endl; 222 // cout << "lc(temp)= " << lc(temp) << endl; 223 // cout << "temp/lc(temp)= " << temp/lc(temp) << endl; 224 // cout << "num(rem/lc(rem))= " << num(rem/lc(rem)) << endl; 225 temp= common_den(temp/lc(temp))*(temp/lc(temp)); 226 Off(SW_RATIONAL); 227 rem= mapinto(temp); 228 return rem; 229 } 230 } 231 else 232 return rem; 124 233 } 125 234 … … 131 240 //cout << " PREM: Prem(" << rem << "," ; 132 241 rem = Prem( rem, i.getItem() ); 133 //cout << i.getItem() << ") = " << rem << endl; 134 } 135 if ( rem!=0 ) 136 return num(rem/lc(rem)); 137 else 138 return rem; 242 //cout << " PREM: Prem(" << rem << "," << i.getItem() << ") = " << rem << endl; 243 } 244 return myfitting(rem); 139 245 } 140 246 … … 142 248 Prem( const CFList &AS, const CFList &L ){ 143 249 CFList Output; 250 144 251 for ( CFListIterator i=AS; i.hasItem(); i++ ) 145 252 Output = Union(CFList(Prem(i.getItem(),L)), Output); 253 146 254 return Output; 255 } 256 257 static CanonicalForm 258 premasb( const CanonicalForm & f, const CFList & as){ 259 CanonicalForm remd=f; 260 CFList AS=as; 261 262 if ( as.length() > 1 ){ 263 AS.removeFirst(); // get rid of first elem 264 CanonicalForm elem; 265 while ( ! AS.isEmpty() ){ // thats true for at least the first iteration 266 elem= AS.getLast(); 267 remd= Prem(remd,elem); 268 AS.removeLast(); 269 } 270 } 271 CanonicalForm a,b; 272 if ( mydivremt(remd, as.getFirst(), a,b )){ remd= remd.genZero();} 273 else { remd= Prem(remd, as.getFirst()); } 274 275 return remd; 276 } 277 278 CFList 279 remsetb( const CFList & ps, const CFList & as){ 280 CFList output; 281 CanonicalForm elem; 282 for (CFListIterator i=ps; i.hasItem(); i++){ 283 elem= premasb(i.getItem(),as); 284 if ( elem != elem.genZero() ) output.append(elem); 285 } 286 return output; 147 287 } 148 288 … … 208 348 testlist.append(CanonicalForm(Variable(J))); 209 349 } 350 351 // testlist = Union(Remembern.FS1, testlist); // add candidates 210 352 211 353 // remove already removed factors … … 213 355 testelem = j.getItem(); 214 356 while ( 1 ){ 215 test = divremt(r,testelem,a,b);357 test = mydivremt(r,testelem,a,b); 216 358 if ( test && b == r.genZero() ) r = a; 217 359 else break; 218 360 } 219 361 } 220 362 221 363 // Let's look if we have other canditates to remove 222 364 for ( j = testlist ; j.hasItem(); j++ ){ 223 365 testelem = j.getItem(); 366 // if ( testelem != r && testelem != r.mvar() ){ 224 367 if ( testelem != r ){ 225 368 while ( 1 ){ 226 369 test = divremt(r,testelem,a,b); 227 test = divremt(r,testelem,a,b);228 if ( test && b == r.genZero() ) r = a;229 370 if ( test && b == r.genZero() ){ 230 231 232 371 Remembern.FS2= Union(Remembern.FS2, CFList(testelem)); 372 r = a; 373 if ( r == 1 ) break; 233 374 } 234 375 else break; … … 236 377 } 237 378 } 379 // cout << "Remembern.FS1 = " << Remembern.FS1 << endl; 380 // cout << "Remembern.FS2 = " << Remembern.FS2 << endl; 381 // Remembern.FS1 = Difference(Remembern.FS1, Remembern.FS2); 382 // cout << " New Remembern.FS1 = " << Remembern.FS1 << endl; 238 383 } 239 384 … … 253 398 elem = j.getItem().factor(); 254 399 if ( getNumVars(elem) > 0 ) 255 qs= Union(qs, CFList( num(elem/lc(elem))));400 qs= Union(qs, CFList(myfitting(elem))); 256 401 } 257 402 } … … 267 412 else { 268 413 leadcoeff = LC(f,lvar(f)); 269 if ( leadcoeff != 0 )270 returnnum(leadcoeff/lc(leadcoeff));271 else return leadcoeff;414 // if ( leadcoeff != 0 ) 415 return myfitting(leadcoeff); //num(leadcoeff/lc(leadcoeff)); 416 // else return leadcoeff; 272 417 } 273 418 } … … 352 497 //CF pfactor( ..... ) 353 498 354 // ////////////////////////////////////////355 // for IrrCharSeries499 // ////////////////////////////////////////// 500 // // for IrrCharSeries 356 501 357 502 #ifdef IRRCHARSERIESDEBUG -
libfac/charset/csutil.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: csutil.h,v 1. 2 1997-06-09 15:55:55Singular Exp $4 // $Id: csutil.h,v 1.3 1997-09-12 07:19:42 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 … … 54 54 CFList Prem( const CFList &AS, const CFList &L ); 55 55 /*ENDPUBLIC*/ 56 CanonicalForm divide( const CanonicalForm & ff, const CanonicalForm & f, const CFList & as); 57 CFList remsetb( const CFList & ps, const CFList & as); 56 58 CanonicalForm lowestRank( const CFList & F ); 57 59 … … 64 66 int irreducible( const CFList & AS); 65 67 CFList select( const ListCFList & PS); 66 void select( const ListCFList & ppi, int length, ListCFList & ppi1, ListCFList & ppi2); 67 bool same( const CFList &A, const CFList &B ); 68 bool member( const CFList & cs, const ListCFList & pi ); 68 void select( const ListCFList & ppi, int length, ListCFList & ppi1, 69 ListCFList & ppi2); 70 bool same( const CFList &A, const CFList &B ); 71 bool member( const CFList & cs, const ListCFList & pi ); 69 72 bool subset( const CFList &PS, const CFList &CS ); 70 ListCFList MyUnion( const ListCFList & a, const ListCFList &b );71 ListCFList MyDifference( const ListCFList & a, const CFList &b);72 ListCFList Minus( const ListCFList & a, const ListCFList &b);73 ListCFList MyUnion( const ListCFList & a, const ListCFList &b ); 74 ListCFList MyDifference( const ListCFList & a, const CFList &b); 75 ListCFList Minus( const ListCFList & a, const ListCFList &b); 73 76 #endif /* INCL_CSUTIL_H */ 74 77 -
libfac/charset/debug.cc
r0479e09 r4a81ec 1 1 /* Copyright 1997 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: debug.cc,v 1. 1.1.1 1997-09-11 10:58:22Singular Exp $ ";3 // static char * rcsid = "$Id: debug.cc,v 1.2 1997-09-12 07:19:43 Singular Exp $ "; 4 4 //////////////////////////////////////////////////////////// 5 5 static int deb_level; -
libfac/charset/reorder.cc
r0479e09 r4a81ec 12 12 ///////////////////////////////////////////////////////////// 13 13 // emacs edit mode for this file is -*- C++ -*- 14 static char * rcsid = "$Id: reorder.cc,v 1. 2 1997-06-09 15:55:56Singular Exp $";14 static char * rcsid = "$Id: reorder.cc,v 1.3 1997-09-12 07:19:44 Singular Exp $"; 15 15 //////////////////////////////////////////////////////////// 16 16 // FACTORY - Includes … … 18 18 // Factor - Includes 19 19 #include <tmpl_inst.h> 20 #include "homogfactor.h" 20 21 // Charset - Includes 21 #include "homogfactor.h" 22 23 // some CC's need this: 24 #include "reorder.h" 22 25 23 26 #ifdef REORDERDEBUG … … 349 352 } 350 353 354 static CFFList 355 swapvar( const CFFList & PS, const Variable & x, const Variable & y){ 356 CFFList ps; 357 358 for (CFFListIterator i= PS; i.hasItem(); i++) 359 ps.append(CFFactor(swapvar(i.getItem().factor(),x,y),i.getItem().exp())); 360 return ps; 361 } 362 351 363 // a library function: we reorganize the global variable ordering 352 364 CFList … … 368 380 } 369 381 382 CFFList 383 reorder( const Varlist & betterorder, const CFFList & PS){ 384 int i=1, n = betterorder.length(); 385 Intarray v(1,n); 386 CFFList ps=PS; 387 388 //initalize: 389 for (VarlistIterator j = betterorder; j.hasItem(); j++){ 390 v[i]= level(j.getItem()); i++; 391 } 392 DEBOUTLN(cout, "reorder: Original ps= ", ps); 393 // reorder: 394 for (i=1; i <= n; i++) 395 ps=swapvar(ps,Variable(v[i]),Variable(n+i)); 396 DEBOUTLN(cout, "reorder: Reorganized ps= ", ps); 397 return ps; 398 } 399 370 400 ListCFList 371 401 reorder(const Varlist & betterorder, const ListCFList & Q){ -
libfac/charset/reorder.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: reorder.h,v 1. 2 1997-06-09 15:55:56Singular Exp $4 // $Id: reorder.h,v 1.3 1997-09-12 07:19:45 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 #ifndef INCL_REORDER_H … … 38 38 // 39 39 CFList reorder( const Varlist & betterorder, const CFList & PS); 40 CFFList reorder( const Varlist & betterorder, const CFFList & PS); 40 41 ListCFList reorder(const Varlist & betterorder, const ListCFList & Q); 41 42 /*ENDPUBLIC*/
Note: See TracChangeset
for help on using the changeset viewer.