Changeset 7194f62 in git
- Timestamp:
- Nov 24, 2002, 9:25:18 PM (21 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- fdd985e9b4554ba4958ac4b242be22749004eee6
- Parents:
- b4811b1ced1a22725340d8ef634a070237d45dc3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/tgb.cc
rb4811b r7194f62 1 #include "mod2.h" 2 #include <omalloc.h> 3 #include "p_polys.h" 4 //#include "prCopy.h" 5 #include "ideals.h" 6 #include "ring.h" 7 #include "febase.h" 8 #include "structs.h" 9 #include "polys.h" 10 #include "stdlib.h" 11 12 13 #include "kutil.h" 14 #include "kInline.cc" 15 #include "kstd1.h" 16 #include "kbuckets.h" 17 18 #define FULLREDUCTIONS 19 //#define HALFREDUCTIONS 20 #define HEAD_BIN 21 //#define HOMOGENEOUS_EXAMPLE 22 #define REDTAIL_S 23 #define PAR_N 5 24 //#define REDTAIL_PROT 25 //#define QUICK_SPOLY_TEST 26 //#define DIAGONAL_GOING 27 //#define RANDOM_WALK 28 struct int_pair_node{ 29 int_pair_node* next; 30 int a; 31 int b; 32 }; 1 #include "tgb.h" 33 2 BOOLEAN lenS_correct(kStrategy strat){ 34 3 int i; … … 41 10 } 42 11 43 void cleanS(kStrategy strat){12 static void cleanS(kStrategy strat){ 44 13 int i=0; 45 14 LObject P; … … 55 24 } 56 25 } 57 int bucket_guess(kBucket* bucket){26 static int bucket_guess(kBucket* bucket){ 58 27 int sum=0; 59 28 int i; … … 63 32 return sum; 64 33 } 65 struct redNF_inf{ 66 poly h; 67 LObject* P; 68 int_pair_node* pending; 69 int len_upper_bound; 70 int i; 71 int j; 72 BOOLEAN need_std_rep; 73 BOOLEAN is_free; 74 BOOLEAN started; 75 }; 34 76 35 77 36 #ifdef RANDOM_WALK … … 83 42 } 84 43 #endif 85 enum calc_state 86 { 87 UNCALCULATED, 88 HASTREP, 89 UNIMPORTANT, 90 SOONTREP 91 }; 92 struct calc_dat 93 { 94 int* rep; 95 char** states; 96 ideal S; 97 ring r; 98 int* lengths; 99 long* short_Exps; 100 kStrategy strat; 101 int** deg; 102 int* T_deg; 103 int* misses; 104 int_pair_node* soon_free; 105 redNF_inf* work_on; 106 #ifdef HEAD_BIN 107 struct omBin_s* HeadBin; 108 #endif 109 int max_misses; 110 int found_i; 111 int found_j; 112 int continue_i; 113 int continue_j; 114 int n; 115 int skipped_i; 116 int normal_forms; 117 int skipped_pairs; 118 int current_degree; 119 int misses_counter; 120 int misses_series; 121 int Rcounter; 122 }; 123 BOOLEAN find_next_pair(calc_dat* c); 124 void shorten_tails(calc_dat* c, poly monom); 125 void replace_pair(int & i, int & j, calc_dat* c); 126 void initial_data(calc_dat* c); 127 void add_to_basis(poly h, calc_dat* c); 128 void do_this_spoly_stuff(int i,int j,calc_dat* c); 129 ideal t_rep_gb(ring r,ideal arg_I); 130 BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, calc_dat* state); 131 int* make_connections(int from, poly bound, calc_dat* c); 132 int* make_connections(int from, int to, poly bound, calc_dat* c); 133 void now_t_rep(const int & arg_i, const int & arg_j, calc_dat* c); 134 void soon_t_rep(const int & arg_i, const int & arg_j, calc_dat* c); 135 int pLcmDeg(poly a, poly b); 136 int simple_posInS (kStrategy strat, poly p,int len); 137 void add_to_reductors(calc_dat* c, poly h, int len){ 44 45 static BOOLEAN is_empty(calc_dat* c){ 46 int i; 47 for(i=0;i<PAR_N;i++){ 48 if (!c->work_on[i].is_free) return FALSE; 49 } 50 return TRUE; 51 } 52 53 54 static void add_to_reductors(calc_dat* c, poly h, int len){ 138 55 int i=simple_posInS(c->strat,h,len); 139 56 … … 159 76 // } 160 77 } 161 BOOLEAN find_next_pair(calc_dat* c) 78 static void length_one_crit(calc_dat* c, int pos, int len) 79 { 80 if (len==1) 81 { 82 int i; 83 for ( i=0;i<pos;i++) 84 { 85 if (c->lengths[i]==1) 86 c->states[pos][i]=HASTREP; 87 } 88 for ( i=pos+1;i<c->n;i++){ 89 if (c->lengths[i]==1) 90 c->states[i][pos]=HASTREP; 91 } 92 shorten_tails(c,c->S->m[pos]); 93 } 94 } 95 static BOOLEAN find_next_pair(calc_dat* c) 162 96 { 163 97 int start_i,start_j,i,j; … … 249 183 return FALSE; 250 184 } 251 void move_forward_in_S(int old_pos, int new_pos,kStrategy strat)185 static void move_forward_in_S(int old_pos, int new_pos,kStrategy strat) 252 186 { 253 187 assume(old_pos>=new_pos); … … 276 210 //assume(lenS_correct(strat)); 277 211 } 278 void replace_pair(int & i, int & j, calc_dat* c)212 static void replace_pair(int & i, int & j, calc_dat* c) 279 213 { 280 214 c->soon_free=NULL; … … 399 333 return; 400 334 } 401 int* make_connections(int from, poly bound, calc_dat* c) 335 336 static void replace_pair(redNF_inf* inf, calc_dat* c) 337 { 338 inf->soon_free=NULL; 339 int & i=inf->i; 340 int & j=inf->j; 341 int curr_deg; 342 poly lm=pOne(); 343 344 pLcm(c->S->m[i], c->S->m[j], lm); 345 pSetm(lm); 346 int deciding_deg= pFDeg(lm); 347 int* i_con =make_connections(i,j,lm,c); 348 int z=0; 349 350 for (int n=0;((n<c->n) && (i_con[n]>=0));n++){ 351 if (i_con[n]==j){ 352 // curr_deg=pFDeg(lm); 353 // for(int z1=0;((z1<c->n) && (i_con[z1]>=0));z1++) 354 // for (int z2=z1+1;((z2<c->n)&&(i_con[z2]>=0));z2++) 355 // { 356 // pLcm(c->S->m[i_con[z1]], c->S->m[i_con[z2]], lm); 357 // pSetm(lm); 358 // if (pFDeg(lm)==curr_deg) 359 // now_t_rep(i_con[z1],i_con[z2],c); 360 // } 361 now_t_rep(i,j,c); 362 //hack 363 i=j; 364 omfree(i_con); 365 p_Delete(&lm,c->r); 366 return; 367 } 368 } 369 370 int* j_con =make_connections(j,lm,c); 371 i= i_con[0]; 372 j=j_con[0]; 373 if(c->n>1){ 374 if (i_con[1]>=0) 375 i=i_con[1]; 376 else { 377 if (j_con[1]>=0) 378 j=j_con[1]; 379 } 380 } 381 pLcm(c->S->m[i], c->S->m[j], lm); 382 pSetm(lm); 383 poly short_s; 384 curr_deg=pFDeg(lm); 385 int_pair_node* last=NULL; 386 387 for (int n=0;((n<c->n) && (j_con[n]>=0));n++){ 388 for (int m=0;((m<c->n) && (i_con[m]>=0));m++){ 389 pLcm(c->S->m[i_con[m]], c->S->m[j_con[n]], lm); 390 pSetm(lm); 391 if (pFDeg(lm)>=deciding_deg) 392 { 393 soon_t_rep(i_con[m],j_con[n],c); 394 int_pair_node* h= (int_pair_node*)omalloc(sizeof(int_pair_node)); 395 if (last!=NULL) 396 last->next=h; 397 else 398 inf->soon_free=h; 399 h->next=NULL; 400 h->a=i_con[m]; 401 h->b=j_con[n]; 402 last=h; 403 } 404 // if ((comp_deg<curr_deg) 405 // || 406 // ((comp_deg==curr_deg) && 407 short_s=ksCreateShortSpoly(c->S->m[i_con[m]],c->S->m[j_con[n]],c->r); 408 if (short_s==NULL) { 409 i=i_con[m]; 410 j=j_con[n]; 411 now_t_rep(i_con[m],j_con[n],c); 412 p_Delete(&lm,c->r); 413 omfree(i_con); 414 omfree(j_con); 415 416 return; 417 418 } 419 #ifdef QUICK_SPOLY_TEST 420 421 for (int dz=0;dz<=c->n;dz++){ 422 if (dz==c->n) { 423 //have found not head reducing pair 424 i=i_con[m]; 425 j=j_con[n]; 426 p_Delete(&short_s,c->r); 427 p_Delete(&lm,c->r); 428 omfree(i_con); 429 omfree(j_con); 430 431 return; 432 } 433 if (p_LmDivisibleBy(c->S->m[dz],short_s,c->r)) break; 434 } 435 #endif 436 int comp_deg(pFDeg(short_s)); 437 p_Delete(&short_s,c->r); 438 if ((comp_deg<curr_deg) 439 || 440 ((comp_deg==curr_deg) && 441 (c->misses[i]+c->misses[j] 442 <= 443 c->misses[i_con[m]]+c->misses[j_con[n]]))) 444 // if ((comp_deg<curr_deg) 445 // || 446 // ((comp_deg==curr_deg) && 447 // (c->lengths[i]+c->lengths[j] 448 // <= 449 // c->lengths[i_con[m]]+c->lengths[j_con[n]]))) 450 451 { 452 curr_deg=comp_deg; 453 i=i_con[m]; 454 j=j_con[n]; 455 } 456 } 457 } 458 p_Delete(&lm,c->r); 459 omfree(i_con); 460 omfree(j_con); 461 return; 462 } 463 static int* make_connections(int from, poly bound, calc_dat* c) 402 464 { 403 465 ideal I=c->S; … … 442 504 return connected; 443 505 } 444 int* make_connections(int from, int to, poly bound, calc_dat* c)506 static int* make_connections(int from, int to, poly bound, calc_dat* c) 445 507 { 446 508 ideal I=c->S; … … 548 610 } 549 611 #endif 550 int init_red_phase1(calc_dat* c, int i, int j){ 551 int counter; 552 for(counter=0;(counter<PAR_N)||(c->work_on[i].is_free);counter++){} 553 assume(counter<PAR_N); 554 555 int pos=counter; 612 static int init_red_phase1(calc_dat* c, int i, int j, int pos) 613 { 614 c->work_on[pos].soon_free=NULL; 556 615 c->work_on[pos].is_free=FALSE; 616 c->work_on[pos].started=FALSE; 557 617 c->work_on[pos].i=i; 558 618 c->work_on[pos].j=j; 619 c->work_on[pos].h=NULL; 559 620 return pos; 560 621 } 561 void init_red_spoly_phase2(calc_dat* c,int pos){ 622 static void init_red_spoly_phase2(calc_dat* c,int pos){ 623 replace_pair(&c->work_on[pos],c); 624 if(c->work_on[pos].i==c->work_on[pos].j){ 625 c->work_on[pos].is_free=TRUE; 626 c->work_on[pos].h=NULL; 627 return; 628 } 629 c->work_on[pos].started=TRUE; 562 630 poly h=ksOldCreateSpoly(c->S->m[c->work_on[pos].i], c->S->m[c->work_on[pos].j], NULL, c->r); 563 631 if (h==NULL){ 564 632 c->work_on[pos].is_free=TRUE; 633 c->work_on[pos].h=NULL; 565 634 return; 566 635 } … … 578 647 579 648 }; 580 void initial_data(calc_dat* c){649 static void initial_data(calc_dat* c){ 581 650 void* h; 582 651 int i,j; 652 c->last_index=-1; 583 653 c->work_on=(redNF_inf*) omalloc(PAR_N*sizeof(redNF_inf)); 584 654 int counter; 585 655 for(counter=0;counter<PAR_N;counter++){ 586 656 c->work_on[counter].is_free=TRUE; 657 c->work_on[counter].P=NULL; 587 658 } 588 659 c->misses_series=0; … … 690 761 /* initS end */ 691 762 } 692 int simple_posInS (kStrategy strat, poly p,int len)763 static int simple_posInS (kStrategy strat, poly p,int len) 693 764 { 694 765 if(strat->sl==-1) return 0; … … 737 808 // assume(lenS_correct(strat)); 738 809 } 739 void add_to_basis(poly h, int i_pos, int j_pos,calc_dat* c)810 static void add_to_basis(poly h, int i_pos, int j_pos,calc_dat* c) 740 811 { 741 812 // BOOLEAN corr=lenS_correct(c->strat); … … 1094 1165 } 1095 1166 } 1167 1168 1169 1170 1171 1172 1173 static BOOLEAN redNF2_n_steps (redNF_inf* obj,calc_dat* c, int n) 1174 { 1175 1176 poly h; 1177 if (obj->is_free){ 1178 return TRUE;} 1179 int len; 1180 int j; 1181 kStrategy strat=c->strat; 1182 if (0 > strat->sl) 1183 { 1184 1185 kBucketClear(obj->P->bucket,&(obj->P->p),&len); 1186 kBucketDestroy(&obj->P->bucket); 1187 pNormalize(obj->P->p); 1188 obj->h=obj->P->p; 1189 obj->is_free=TRUE; 1190 return TRUE; 1191 1192 } 1193 loop 1194 { 1195 if (n<=0){ 1196 1197 return FALSE; 1198 } 1199 int compare_bound; 1200 compare_bound=bucket_guess(obj->P->bucket); 1201 obj->len_upper_bound=min(compare_bound,obj->len_upper_bound); 1202 j=kFindDivisibleByInS(strat->S,strat->sevS,strat->sl,obj->P); 1203 if (j>=0) 1204 { 1205 poly sec_copy=NULL; 1206 1207 BOOLEAN must_expand=FALSE; 1208 BOOLEAN must_replace_in_basis=(obj->len_upper_bound<strat->lenS[j]);//first test 1209 if (must_replace_in_basis) 1210 { 1211 //second test 1212 if (pLmEqual(obj->P->p,strat->S[j])) 1213 { 1214 PrintS("b"); 1215 sec_copy=kBucketClear(obj->P->bucket); 1216 kBucketInit(obj->P->bucket,pCopy(sec_copy),pLength(sec_copy)); 1217 } 1218 else 1219 { 1220 must_replace_in_basis=FALSE; 1221 if ((obj->len_upper_bound==1) 1222 ||(obj->len_upper_bound==2) 1223 ||(obj->len_upper_bound<strat->lenS[j]/2)) 1224 { 1225 PrintS("e"); 1226 sec_copy=kBucketClear(obj->P->bucket); 1227 kBucketInit(obj->P->bucket,pCopy(sec_copy),pLength(sec_copy)); 1228 must_expand=TRUE; 1229 } 1230 } 1231 } 1232 1233 nNormalize(pGetCoeff(obj->P->p)); 1234 #ifdef KDEBUG 1235 if (TEST_OPT_DEBUG) 1236 { 1237 PrintS("red:"); 1238 wrp(h); 1239 PrintS(" with "); 1240 wrp(strat->S[j]); 1241 } 1242 #endif 1243 obj->len_upper_bound=obj->len_upper_bound+strat->lenS[j]-2; 1244 number coef=kBucketPolyRed(obj->P->bucket,strat->S[j], 1245 strat->lenS[j]/*pLength(strat->S[j])*/, 1246 strat->kNoether); 1247 nDelete(&coef); 1248 h = kBucketGetLm(obj->P->bucket); 1249 1250 if (must_replace_in_basis){ 1251 int pos_in_c=-1; 1252 poly p=strat->S[j]; 1253 int z; 1254 1255 int new_length=pLength(sec_copy); 1256 Print("%i",strat->lenS[j]-new_length); 1257 obj->len_upper_bound=new_length +strat->lenS[j]-2;//old entries length 1258 int new_pos=simple_posInS(c->strat,strat->S[j],new_length);//hack 1259 1260 // p=NULL; 1261 for (z=c->n;z;z--) 1262 { 1263 if(p==c->S->m[z-1]) 1264 { 1265 pos_in_c=z-1; 1266 break; 1267 } 1268 } 1269 if (z<=0){ 1270 //not in c->S 1271 //LEAVE 1272 deleteInS(j,c->strat); 1273 add_to_reductors(c,sec_copy,pLength(sec_copy)); 1274 } 1275 else { 1276 //shorten_tails may alter position (not the length, even not by recursion in GLOBAL case) 1277 strat->S[j]=sec_copy; 1278 c->strat->lenS[j]=new_length; 1279 pDelete(&p); 1280 1281 // replace_quietly(c,j,sec_copy); 1282 // have to do many additional things for consistency 1283 { 1284 int old_pos=j; 1285 new_pos=min(old_pos, new_pos); 1286 assume(new_pos<=old_pos); 1287 c->strat->lenS[old_pos]=new_length; 1288 int i=0; 1289 for(i=new_pos;i<old_pos;i++){ 1290 if (strat->lenS[i]<=new_length) 1291 new_pos++; 1292 else 1293 break; 1294 } 1295 if (new_pos<old_pos) 1296 move_forward_in_S(old_pos,new_pos,c->strat); 1297 1298 c->S->m[pos_in_c]=sec_copy; 1299 1300 c->lengths[pos_in_c]=new_length; 1301 length_one_crit(c,pos_in_c, new_length); 1302 1303 } 1304 } 1305 } 1306 if(must_expand){ 1307 1308 add_to_reductors(c,sec_copy,pLength(sec_copy)); 1309 } 1310 if (h==NULL) { 1311 obj->h=NULL; 1312 obj->is_free=TRUE; 1313 return TRUE; 1314 } 1315 obj->P->p=h; 1316 obj->P->t_p=NULL; 1317 obj->P->SetShortExpVector(); 1318 1319 } 1320 else 1321 { 1322 kBucketClear(obj->P->bucket,&(obj->P->p),&len); 1323 kBucketDestroy(&obj->P->bucket); 1324 pNormalize(obj->P->p); 1325 obj->h=obj->P->p; 1326 obj->is_free=TRUE; 1327 return TRUE; 1328 } 1329 n--; 1330 } 1331 } 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1096 1343 static poly redNF (poly h,kStrategy strat, int &len) 1097 1344 { … … 1154 1401 #endif 1155 1402 #ifdef REDTAIL_S 1156 poly redNFTail (poly h,const int sl,kStrategy strat, int len) 1403 1404 static poly redNFTail (poly h,const int sl,kStrategy strat, int len) 1157 1405 { 1158 1406 if (h==NULL) return NULL; … … 1253 1501 #endif 1254 1502 1255 void do_this_spoly_stuff(int i,int j,calc_dat* c){1503 static void do_this_spoly_stuff(int i,int j,calc_dat* c){ 1256 1504 poly f=c->S->m[i]; 1257 1505 poly g=c->S->m[j]; … … 1299 1547 } 1300 1548 } 1301 1549 //try to fill, return FALSE iff queue is empty 1550 static int find_next_empty(calc_dat* c){ 1551 int n; 1552 for(n=0;n<PAR_N;n++) 1553 if(c->work_on[n].is_free) 1554 break; 1555 return n; 1556 } 1557 static BOOLEAN fillup(calc_dat* c){ 1558 int n=find_next_empty(c); 1559 while (n<PAR_N) { 1560 if 1561 (find_next_pair(c)){ 1562 1563 init_red_phase1(c,c->found_i,c->found_j,n); 1564 } 1565 else { 1566 if (n==0) return (!is_empty(c)); 1567 return TRUE; 1568 } 1569 1570 n=find_next_empty(c); 1571 } 1572 return TRUE; 1573 } 1574 static void compute(calc_dat* c){ 1575 int i=(c->last_index+ 1)%PAR_N; 1576 int len; 1577 while(1){ 1578 if(!c->work_on[i].is_free){ 1579 if (!c->work_on[i].started) 1580 init_red_spoly_phase2(c,i); 1581 if (!c->work_on[i].is_free){ 1582 if(redNF2_n_steps(&(c->work_on[i]),c,50)){ 1583 int_pair_node* hf=c->work_on[i].soon_free; 1584 now_t_rep(c->work_on[i].i,c->work_on[i].j,c); 1585 while(hf!=NULL) 1586 { 1587 int_pair_node* s=hf; 1588 now_t_rep(hf->a,hf->b,c); 1589 1590 hf=hf->next; 1591 omfree(s); 1592 } 1593 c->work_on[i].soon_free=NULL; 1594 1595 c->work_on[i].is_free=TRUE; 1596 poly hr=c->work_on[i].h; 1597 len=pLength(hr); 1598 #ifdef FULLREDUCTIONS 1599 if (hr!=NULL) 1600 #ifdef REDTAIL_S 1601 hr = redNFTail(hr,c->strat->sl,c->strat,len); 1602 #else 1603 hr = redtailBba(hr,c->strat->sl,c->strat); 1604 #endif 1605 #endif 1606 1607 c->normal_forms++; 1608 1609 if (hr==NULL) 1610 { 1611 PrintS("-"); 1612 c->misses_counter++; 1613 c->misses[c->work_on[i].i]++; c->misses[c->work_on[i].j]++; 1614 c->misses_series++; 1615 } 1616 else 1617 { 1618 c->misses_series=0; 1619 #ifdef HEAD_BIN 1620 hr=p_MoveHead(hr,c->HeadBin); 1621 #endif 1622 add_to_basis(hr, c->work_on[i].i,c->work_on[i].j,c); 1623 1624 } 1625 } 1626 } 1627 else { 1628 int_pair_node* hf=c->work_on[i].soon_free; 1629 now_t_rep(c->work_on[i].i,c->work_on[i].j,c); 1630 while(hf!=NULL) 1631 { 1632 int_pair_node* s=hf; 1633 now_t_rep(hf->a,hf->b,c); 1634 1635 hf=hf->next; 1636 omfree(s); 1637 } 1638 c->work_on[i].soon_free=NULL; 1639 PrintS("-"); 1640 c->misses_counter++; 1641 c->misses[c->work_on[i].i]++; 1642 c->misses[c->work_on[i].j]++; 1643 c->misses_series++; 1644 } 1645 c->last_index=i; 1646 return; 1647 } 1648 1649 1650 1651 i++; 1652 i=i%PAR_N; 1653 } 1654 } 1302 1655 ideal t_rep_gb(ring r,ideal arg_I){ 1303 1656 ideal I_temp=idCopy(arg_I); //kInterRed(arg_I); … … 1308 1661 c->S=I; 1309 1662 initial_data(c); 1663 #if 0 1310 1664 while (find_next_pair(c)){ 1311 1665 int i,j; … … 1338 1692 1339 1693 } 1694 #endif 1695 while(fillup(c)){ 1696 compute(c); 1697 } 1340 1698 omfree(c->rep); 1341 1699 for(int z=0;z<c->n;z++){ … … 1348 1706 return(I); 1349 1707 } 1350 void now_t_rep(const int & arg_i, const int & arg_j, calc_dat* c){1708 static void now_t_rep(const int & arg_i, const int & arg_j, calc_dat* c){ 1351 1709 int i,j; 1352 1710 if (arg_i==arg_j){ … … 1362 1720 c->states[j][i]=HASTREP; 1363 1721 } 1364 void soon_t_rep(const int& arg_i, const int& arg_j, calc_dat* c)1722 static void soon_t_rep(const int& arg_i, const int& arg_j, calc_dat* c) 1365 1723 { 1366 1724 int i,j; … … 1379 1737 c->states[j][i]=SOONTREP; 1380 1738 } 1381 BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, calc_dat* state){1739 static BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, calc_dat* state){ 1382 1740 1383 1741 if (arg_i==arg_j) … … 1393 1751 } 1394 1752 } 1395 int pLcmDeg(poly a, poly b)1753 static int pLcmDeg(poly a, poly b) 1396 1754 { 1397 1755 int i; … … 1404 1762 1405 1763 } 1406 int pMinDeg3(poly f){1764 static int pMinDeg3(poly f){ 1407 1765 if (f==NULL){ 1408 1766 return(-1); … … 1427 1785 1428 1786 1429 void shorten_tails(calc_dat* c, poly monom)1787 static void shorten_tails(calc_dat* c, poly monom) 1430 1788 { 1431 1789 // BOOLEAN corr=lenS_correct(c->strat); … … 1480 1838 if (new_pos<old_pos) 1481 1839 move_forward_in_S(old_pos,new_pos,c->strat); 1482 if (c->lengths[i]==1) 1483 { 1484 1485 int j; 1486 for ( j=0;j<i;j++) 1487 { 1488 if (c->lengths[j]==1) 1489 c->states[i][j]=HASTREP; 1490 } 1491 for ( j=i+1;j<c->n;j++){ 1492 if (c->lengths[j]==1) 1493 c->states[j][i]=HASTREP; 1494 } 1495 shorten_tails(c,c->S->m[i]); 1496 } 1840 1841 length_one_crit(c,i,c->lengths[i]); 1497 1842 } 1498 1843
Note: See TracChangeset
for help on using the changeset viewer.