Changeset 4c7d73 in git
- Timestamp:
- May 4, 2005, 5:25:46 PM (18 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 28543b21d1a59aaa89526434e42b6376b8886667
- Parents:
- 50c4143c24b16b5b07afa95f93b9bb62cd380180
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile.in
r50c414 r4c7d73 107 107 timer.cc weight.cc \ 108 108 GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc \ 109 mod_raw.cc sing_win.cc \109 mod_raw.cc sing_win.cc walkProc.cc walkMain.cc walkSupport.cc\ 110 110 eigenval.cc units.cc kbuckets.cc sbuckets.cc\ 111 111 mpr_inout.cc mpr_base.cc mpr_numeric.cc \ … … 150 150 ring.h timer.h dError.h fast_maps.h \ 151 151 febase.h shortfl.h mpr_complex.h mpr_global.h \ 152 gring.h \152 gring.h walkProc.h walkMain.h walkSupport.h\ 153 153 ffields.h khstd.h sparsmat.h gnumpfl.h gnumpc.h \ 154 154 fglm.h kstd1.h modulop.h sing_dbm.h weight.h \ -
kernel/mod_raw.cc
r50c414 r4c7d73 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mod_raw.cc,v 1. 2 2004-08-13 10:40:53Singular Exp $ */4 /* $Id: mod_raw.cc,v 1.3 2005-05-04 15:25:45 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: machine depend code for dynamic modules … … 9 9 * dynl_sym() 10 10 * dynl_error() 11 * d unl_close()11 * dynl_close() 12 12 */ 13 13 -
kernel/ring.cc
r50c414 r4c7d73 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.3 6 2005-05-04 14:13:16Singular Exp $ */4 /* $Id: ring.cc,v 1.37 2005-05-04 15:25:45 Singular Exp $ */ 5 5 6 6 /* … … 294 294 ||(r->order[l] == ringorder_M) 295 295 ||(r->order[l] == ringorder_a) 296 ||(r->order[l] == ringorder_a64) 296 297 ||(r->order[l] == ringorder_aa)) 297 298 { … … 319 320 for (i = 0; i<=r->block1[l]-r->block0[l]; i++) 320 321 { 321 Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j); 322 if (r->order[l] == ringorder_a64) 323 { int64 *w=(int64 *)r->wvhdl[l]; 324 Print("%*lld " ,nlen,w[i+j],i+j); 325 } 326 else 327 Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j); 322 328 } 323 329 if (r->order[l]!=ringorder_M) break; … … 473 479 { 474 480 char c=','; 475 for (i = 0; i<r->block1[l]-r->block0[l]; i++)481 if(r->order[l]==ringorder_a64) 476 482 { 477 StringAppend("%d," ,r->wvhdl[l][i+j]); 483 int64 * w=(int64 *)r->wvhdl[l]; 484 for (i = 0; i<r->block1[l]-r->block0[l]; i++) 485 { 486 StringAppend("%lld," ,w[i]); 487 } 488 StringAppend("%lld)" ,w[i]); 489 break; 490 } 491 else 492 { 493 for (i = 0; i<r->block1[l]-r->block0[l]; i++) 494 { 495 StringAppend("%d," ,r->wvhdl[l][i+j]); 496 } 478 497 } 479 498 if (r->order[l]!=ringorder_M) … … 1280 1299 * DOES NOT CALL rComplete 1281 1300 */ 1282 static ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE, 1283 BOOLEAN copy_ordering = TRUE) 1301 ring rCopy0(ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering) 1284 1302 { 1285 1303 if (r == NULL) return NULL; … … 1630 1648 case ringorder_M: 1631 1649 return 2; /*don't know*/ 1650 case ringorder_a64: /* assume: all weight are non-negative!*/ 1632 1651 case ringorder_lp: 1633 1652 case ringorder_rp: … … 1825 1844 } 1826 1845 } 1846 } 1847 1848 static void rO_WDegree64(int &place, int &bitplace, int start, int end, 1849 long *o, sro_ord &ord_struct, int64 *weights) 1850 { 1851 // weighted degree (aligned) of variables v_start..v_end, ordsgn 1, 1852 // reserved 2 places 1853 rO_Align(place,bitplace); 1854 ord_struct.ord_typ=ro_wp64; 1855 ord_struct.data.wp64.start=start; 1856 ord_struct.data.wp64.end=end; 1857 ord_struct.data.wp64.place=place; 1858 ord_struct.data.wp64.weights64=weights; 1859 o[place]=1; 1860 place++; 1861 o[place]=1; 1862 place++; 1863 rO_Align(place,bitplace); 1864 int i; 1827 1865 } 1828 1866 … … 2402 2440 case ringorder_a: 2403 2441 case ringorder_aa: 2442 case ringorder_a64: 2404 2443 if (r->OrdSgn==-1) r->MixedOrder=TRUE; 2405 2444 break; … … 2441 2480 r->firstBlockEnds=block1[i]; 2442 2481 r->firstwv = wvhdl[i]; 2443 if ((order[i]== ringorder_ws) || (order[i]==ringorder_Ws)) 2482 if ((order[i]== ringorder_ws) || (order[i]==ringorder_Ws) 2483 || (order[i]== ringorder_wp) || (order[i]==ringorder_Wp) 2484 || (order[i]== ringorder_a) /*|| (order[i]==ringorder_A)*/) 2444 2485 { 2445 2486 int j; 2446 2487 for(j=block1[i]-r->block0[i];j>=0;j--) 2447 if (r->firstwv[j]<0) { r->MixedOrder=TRUE; break; } 2488 { 2489 if (r->firstwv[j]<0) r->MixedOrder=TRUE; 2490 if (r->firstwv[j]==0) r->LexOrder=TRUE; 2491 } 2492 } 2493 else if (order[i]==ringorder_a64) 2494 { 2495 int j; 2496 int64 *w=rGetWeightVec(r); 2497 for(j=block1[i]-r->block0[i];j>=0;j--) 2498 { 2499 if (w[j]==0) r->LexOrder=TRUE; 2500 } 2448 2501 } 2449 2502 } … … 2679 2732 break; 2680 2733 2734 case ringorder_a64: 2735 rO_WDegree64(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn, 2736 tmp_typ[typ_i], (int64 *)(r->wvhdl[i])); 2737 typ_i++; 2738 break; 2739 2681 2740 case ringorder_c: 2682 2741 rO_Align(j, j_bits); … … 3102 3161 return; 3103 3162 } 3104 char *TYP[]={"ro_dp","ro_wp","ro_wp _neg","ro_cp",3163 char *TYP[]={"ro_dp","ro_wp","ro_wp64","ro_wp_neg","ro_cp", 3105 3164 "ro_syzcomp", "ro_syz", "ro_none"}; 3106 3165 int i,j; … … 3139 3198 Print(" %d",r->typ[j].data.wp.weights[l-r->typ[j].data.wp.start]); 3140 3199 } 3200 else if (r->typ[j].ord_typ==ro_wp64) 3201 { 3202 Print(" w64:"); 3203 int l; 3204 for(l=r->typ[j].data.wp64.start;l<=r->typ[j].data.wp64.end;l++) 3205 Print(" %l",(long)(((int64*)r->typ[j].data.wp64.weights64)+l-r->typ[j].data.wp64.start)); 3206 } 3141 3207 } 3142 3208 PrintLn(); … … 3555 3621 } 3556 3622 3557 int * rGetWeightVec(ring r)3623 int64 * rGetWeightVec(ring r) 3558 3624 { 3559 3625 assume(r!=NULL); 3560 3626 assume(r->OrdSize>0); 3561 assume(r->typ[0].ord_typ==ro_wp); 3562 return (r->typ[0].data.wp.weights); 3563 } 3564 3565 void rSetWeightVec(ring r, int *wv) 3627 int i=0; 3628 while((r->typ[i].ord_typ!=ro_wp64) && (r->typ[i].ord_typ>0)) i++; 3629 assume(r->typ[i].ord_typ==ro_wp64); 3630 return (int64*)(r->typ[i].data.wp64.weights64); 3631 } 3632 3633 void rSetWeightVec(ring r, int64 *wv) 3566 3634 { 3567 3635 assume(r!=NULL); 3568 3636 assume(r->OrdSize>0); 3569 assume(r->typ[0].ord_typ==ro_wp );3570 memcpy(r->typ[0].data.wp .weights,wv,r->N*sizeof(int));3637 assume(r->typ[0].ord_typ==ro_wp64); 3638 memcpy(r->typ[0].data.wp64.weights64,wv,r->N*sizeof(int64)); 3571 3639 } 3572 3640 … … 3960 4028 return FALSE; 3961 4029 } 4030 4031 void rModify_a_to_A(ring r) 4032 // to be called BEFORE rComplete: 4033 // changes every Block with a(...) to A(...) 4034 { 4035 int i=0; 4036 int j; 4037 while(r->order[i]!=0) 4038 { 4039 if (r->order[i]==ringorder_a) 4040 { 4041 r->order[i]=ringorder_a64; 4042 int *w=r->wvhdl[i]; 4043 int64 *w64=(int64 *)omAlloc((r->block1[i]-r->block0[i]+1)*sizeof(int64)); 4044 for(j=r->block1[i]-r->block0[i];j>=0;j--) 4045 w64[j]=(int64)w[j]; 4046 r->wvhdl[i]=(int*)w64; 4047 omFreeSize(w,(r->block1[i]-r->block0[i]+1)*sizeof(int)); 4048 } 4049 i++; 4050 } 4051 } -
kernel/ring.h
r50c414 r4c7d73 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1. 9 2005-05-04 14:13:17Singular Exp $ */9 /* $Id: ring.h,v 1.10 2005-05-04 15:25:46 Singular Exp $ */ 10 10 11 11 /* includes */ … … 28 28 void rKill(ring r); 29 29 ring rCopy(ring r); 30 ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE); 30 31 ring rOpposite(ring r); 31 32 ring rEnvelope(ring r); 33 32 34 33 35 … … 272 274 // construct Wp, C ring 273 275 ring rModifyRing_Wp(ring r, int* weights); 276 void rModify_a_to_A(ring r); 274 277 275 278 void rKillModifiedRing(ring r); … … 283 286 void pDebugPrint(poly p); 284 287 285 int * rGetWeightVec(ring r);286 void rSetWeightVec(ring r, int *);288 int64 * rGetWeightVec(ring r); 289 void rSetWeightVec(ring r, int64 *wv); 287 290 288 291 lists rDecompose(const ring r);
Note: See TracChangeset
for help on using the changeset viewer.