Changeset f3461d in git
- Timestamp:
- Feb 28, 2012, 8:11:33 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 9b1590d4c8e281abd068646c9d699284f9ea053a
- Parents:
- 986225e4b879695a1828864dc45519cbf8a0f681
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-28 20:11:33+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-05 17:42:53+01:00
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/mod_main.cc
r986225e rf3461d 30 30 #include "myNF.h" 31 31 32 extern BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p, const intvec * componentWeights);33 34 // extern void rSetISReference(const ideal F, const int rank, const int p, const intvec * componentWeights, const ring r);35 32 extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r); 36 33 // extern ring rCurrRingAssure_SyzComp(); … … 504 501 const int iLimit = r->typ[pos].data.is.limit; 505 502 const ideal F = r->typ[pos].data.is.F; 506 const intvec* componentWeights = r->typ[pos].data.is.componentWeights;507 503 ideal FF = id_Copy(F, r); 508 504 509 505 lists l=(lists)omAllocBin(slists_bin); 510 l->Init( 3);506 l->Init(2); 511 507 512 508 l->m[0].rtyp = INT_CMD; … … 529 525 l->m[1].data = reinterpret_cast<void *>(FF); 530 526 531 l->m[2].rtyp = INTVEC_CMD;532 533 if( componentWeights != NULL )534 l->m[2].data = reinterpret_cast<void *>(new intvec(componentWeights));535 else536 l->m[2].data = reinterpret_cast<void *>(new intvec());537 538 539 540 527 res->rtyp = LIST_CMD; // list of int/module 541 528 res->data = reinterpret_cast<void *>(l); … … 558 545 return TRUE; 559 546 } 560 561 intvec * componentWeights = (intvec *)atGet(h,"isHomog",INTVEC_CMD); // No copy!562 547 563 548 const ideal F = (ideal)h->Data(); ; // No copy! … … 592 577 593 578 // F & componentWeights belong to that ordering block of currRing now: 594 rSetISReference(r, F, rank, p , componentWeights); // F and componentWeightswill be copied!579 rSetISReference(r, F, rank, p); // F will be copied! 595 580 return FALSE; 596 581 } -
libpolys/polys/monomials/p_polys.cc
r986225e rf3461d 573 573 case ringorder_s: 574 574 case ringorder_aa: 575 case ringorder_IS: 575 576 break; 576 case ringorder_IS:577 {578 assume( b0 == b1 );579 assume( (-2 < b0) && (b0 < 2) ); // 0 => prefix! +/-1 => suffix!580 581 if( b0 != 0) // suffix?582 break;583 584 // only prefix adds the weight...585 586 if( (k = p_GetComp(p, r)) == 0 )587 break;588 589 const int ord_pos = rGetISPos(pIS++, r);590 591 const intvec* componentWeights = r->typ[ord_pos].data.is.componentWeights;592 593 if( componentWeights == NULL )594 break;595 596 const int limit = r->typ[ord_pos].data.is.limit;597 assume( limit >= 0 );598 599 if( k > limit )600 {601 k -= (limit + 1);602 assume( k >= 0 );603 604 assume( componentWeights != NULL );605 606 if( k < componentWeights->length() )607 j += (*componentWeights)[k]; // j += the weight of k^th-component608 #ifndef NDEBUG609 else610 Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, ord_pos);611 #endif612 }613 break;614 }615 577 case ringorder_a: 616 578 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) … … 630 592 return j; 631 593 } 632 633 634 /// compute the total monomial weight for the case of Induced ordering,635 /// where we already have weight for module components!636 /// It is only needed to be known by rOptimizeLDeg and rSetDegStuff637 long p_TotaldegreeIS(poly p, const ring r)638 {639 long s = p_Totaldegree(p, r);640 641 int k = p_GetComp(p, r) - 1;642 643 if ( (k > 0) && (r->typ!=NULL) )644 {645 int pIS = 0;646 for( int pos = 0; pos < r->OrdSize; pos++ )647 if( r->typ[pos].ord_typ == ro_is)648 {649 const intvec* componentWeights = r->typ[pos].data.is.componentWeights;650 651 if( componentWeights == NULL )652 continue;653 654 const int limit = r->typ[pos].data.is.limit;655 assume( limit >= 0 );656 657 658 if( k > limit )659 {660 k -= (limit + 1);661 assume( k >= 0 );662 663 assume( componentWeights != NULL );664 665 if( k < componentWeights->length() )666 s += (*componentWeights)[k]; // j += the weight of k^th-component667 #ifndef NDEBUG668 else669 Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, pos);670 #endif671 }672 673 pIS++;674 675 return s; // multiple ro_is blocks are not really supported at the moment...676 }677 }678 679 return s;680 }681 682 594 683 595 long p_DegW(poly p, const short *w, const ring R) -
libpolys/polys/monomials/ring.cc
r986225e rf3461d 2827 2827 F, // WILL BE COPIED! 2828 2828 r->typ[i].data.is.limit, 2829 j++, 2830 r->typ[i].data.is.componentWeights // WILL BE COPIED 2829 j++ 2831 2830 ) 2832 2831 ); … … 3316 3315 if( rGetISPos(0, r) != -1 ) // Are there Schreyer induced blocks? 3317 3316 { 3318 if( r->pFDeg == p_Totaldegree )3319 {3320 extern long p_TotaldegreeIS(poly p, const ring r);3321 r->pFDeg = p_TotaldegreeIS;3322 }3323 3317 #ifndef NDEBUG 3324 else 3325 assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree ); 3326 #endif 3327 3328 r->pLDeg = pLDeg1; 3318 assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree || r->pFDeg == p_Totaldegree); 3319 #endif 3320 3321 r->pLDeg = pLDeg1; // ? 3329 3322 } 3330 3323 … … 3859 3852 r->typ[i].data.is.F = NULL; // ? 3860 3853 3861 if( r->typ[i].data.is.componentWeights != NULL )3862 {3863 delete r->typ[i].data.is.componentWeights;3864 r->typ[i].data.is.componentWeights = NULL; // ?3865 }3866 3867 3854 if( r->typ[i].data.is.pVarOffset != NULL ) 3868 3855 { … … 4076 4063 4077 4064 Print(" limit %d",r->typ[j].data.is.limit); 4078 4065 #ifndef NDEBUG 4079 4066 //PrintS(" F: ");idShow(r->typ[j].data.is.F, r, r, 1); 4080 #endif 4081 4082 PrintS(", weights: "); 4083 4084 if( r->typ[j].data.is.componentWeights == NULL ) 4085 PrintS("NULL == [0,...,0]\n"); 4086 else 4087 { 4088 (r->typ[j].data.is.componentWeights)->show(); PrintLn(); 4089 } 4067 #endif 4068 4069 PrintLn(); 4090 4070 } 4091 4071 else if (r->typ[j].ord_typ==ro_am) … … 4181 4161 4182 4162 { 4183 extern long p_TotaldegreeIS(poly p, const ring r);4184 4185 4163 PrintLn(); 4186 4164 Print("pFDeg : "); … … 4190 4168 pFDeg_CASE(p_WTotaldegree); else 4191 4169 pFDeg_CASE(p_Deg); else 4192 pFDeg_CASE(p_TotaldegreeIS); else4193 4170 #undef pFDeg_CASE 4194 4171 Print("(%p)", (void*)(r->pFDeg)); // default case … … 4939 4916 4940 4917 /// Changes r by setting induced ordering parameters: limit and reference leading terms 4941 /// F belong to r, we will DO a copy! (same to componentWeights)4918 /// F belong to r, we will DO a copy! 4942 4919 /// We will use it AS IS! 4943 4920 /// returns true is everything was allright! 4944 BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p , const intvec * componentWeights)4921 BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p) 4945 4922 { 4946 4923 // Put the reference set F into the ring -ordering -recor 4947 4948 // TEST THAT THERE ARE DEGs!!!4949 // assume( componentWeights == NULL ); // ???4950 if( componentWeights != NULL )4951 {4952 // assure that the ring r has degrees!!!4953 // Add weights to degrees of F[i]4954 }4955 4924 4956 4925 if (r->typ==NULL) … … 4989 4958 4990 4959 r->typ[pos].data.is.F = FF; // F is owened by ring now! TODO: delete at the end! 4991 4992 if(r->typ[pos].data.is.componentWeights != NULL)4993 {4994 #if MYTEST4995 PrintS("Deleting old componentWeights: "); r->typ[pos].data.is.componentWeights->show(); PrintLn();4996 #endif4997 delete r->typ[pos].data.is.componentWeights;4998 r->typ[pos].data.is.componentWeights = NULL;4999 }5000 5001 5002 assume(r->typ[pos].data.is.componentWeights == NULL);5003 5004 if( componentWeights != NULL )5005 componentWeights = ivCopy(componentWeights); // componentWeights is owened by ring now! TODO: delete at the end!5006 5007 r->typ[pos].data.is.componentWeights = componentWeights;5008 4960 5009 4961 r->typ[pos].data.is.limit = i; // First induced component -
libpolys/polys/monomials/ring.h
r986225e rf3461d 165 165 // reference poly set?? // Should it be owned by ring?!!! 166 166 ideal F; // reference leading (module)-monomials set. owned by ring... 167 const intvec* componentWeights; // component weights! owned by ring...168 167 }; 169 168 … … 745 744 poly rGetVar(const int varIndex, const ring r); 746 745 747 BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0 , const intvec * componentWeights = NULL);746 BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0); 748 747 749 748 /// return the position of the p^th IS block order block in r->typ[]...
Note: See TracChangeset
for help on using the changeset viewer.