Changeset 91a72f in git
- Timestamp:
- Apr 13, 2011, 3:35:36 PM (13 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
- Children:
- 2e4757cb3bb4e3e260951de51923af15aff13d29
- Parents:
- 2e7dee867c4d33510424b140e95164e94fb8ef8b
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-04-13 15:35:36+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:12:31+01:00
- Location:
- libpolys/polys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/simpleideals.cc
r2e7dee r91a72f 403 403 404 404 #ifdef PDEBUG 405 void id DBTest(ideal h1, int level, const char *f,const int l)405 void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r) 406 406 { 407 407 int i; … … 414 414 /* to be able to test matrices: */ 415 415 for (i=(h1->ncols*h1->nrows)-1; i>=0; i--) 416 _p_Test(h1->m[i], currRing, level);417 int new_rk=id RankFreeModule(h1);416 _p_Test(h1->m[i], r, level); 417 int new_rk=id_RankFreeModule(h1,r); 418 418 if(new_rk > h1->rank) 419 419 { … … 437 437 if (nolex) 438 438 { 439 int r=p LmCmp(a,b);439 int r=p_LmCmp(a,b,r); 440 440 if (r!=0) return r; 441 number h=n Sub(pGetCoeff(a),pGetCoeff(b));442 r = -1+n IsZero(h)+2*nGreaterZero(h); /* -1: <, 0:==, 1: > */443 n Delete(&h);441 number h=n_Sub(pGetCoeff(a),pGetCoeff(b),r->cf); 442 r = -1+n_IsZero(h,r->cf)+2*n_GreaterZero(h,r->cf); /* -1: <, 0:==, 1: > */ 443 n_Delete(&h, r->cf); 444 444 return r; 445 445 } 446 446 int l=rVar(r); 447 while ((l>0) && (p GetExp(a,l)==pGetExp(b,l))) l--;447 while ((l>0) && (p_GetExp(a,l,r)==pGetExp(b,l,r))) l--; 448 448 if (l==0) 449 449 { 450 if (p GetComp(a)==pGetComp(b))451 { 452 number h=n Sub(pGetCoeff(a),pGetCoeff(b));453 int r = -1+n IsZero(h)+2*nGreaterZero(h); /* -1: <, 0:==, 1: > */454 n Delete(&h);450 if (p_GetComp(a,r)==p_GetComp(b,r)) 451 { 452 number h=n_Sub(pGetCoeff(a),pGetCoeff(b),r->cf); 453 int r = -1+n_IsZero(h,r->cf)+2*n_GreaterZero(h,r->cf); /* -1: <, 0:==, 1: > */ 454 n_Delete(&h,r->cf); 455 455 return r; 456 456 } 457 if (p GetComp(a)>pGetComp(b)) return 1;458 } 459 else if (p GetExp(a,l)>pGetExp(b,l))457 if (p_GetComp(a,r)>p_GetComp(b,r)) return 1; 458 } 459 else if (p_GetExp(a,l,r)>p_GetExp(b,l,r)) 460 460 return 1; 461 461 return -1; … … 466 466 *uses lex-ordering when nolex = FALSE 467 467 */ 468 intvec *id Sort(ideal id,BOOLEAN nolex)468 intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r) 469 469 { 470 470 poly p,q; … … 482 482 diff = (actpos+1) / 2; 483 483 diff = (diff+1) / 2; 484 lastcomp = p Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex);484 lastcomp = p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r); 485 485 if (lastcomp<0) 486 486 { … … 498 498 while (notFound && (newpos>=0) && (newpos<actpos)) 499 499 { 500 newcomp = p Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex);500 newcomp = p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r); 501 501 olddiff = diff; 502 502 if (diff>1) … … 545 545 if (newpos<0) newpos = 0; 546 546 if (newpos>actpos) newpos = actpos; 547 while ((newpos<actpos) && (p Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex)==0))547 while ((newpos<actpos) && (p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r)==0)) 548 548 newpos++; 549 549 for (j=actpos;j>newpos;j--) -
libpolys/polys/simpleideals.h
r2e7dee r91a72f 71 71 #endif 72 72 73 ideal id_Copy (ideal h1,const ring r);74 73 #ifdef PDEBUG 75 74 ideal id_DBCopy(ideal h1,const char *f,int l, const ring r); 76 75 #define id_Copy(A,R) id_DBCopy(A,__FILE__,__LINE__,R) 76 #else 77 ideal id_Copy (ideal h1,const ring r); 77 78 #endif 78 79 /*adds two ideals without simplifying the result*/ … … 99 100 void id_DelDiv(ideal id, const ring r); 100 101 BOOLEAN id_IsConstant(ideal id, const ring r); 102 intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r); 101 103 102 104 #endif
Note: See TracChangeset
for help on using the changeset viewer.