Changeset ab4778 in git
- Timestamp:
- Jul 5, 2007, 6:14:37 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- dbbae8ad9d24434738b0b3ea68b2b59f3601865d
- Parents:
- 87ca280121eddcc2c20db318c497a45145dd11ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/p_polys.cc
r87ca280 rab4778 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_polys.cc,v 1. 7 2007-07-05 10:00:10Singular Exp $9 * Version: $Id: p_polys.cc,v 1.8 2007-07-05 16:14:37 Singular Exp $ 10 10 *******************************************************************/ 11 11 … … 76 76 if (ord<ai) pSetm_error=TRUE; 77 77 } 78 #endif 78 #endif 79 79 p->exp[o->data.wp.place]=ord; 80 80 break; … … 82 82 case ro_wp64: 83 83 { 84 84 int64 ord=0; 85 85 int a,e; 86 86 a=o->data.wp64.start; … … 94 94 wi=w[i-a]; 95 95 ai=ei*wi; 96 if(ei!=0 && ai/ei!=wi){ 96 if(ei!=0 && ai/ei!=wi){ 97 97 pSetm_error=TRUE; 98 98 Print("ai %lld, wi %lld\n",ai,wi); … … 108 108 long a_1=(long)(ord >>31 ); /*(ord/(mask+1));*/ 109 109 110 111 112 110 //Print("mask: %x, ord: %d, a_0: %d, a_1: %d\n" 111 //,(int)mask,(int)ord,(int)a_0,(int)a_1); 112 //Print("mask: %d",mask); 113 113 114 114 p->exp[o->data.wp64.place]=a_1; 115 115 p->exp[o->data.wp64.place+1]=a_0; 116 116 // if(p_Setm_error) Print("***************************\n 117 117 // ***************************\n … … 134 134 int c=p_GetComp(p,r); 135 135 long sc = c; 136 int* Components = (_ExternalComponents ? _Components : 136 int* Components = (_ExternalComponents ? _Components : 137 137 o->data.syzcomp.Components); 138 long* ShiftedComponents = (_ExternalComponents ? _ShiftedComponents: 138 long* ShiftedComponents = (_ExternalComponents ? _ShiftedComponents: 139 139 o->data.syzcomp.ShiftedComponents); 140 140 if (ShiftedComponents != NULL) … … 203 203 p_SetmProc p_GetSetmProc(ring r) 204 204 { 205 // covers lp, rp, ls, 205 // covers lp, rp, ls, 206 206 if (r->typ == NULL) return p_Setm_Dummy; 207 207 208 208 if (r->OrdSize == 1) 209 209 { 210 if (r->typ[0].ord_typ == ro_dp && 210 if (r->typ[0].ord_typ == ro_dp && 211 211 r->typ[0].data.dp.start == 1 && 212 212 r->typ[0].data.dp.end == r->N && 213 213 r->typ[0].data.dp.place == r->pOrdIndex) 214 214 return p_Setm_TotalDegree; 215 if (r->typ[0].ord_typ == ro_wp && 215 if (r->typ[0].ord_typ == ro_wp && 216 216 r->typ[0].data.wp.start == 1 && 217 217 r->typ[0].data.wp.end == r->N && … … 258 258 } 259 259 260 // pWTotalDegree for weighted orderings 260 // pWTotalDegree for weighted orderings 261 261 // whose first block covers all variables 262 262 inline long _pWFirstTotalDegree(poly p, ring r) … … 264 264 int i; 265 265 long sum = 0; 266 266 267 267 for (i=1; i<= r->firstBlockEnds; i++) 268 268 { … … 287 287 int i, k; 288 288 long j =0; 289 int factor;290 289 291 290 // iterate through each block: 292 291 for (i=0;r->order[i]!=0;i++) 293 292 { 294 factor=1; 293 int b0=r->block0[i]; 294 int b1=r->block1[i]; 295 295 switch(r->order[i]) 296 296 { 297 297 case ringorder_M: 298 factor=r->OrdSgn; 298 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) 299 { // in jedem block: 300 j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/]*r->OrdSgn; 301 } 302 break; 299 303 case ringorder_wp: 300 304 case ringorder_ws: 301 305 case ringorder_Wp: 302 306 case ringorder_Ws: 303 for (k= r->block0[i];k<=r->block1[i];k++)307 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) 304 308 { // in jedem block: 305 j+= p_GetExp(p,k,r)*r->wvhdl[i][k - r->block0[i]]*factor;309 j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/]; 306 310 } 307 311 break; … … 313 317 case ringorder_Ds: 314 318 case ringorder_rp: 315 for (k= r->block0[i];k<=r->block1[i];k++)319 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) 316 320 { 317 321 j+= p_GetExp(p,k,r); … … 321 325 { 322 326 int64* w=(int64*)r->wvhdl[i]; 323 for (k=0;k<=( r->block1[i] - r->block0[i]);k++)324 { 327 for (k=0;k<=(b1 /*r->block1[i]*/ - b0 /*r->block0[i]*/);k++) 328 { 325 329 //there should be added a line which checks if w[k]>2^31 326 330 j+= p_GetExp(p,k+1, r)*(long)w[k]; … … 336 340 break; 337 341 case ringorder_a: 338 for (k= r->block0[i];k<=r->block1[i];k++)342 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) 339 343 { // only one line 340 j+= p_GetExp(p,k, r)*r->wvhdl[i][ k- r->block0[i]];344 j+= p_GetExp(p,k, r)*r->wvhdl[i][ k- b0 /*r->block0[i]*/]; 341 345 } 342 346 //break; … … 430 434 if (! rIsSyzIndexRing(r)) 431 435 { 432 while (pNext(p) != NULL) 436 while (pNext(p) != NULL) 433 437 { 434 438 pIter(p); … … 758 762 ***************************************************************/ 759 763 760 static inline unsigned long 761 p_GetMaxExpL2(unsigned long l1, unsigned long l2, ring r, 764 static inline unsigned long 765 p_GetMaxExpL2(unsigned long l1, unsigned long l2, ring r, 762 766 unsigned long number_of_exp) 763 767 { … … 800 804 unsigned long l_p, l_max; 801 805 unsigned long divmask = r->divmask; 802 806 803 807 do 804 808 { … … 807 811 l_max = max->exp[offset]; 808 812 // do the divisibility trick to find out whether l has an exponent 809 if (l_p > l_max || 813 if (l_p > l_max || 810 814 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask))) 811 815 max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r); … … 817 821 l_max = max->exp[offset]; 818 822 // do the divisibility trick to find out whether l has an exponent 819 if (l_p > l_max || 823 if (l_p > l_max || 820 824 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask))) 821 825 max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r); … … 831 835 unsigned long l_p, divmask = r->divmask; 832 836 int i; 833 837 834 838 while (p != NULL) 835 839 { … … 842 846 l_p = p->exp[r->VarL_Offset[i]]; 843 847 // do the divisibility trick to find out whether l has an exponent 844 if (l_p > l_max || 848 if (l_p > l_max || 845 849 (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask))) 846 850 l_max = p_GetMaxExpL2(l_max, l_p, r); … … 853 857 854 858 855 859 856 860 /*************************************************************** 857 861 *
Note: See TracChangeset
for help on using the changeset viewer.