Changeset 74f51f in git
- Timestamp:
- Feb 21, 2012, 8:54:54 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 1114d2198efcbc84280b79e6a5090dda2ebf9f0e
- Parents:
- e4f491963f9660b7e75c9817b20efcc8c5fae6fa
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-21 20:54:54+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-23 20:35:11+01:00
- Location:
- libpolys/polys/monomials
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.cc
re4f491 r74f51f 461 461 { 462 462 p_LmCheckPolyRing(a, r); 463 assume(p_GetOrder(a, r) == p_WTotaldegree(a, r)); 463 // assume(p_GetOrder(a, r) == p_WTotaldegree(a, r)); // WRONG assume! 464 464 return p_GetOrder(a, r); 465 465 } … … 488 488 p_LmCheckPolyRing(p, r); 489 489 int i, k; 490 int pIS = 0; 490 491 long j =0; 491 492 … … 540 541 case ringorder_S: 541 542 case ringorder_s: 542 case ringorder_IS:543 543 case ringorder_aa: 544 544 break; 545 case ringorder_IS: 546 { 547 assume( b0 == b1 ); 548 assume( (-2 < b0) && (b0 < 2) ); // 0 => prefix! +/-1 => suffix! 549 550 if( b0 != 0) // suffix? 551 break; 552 553 // only prefix adds the weight... 554 555 if( (k = p_GetComp(p, r)) == 0 ) 556 break; 557 558 const int ord_pos = rGetISPos(pIS++, r); 559 560 const intvec* componentWeights = r->typ[ord_pos].data.is.componentWeights; 561 562 if( componentWeights == NULL ) 563 break; 564 565 const int limit = r->typ[ord_pos].data.is.limit; 566 assume( limit >= 0 ); 567 568 if( k > limit ) 569 { 570 k -= (limit + 1); 571 assume( k >= 0 ); 572 573 assume( componentWeights != NULL ); 574 575 if( k < componentWeights->length() ) 576 j += (*componentWeights)[k]; // j += the weight of k^th-component 577 #ifndef NDEBUG 578 else 579 Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, ord_pos); 580 #endif 581 } 582 break; 583 } 545 584 case ringorder_a: 546 585 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) … … 560 599 return j; 561 600 } 601 602 603 /// compute the total monomial weight for the case of Induced ordering, 604 /// where we already have weight for module components! 605 /// It is only needed to be known by rOptimizeLDeg and rSetDegStuff 606 long p_TotaldegreeIS(poly p, const ring r) 607 { 608 long s = p_Totaldegree(p, r); 609 610 int k = p_GetComp(p, r) - 1; 611 612 if ( (k > 0) && (r->typ!=NULL) ) 613 { 614 int pIS = 0; 615 for( int pos = 0; pos < r->OrdSize; pos++ ) 616 if( r->typ[pos].ord_typ == ro_is) 617 { 618 const intvec* componentWeights = r->typ[pos].data.is.componentWeights; 619 620 if( componentWeights == NULL ) 621 continue; 622 623 const int limit = r->typ[pos].data.is.limit; 624 assume( limit >= 0 ); 625 626 627 if( k > limit ) 628 { 629 k -= (limit + 1); 630 assume( k >= 0 ); 631 632 assume( componentWeights != NULL ); 633 634 if( k < componentWeights->length() ) 635 s += (*componentWeights)[k]; // j += the weight of k^th-component 636 #ifndef NDEBUG 637 else 638 Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, pos); 639 #endif 640 } 641 642 pIS++; 643 644 return s; // multiple ro_is blocks are not really supported at the moment... 645 } 646 } 647 648 return s; 649 } 650 562 651 563 652 long p_DegW(poly p, const short *w, const ring R) -
libpolys/polys/monomials/p_polys.h
re4f491 r74f51f 21 21 #include <omalloc/omalloc.h> 22 22 #include <misc/mylimits.h> 23 #include <misc/intvec.h> 23 24 #include <coeffs/coeffs.h> 24 25 -
libpolys/polys/monomials/ring.cc
re4f491 r74f51f 1906 1906 { 1907 1907 sro_ord* o=&(r->typ[pos]); 1908 if ((o->ord_typ == ro_syzcomp) || (o->ord_typ == ro_syz) || (o->ord_typ == ro_is) || (o->ord_typ == ro_isTemp)) return TRUE; 1908 if ( (o->ord_typ == ro_syzcomp) 1909 || (o->ord_typ == ro_syz) 1910 || (o->ord_typ == ro_is) 1911 || (o->ord_typ == ro_isTemp)) 1912 return TRUE; 1909 1913 } 1910 1914 } … … 2047 2051 if(r->typ[j].data.is.pVarOffset[i] != -1) 2048 2052 { 2049 // ???2053 // TODO??? 2050 2054 } 2051 2055 … … 3059 3063 case ringorder_IS: 3060 3064 { // TODO: What is r->ComponentOrder??? 3061 r->MixedOrder=TRUE; 3062 /* 3063 if( r->block0[o] != 0 ) // Suffix has the comonent 3065 // r->MixedOrder=TRUE; 3066 if( r->block0[o] != 0 ) // Suffix has the component 3064 3067 r->ComponentOrder = r->block0[o]; 3065 else // Prefix has level...3068 /* else // Prefix has level... 3066 3069 r->ComponentOrder=-1; 3067 3070 */ 3071 // TODO: think about this a bit...!? 3068 3072 break; 3069 3073 } … … 3141 3145 int** wvhdl = r->wvhdl; 3142 3146 3147 3148 3143 3149 if (order[0]==ringorder_S ||order[0]==ringorder_s || order[0]==ringorder_IS) 3144 3150 { … … 3227 3233 3228 3234 /*the number of orderings:*/ 3229 int i = 0; 3230 while (order[++i] != 0); 3235 int i = 0; while (order[++i] != 0); 3236 3231 3237 do 3232 3238 { … … 3253 3259 r->pFDeg = p_Deg; 3254 3260 3261 if( rGetISPos(0, r) != -1 ) // Are there Schreyer induced blocks? 3262 { 3263 if( r->pFDeg == p_Totaldegree ) 3264 { 3265 extern long p_TotaldegreeIS(poly p, const ring r); 3266 r->pFDeg = p_TotaldegreeIS; 3267 } 3268 #ifndef NDEBUG 3269 else 3270 assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree ); 3271 #endif 3272 3273 r->pLDeg = pLDeg1; 3274 } 3275 3255 3276 r->pFDegOrig = r->pFDeg; 3277 // NOTE: this leads to wrong ecart during std 3278 // in Old/sre.tst 3256 3279 rOptimizeLDeg(r); // also sets r->pLDegOrig 3280 3257 3281 } 3258 3282 … … 3991 4015 3992 4016 if( r->typ[j].data.is.componentWeights == NULL ) 3993 PrintS("NULL == [0,... 0]\n");4017 PrintS("NULL == [0,...,0]\n"); 3994 4018 else 3995 4019 { … … 4073 4097 4074 4098 { 4099 extern long p_TotaldegreeIS(poly p, const ring r); 4100 4101 PrintLn(); 4102 Print("pFDeg : "); 4075 4103 #define pFDeg_CASE(A) if(r->pFDeg == A) PrintS( "" #A "" ) 4076 Print("\npFDeg : "); 4077 4078 pFDeg_CASE(p_Totaldegree); else 4104 pFDeg_CASE(p_Totaldegree); else 4079 4105 pFDeg_CASE(p_WFirstTotalDegree); else 4080 4106 pFDeg_CASE(p_WTotaldegree); else 4081 4107 pFDeg_CASE(p_Deg); else 4108 pFDeg_CASE(p_TotaldegreeIS); else 4109 #undef pFDeg_CASE 4110 4082 4111 Print("(%p)", (void*)(r->pFDeg)); // default case 4083 4112 4084 PrintS("\n"); 4085 #undef pFDeg_CASE 4113 PrintLn(); 4114 Print("pLDeg : (%p)", (void*)(r->pLDeg)); 4115 PrintLn(); 4086 4116 } 4087 4117 … … 4787 4817 /// Finds p^th IS ordering, and returns its position in r->typ[] 4788 4818 /// returns -1 if something went wrong! 4819 /// p - starts with 0! 4789 4820 int rGetISPos(const int p, const ring r) 4790 4821 { … … 4797 4828 if (r->typ==NULL) 4798 4829 { 4799 dReportError("'rIsIS:' Error: wrong ring! (typ == NULL)");4830 // dReportError("'rIsIS:' Error: wrong ring! (typ == NULL)"); 4800 4831 return -1; 4801 4832 } … … 4805 4836 if( r->typ[pos].ord_typ == ro_is) 4806 4837 if( j-- == 0 ) 4807 {4808 4838 return pos; 4809 }4810 4839 4811 4840 return -1; -
libpolys/polys/monomials/ring.h
re4f491 r74f51f 741 741 BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0, const intvec * componentWeights = NULL); 742 742 743 /// return the position of the p^th IS block order block in r->typ[]... 744 int rGetISPos(const int p, const ring r); 745 743 746 BOOLEAN rCheckIV(intvec *iv); 744 747 int rTypeOfMatrixOrder(intvec * order);
Note: See TracChangeset
for help on using the changeset viewer.