Changeset 66415e1 in git
- Timestamp:
- Apr 3, 1997, 2:16:50 PM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 4b6638742b286da99bbdce81bcde4c2346d3afed
- Parents:
- 32df8279c33f6455329b9db1f5fba50e3397497e
- Location:
- Singular
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/cntrlc.cc
r32df82 r66415e1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: cntrlc.cc,v 1. 5 1997-04-02 15:06:56Singular Exp $ */4 /* $Id: cntrlc.cc,v 1.6 1997-04-03 12:16:47 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - interupt handling … … 288 288 void sigint_handler(int sig) 289 289 { 290 siCntrlc ++; 291 if (siCntrlc>2) signal(SIGINT,(s_hdl_typ) sigsegv_handler); 292 else signal(SIGINT,(s_hdl_typ) sigint_handler); 290 mflush(); 291 loop 292 { 293 fputs("\nabort(a), continue(c) or quit(q) ?",stderr);fflush(stderr); 294 switch(fgetc(stdin)) 295 { 296 case 'q': 297 m2_end(2); 298 case 'c': 299 fgetc(stdin); 300 signal(SIGINT ,(s_hdl_typ)sigint_handler); 301 return; 302 case 'a': 303 siCntrlc ++; 304 if (siCntrlc>2) signal(SIGINT,(s_hdl_typ) sigsegv_handler); 305 else signal(SIGINT,(s_hdl_typ) sigint_handler); 306 } 307 } 293 308 } 294 309 #endif -
Singular/syz.h
r32df82 r66415e1 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: syz.h,v 1.3 1997-04-03 12:16:48 Singular Exp $ */ 6 7 /* 7 8 * ABSTRACT 8 9 */ 9 /* $Id: syz.h,v 1.2 1997-03-24 14:26:02 Singular Exp $ */10 10 #include "structs.h" 11 12 struct sSObject{ 13 poly p; 14 poly p1,p2; /*- the pair p comes from -*/ 15 poly lcm; /*- the lcm of p1,p2 -*/ 16 poly syz; /*- the syzygy associated to p1,p2 -*/ 17 int ind1,ind2; /*- the indeces of p1,p2 -*/ 18 int isNotMinimal; 19 int order; 20 }; 21 typedef struct sSObject SObject; 22 typedef SObject * SSet; 23 typedef SSet * SRes; 11 24 12 25 void sySchreyersSyzygiesM(polyset F,int Fmax,polyset* Shdl,int* Smax, … … 17 30 18 31 resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length, 19 BOOLEAN isMonomial=FALSE );32 BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE); 20 33 21 34 resolvente syResolvente(ideal arg, int maxlength, int * length, … … 33 46 BOOLEAN syTestOrder(ideal i); 34 47 48 void syReOrderResolventFB(resolvente res,int length, int initial=1); 49 50 resolvente syLaScala(ideal arg,int * length); 51 resolvente syLaScala1(ideal arg,int * length); 52 35 53 #endif -
Singular/syz0.cc
r32df82 r66415e1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz0.cc,v 1.3 1997-04-02 15:07:57 Singular Exp $ */ 5 4 /* $Id: syz0.cc,v 1.4 1997-04-03 12:16:50 Singular Exp $ */ 6 5 /* 7 6 * ABSTRACT: resolutions … … 121 120 } 122 121 122 inline BOOLEAN syDivisibleBy2(poly a, poly b) 123 { 124 //if (a->exp[0]==b->exp[0]) 125 { 126 int i=pVariables-1; 127 short *e1=&(a->exp[1]); 128 short *e2=&(b->exp[1]); 129 if ((*e1) > (*e2)) return FALSE; 130 do 131 { 132 i--; 133 e1++; 134 e2++; 135 if ((*e1) > (*e2)) return FALSE; 136 } while (i>0); 137 return TRUE; 138 } 139 //else 140 //{ 141 //Print("Fehler"); 142 //return FALSE; 143 //} 144 } 145 146 static poly syRedtail2(poly p, polyset redWith, intvec *modcomp) 147 { 148 poly h, hn; 149 int hncomp,nxt; 150 int j; 151 152 h = p; 153 hn = pNext(h); 154 while(hn != NULL) 155 { 156 hncomp = pGetComp(hn); 157 j = (*modcomp)[hncomp]; 158 nxt = (*modcomp)[hncomp+1]; 159 while (j < nxt) 160 { 161 if (syDivisibleBy2(redWith[j], hn)) 162 { 163 //if (TEST_OPT_PROT) Print("r"); 164 hn = spSpolyRed(redWith[j],hn,NULL); 165 if (hn == NULL) 166 { 167 pNext(h) = NULL; 168 return p; 169 } 170 hncomp = pGetComp(hn); 171 j = (*modcomp)[hncomp]; 172 nxt = (*modcomp)[hncomp+1]; 173 } 174 else 175 { 176 j++; 177 } 178 } 179 h = pNext(h) = hn; 180 hn = pNext(h); 181 } 182 return p; 183 } 184 123 185 /*2 124 186 * computes the Schreyer syzygies in the local case … … 246 308 ecartToRed = 1; 247 309 bestEcart = 1; 248 if ( TEST_OPT_DEBUG)310 if (BTEST1(6)) 249 311 { 250 312 PrintS("pair: ");pWrite0(S[j]);PrintS(" ");pWrite(S[k]); … … 257 319 while (pGetComp(toRed)<=rkF) 258 320 { 259 if ( TEST_OPT_DEBUG)321 if (BTEST1(6)) 260 322 { 261 323 PrintS("toRed: ");pWrite(toRed); … … 394 456 int j,i=0; 395 457 poly p; 396 458 397 459 if (toNorm==NULL) return NULL; 398 460 p = pHead(toNorm); … … 408 470 //pNorm(toNorm); 409 471 toNorm = spSpolyRed(currQuotient->m[i],toNorm,NULL); 410 pDelete(&p); 472 pDelete(&p); 411 473 if (toNorm==NULL) return NULL; 412 474 p = pHead(toNorm); … … 520 582 //the next term of the syzygy 521 583 //constructs the spoly 522 if ( TEST_OPT_DEBUG)584 if (BTEST1(6)) 523 585 { 524 586 if (k<Fl) … … 542 604 while (toRed!=NULL) 543 605 { 544 if ( TEST_OPT_DEBUG)606 if (BTEST1(6)) 545 607 { 546 608 PrintS("toRed: ");pWrite(toRed); … … 580 642 //the next monom of the syzygy 581 643 isNotReduced = TRUE; 582 if ( TEST_OPT_DEBUG)644 if (BTEST1(6)) 583 645 { 584 646 PrintS("reduced with: ");pWrite(F[l]); … … 612 674 } 613 675 pNorm(syz); 614 (*Shdl)[Sl] = syz; 676 if (BTEST1(OPT_REDTAIL)) 677 { 678 (*newmodcomp)[j+2] = Sl; 679 (*Shdl)[Sl] = syRedtail2(syz,*Shdl,newmodcomp); 680 (*newmodcomp)[j+2] = 0; 681 } 682 else 683 (*Shdl)[Sl] = syz; 615 684 Sl++; 616 685 } … … 634 703 } 635 704 636 void syReOrderResolventFB(resolvente res,int length )705 void syReOrderResolventFB(resolvente res,int length, int initial) 637 706 { 638 707 int syzIndex=length-1,i,j; … … 640 709 641 710 while ((syzIndex!=0) && (res[syzIndex]==NULL)) syzIndex--; 642 while (syzIndex !=0)711 while (syzIndex>=initial) 643 712 { 644 713 for(i=0;i<IDELEMS(res[syzIndex]);i++) … … 680 749 681 750 resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length, 682 BOOLEAN isMonomial )751 BOOLEAN isMonomial,BOOLEAN notReplace) 683 752 { 684 753 ideal mW=NULL; … … 727 796 && (currRing->order[j]!=ringorder_C)) 728 797 j++; 729 if ( currRing->order[j]!=0)798 if ((!notReplace) && (currRing->order[j]!=0)) 730 799 { 731 800 while (currRing->order[j]!=0) j++;
Note: See TracChangeset
for help on using the changeset viewer.