Changeset 743c32 in git
- Timestamp:
- Apr 29, 1999, 6:57:18 PM (25 years ago)
- Branches:
- (u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
- Children:
- b98018048375e2844cb029948d521db0a81570d8
- Parents:
- ce5fb2786eb5fa61fee54f85fe8647ef13e7be20
- Location:
- Singular
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/febase.inc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.inc,v 1.2 2 1999-04-20 17:02:48Singular Exp $ */4 /* $Id: febase.inc,v 1.23 1999-04-29 16:57:12 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: handling of 'voices' … … 366 366 * print echo (si_echo or TRACE), set my_yylinebuf 367 367 */ 368 static int fePrintEcho(char *anf )368 static int fePrintEcho(char *anf, char *b) 369 369 { 370 370 char *ss=strchr(anf,'\n'); … … 430 430 && (currentVoice->pi->trace_flag!=0)) 431 431 { 432 sdb(currentVoice, anf, len_s );432 sdb(currentVoice, anf, len_s, b); 433 433 } 434 434 prompt_char = '.'; … … 485 485 strncpy(s,anf,len+2); 486 486 s[len+1]='\0'; 487 fePrintEcho(s );487 fePrintEcho(s,b); 488 488 FreeL((ADDRESS)s); 489 489 } … … 500 500 s[len+1]='\0'; 501 501 yylineno++; 502 fePrintEcho(s );502 fePrintEcho(s,b); 503 503 FreeL((ADDRESS)s); 504 504 } … … 541 541 fputs(s,feProtFile); 542 542 } 543 int rc=fePrintEcho(s )+1;543 int rc=fePrintEcho(s,b)+1; 544 544 //s[strlen(s)+1]='\0'; add an second \0 at the end of the string 545 545 s[rc]='\0'; -
Singular/hutil.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: hutil.cc,v 1. 9 1998-12-08 10:55:19 pohlExp $ */4 /* $Id: hutil.cc,v 1.10 1999-04-29 16:57:13 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: Utilities for staircase operations … … 142 142 } 143 143 144 144 145 145 void hComp(scfmon exist, int Nexist, Exponent_t ak, scfmon stc, int *Nstc) 146 146 { … … 249 249 g -= o; 250 250 else 251 251 g = o - g; 252 252 if (g > h) 253 253 h = g; -
Singular/iplib.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iplib.cc,v 1.5 4 1999-04-15 17:28:04Singular Exp $ */4 /* $Id: iplib.cc,v 1.55 1999-04-29 16:57:13 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: LIB and help … … 172 172 s[procbuflen+head+2] = '\0'; 173 173 offset=0; 174 for(i=0;i<=procbuflen+head+2; i++) { 174 for(i=0;i<=procbuflen+head+2; i++) 175 { 175 176 if(s[i]=='\\' && 176 (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\')) { 177 (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\')) 178 { 177 179 i++; 178 180 offset++; … … 316 318 { 317 319 namehdl nshdl; 318 for(nshdl=namespaceroot; nshdl->isroot != TRUE; nshdl = nshdl->next) { 320 for(nshdl=namespaceroot; nshdl->isroot != TRUE; nshdl = nshdl->next) 321 { 319 322 Print("%d lev %d:",nshdl->lev, nshdl->myynest); 320 323 if (nshdl->currRing==NULL) PrintS("NULL"); … … 603 606 lib_types LT; 604 607 605 for(i=0; suffix[i] != NULL; i++) { 608 for(i=0; suffix[i] != NULL; i++) 609 { 606 610 sprintf(libname, "%s%s", id, suffix[i]); 607 611 *libname = mytolower(*libname); 608 if((LT = type_of_LIB(libname, libnamebuf)) != LT_NONE) { 609 if(!(LoadResult = iiLibCmd(mstrdup(libname), FALSE))) { 612 if((LT = type_of_LIB(libname, libnamebuf)) != LT_NONE) 613 { 614 if(!(LoadResult = iiLibCmd(mstrdup(libname), FALSE))) 615 { 610 616 v->name = iiConvName(libname); 611 617 break; … … 813 819 } 814 820 #ifdef HAVE_NAMESPACES 815 if (BVERBOSE(V_LOAD_LIB)) { 821 if (BVERBOSE(V_LOAD_LIB)) 822 { 816 823 idhdl versionhdl = namespaceroot->get("version",0); 817 824 if(versionhdl != NULL) … … 1041 1048 "line", "start", "line", "body", "line", "example"); 1042 1049 #ifdef HAVE_NAMESPACES 1043 // for(pl = IDROOT; pl != NULL; pl = IDNEXT(pl)) { 1044 for(pl = NSROOT(namespaceroot->root); pl != NULL; pl = IDNEXT(pl)) { 1045 if(IDTYP(pl) == PACKAGE_CMD) { 1050 // for(pl = IDROOT; pl != NULL; pl = IDNEXT(pl)) 1051 //{ 1052 for(pl = NSROOT(namespaceroot->root); pl != NULL; pl = IDNEXT(pl)) 1053 { 1054 if(IDTYP(pl) == PACKAGE_CMD) 1055 { 1046 1056 for(h = IDPACKAGE(pl)->idroot; h != NULL; h = IDNEXT(h)) 1047 1057 #else /* HAVE_NAMESPACES */ … … 1101 1111 char *f = NULL; 1102 1112 if(hl!=NULL) f = strstr(IDSTRING(hl),libname); 1103 if( (hl==NULL) || (f == NULL)) { 1104 for(lp = this;lp!=NULL;lp=lp->next) { 1113 if( (hl==NULL) || (f == NULL)) 1114 { 1115 for(lp = this;lp!=NULL;lp=lp->next) 1116 { 1105 1117 if(strcmp(lp->get(), libname)==0) break; 1106 1118 } 1107 if(lp==NULL) { 1119 if(lp==NULL) 1120 { 1108 1121 libstackv ls = (libstack *)Alloc0(sizeof(libstack)); 1109 1122 ls->next = this; … … 1133 1146 lib_types type_of_LIB(char *newlib, char *libnamebuf) 1134 1147 { 1135 char buf[HOWMANY+1];/* one extra for terminating '\0' */1148 char buf[HOWMANY+1]; /* one extra for terminating '\0' */ 1136 1149 struct stat sb; 1137 1150 int nbytes = 0; … … 1146 1159 return LT; 1147 1160 } 1148 if((sb.st_mode & S_IFMT) != S_IFREG) { 1161 if((sb.st_mode & S_IFMT) != S_IFREG) 1162 { 1149 1163 goto lib_type_end; 1150 1164 } 1151 if ((nbytes = fread((char *)buf, sizeof(char), HOWMANY, fp)) == -1) { 1165 if ((nbytes = fread((char *)buf, sizeof(char), HOWMANY, fp)) == -1) 1166 { 1152 1167 goto lib_type_end; 1153 1168 /*NOTREACHED*/ … … 1155 1170 if (nbytes == 0) 1156 1171 goto lib_type_end; 1157 else { 1158 buf[nbytes++] = '\0'; /* null-terminate it */ 1159 } 1160 if( (strncmp(buf, "\177ELF\01\01\01", 7)==0) && buf[16]=='\03') { 1172 else 1173 { 1174 buf[nbytes++] = '\0'; /* null-terminate it */ 1175 } 1176 if( (strncmp(buf, "\177ELF\01\01\01", 7)==0) && buf[16]=='\03') 1177 { 1161 1178 LT = LT_ELF; 1162 1179 FreeL(newlib); … … 1164 1181 goto lib_type_end; 1165 1182 } 1166 if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0)) { 1183 if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0)) 1184 { 1167 1185 LT = LT_HPUX; 1168 1186 FreeL(newlib); … … 1170 1188 goto lib_type_end; 1171 1189 } 1172 if(isprint(buf[0]) || buf[0]=='\n') { LT = LT_SINGULAR; goto lib_type_end; } 1190 if(isprint(buf[0]) || buf[0]=='\n') 1191 { LT = LT_SINGULAR; goto lib_type_end; } 1173 1192 1174 1193 lib_type_end: -
Singular/kstd1.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.3 2 1999-04-29 11:38:45Singular Exp $ */4 /* $Id: kstd1.cc,v 1.33 1999-04-29 16:57:14 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 102 102 if (!TEST_OPT_INTSTRATEGY) 103 103 pNorm(*with); 104 if (TEST_OPT_DEBUG) 105 { 106 PrintS("reduce ");wrp((*h).p); PrintS(" with ");wrp(*with);PrintLn(); 107 } 104 108 if (intoT) 105 109 { … … 111 115 { 112 116 (*h).p = spSpolyRed(*with,(*h).p,strat->kNoether, strat->spSpolyLoop); 117 } 118 if (TEST_OPT_DEBUG) 119 { 120 PrintS("to ");wrp((*h).p);PrintLn(); 113 121 } 114 122 } … … 132 140 if (j > strat->tl) 133 141 { 134 if (TEST_OPT_DEBUG) PrintLn();135 142 return; 136 143 } 137 if (TEST_OPT_DEBUG) Print("%d",j);138 144 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 139 145 { 140 146 //if (strat->interpt) test_int_std(strat->kIdeal); 141 if (TEST_OPT_DEBUG) PrintS("+");142 147 /*- compute the s-polynomial -*/ 143 148 if (strat->T[j].ecart > (*h).ecart) … … 174 179 if ((*h).p == NULL) 175 180 { 176 if (TEST_OPT_DEBUG) PrintS(" to 0\n");177 181 if (h->lcm!=NULL) pFree1((*h).lcm); 178 182 return; … … 230 234 } 231 235 j = 0; 232 if TEST_OPT_DEBUG PrintLn();233 236 } 234 237 else 235 238 { 236 if (TEST_OPT_DEBUG) PrintS("-");237 239 j++; 238 240 } … … 258 260 if (j > strat->tl) 259 261 { 260 if (TEST_OPT_DEBUG) PrintLn();261 262 return; 262 263 } 263 if (TEST_OPT_DEBUG) Print("%d",j);264 264 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 265 265 { 266 266 //if (strat->interpt) test_int_std(strat->kIdeal); 267 if (TEST_OPT_DEBUG) PrintS("+");268 267 /*- compute the s-polynomial -*/ 269 268 pi = strat->T[j].p; … … 281 280 i++; 282 281 if (i > strat->tl) break; 283 if (TEST_OPT_DEBUG) Print("%d",i);284 282 if ((((strat->T[i]).ecart < ei) 285 283 || (((strat->T[i]).ecart == ei) … … 287 285 && pDivisibleBy1((strat->T[i]).p,(*h).p)) 288 286 { 289 if (TEST_OPT_DEBUG) PrintS("+");290 287 /* 291 288 * the polynomial to reduce with is now; … … 295 292 li = strat->T[i].length; 296 293 } 297 else if (TEST_OPT_DEBUG) PrintS("-");298 294 } 299 295 /* … … 329 325 } 330 326 } 331 if (TEST_OPT_DEBUG)332 {333 wrp(h->p);334 PrintS(" with ");335 wrp(pi);336 }337 327 doRed(h,&pi,strat->fromT,strat); 338 328 strat->fromT=FALSE; 339 if (TEST_OPT_DEBUG)340 {341 PrintS(" to ");342 wrp(h->p);343 PrintLn();344 }345 329 if ((*h).p == NULL) 346 330 { … … 404 388 else 405 389 { 406 if (TEST_OPT_DEBUG) PrintS("-");407 390 j++; 408 391 } … … 427 410 if (j > strat->tl) 428 411 { 429 if (TEST_OPT_DEBUG) PrintLn();430 412 return; 431 413 } 432 if (TEST_OPT_DEBUG) Print("%d",j);433 414 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 434 415 { 435 416 //if (strat->interpt) test_int_std(strat->kIdeal); 436 if (TEST_OPT_DEBUG) PrintS("+\n");437 417 /* 438 418 * the polynomial to reduce with is; … … 443 423 if (TEST_OPT_DEBUG) 444 424 { 425 PrintS("reduce "); 445 426 wrp(h->p); 446 427 PrintS(" with "); … … 453 434 PrintS(" to "); 454 435 wrp(h->p); 436 PrintLn(); 455 437 } 456 438 if ((*h).p == NULL) … … 503 485 } 504 486 j = 0; 505 if TEST_OPT_DEBUG PrintLn();506 487 } 507 488 else 508 489 { 509 if (TEST_OPT_DEBUG) PrintS("-");510 490 j++; 511 491 } … … 531 511 if (j > strat->tl) 532 512 { 533 if (TEST_OPT_DEBUG) PrintLn();534 513 return; 535 514 } 536 if (TEST_OPT_DEBUG) Print("%d",j);537 515 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 538 516 { 539 517 //if (strat->interpt) test_int_std(strat->kIdeal); 540 if (TEST_OPT_DEBUG) PrintS("+");541 518 /*- compute the s-polynomial -*/ 542 519 pi = strat->T[j].p; … … 553 530 i++; 554 531 if (i > strat->tl) break; 555 if (TEST_OPT_DEBUG) Print("%d",i);556 532 if (((strat->T[i].ecart < ei) 557 533 || ((strat->T[i].ecart == ei) … … 559 535 && pDivisibleBy1(strat->T[i].p,(*h).p)) 560 536 { 561 if (TEST_OPT_DEBUG) PrintS("+");562 537 /* 563 538 * the polynomial to reduce with is now: … … 566 541 ei = strat->T[i].ecart; 567 542 li = strat->T[i].length; 568 }569 else570 {571 if (TEST_OPT_DEBUG) PrintS("-");572 543 } 573 544 } … … 604 575 } 605 576 } 606 if (TEST_OPT_DEBUG)607 {608 wrp(h->p);609 PrintS(" with ");610 wrp(pi);611 }612 577 doRed(h,&pi,strat->fromT,strat); 613 578 strat->fromT=FALSE; 614 if (TEST_OPT_DEBUG)615 {616 PrintS(" to ");617 wrp(h->p);618 }619 579 if ((*h).p == NULL) 620 580 { … … 674 634 } 675 635 j = 0; 676 if TEST_OPT_DEBUG PrintLn();677 636 } 678 637 else 679 638 { 680 if (TEST_OPT_DEBUG) PrintS("-");681 639 j++; 682 640 } … … 705 663 if (j > strat->tl) 706 664 { 707 if (TEST_OPT_DEBUG) PrintLn();708 665 return H.p; 709 666 } 710 if (TEST_OPT_DEBUG) Print("%d",j);711 667 if (pDivisibleBy1(strat->T[j].p,H.p)) 712 668 { 713 669 //if (strat->interpt) test_int_std(strat->kIdeal); 714 if (TEST_OPT_DEBUG) PrintS("+");715 670 /*- remember the found T-poly -*/ 716 671 pi = strat->T[j].p; … … 728 683 if (j > strat->tl) break; 729 684 if (ei <= H.ecart) break; 730 if (TEST_OPT_DEBUG) Print("%d",j);731 685 if (((strat->T[j].ecart < ei) 732 686 || ((strat->T[j].ecart == ei) … … 734 688 && pDivisibleBy1(strat->T[j].p,H.p)) 735 689 { 736 if (TEST_OPT_DEBUG) PrintS("+");737 690 /* 738 691 * the polynomial to reduce with is now; … … 742 695 li = strat->T[j].length; 743 696 } 744 else745 {746 if (TEST_OPT_DEBUG) PrintS("-");747 }748 697 } 749 698 /* … … 765 714 if (H.p == NULL) 766 715 { 767 if (TEST_OPT_DEBUG) PrintS(" to 0\n");768 716 return NULL; 769 717 } … … 777 725 if (H.p == NULL) 778 726 { 779 if (TEST_OPT_DEBUG) PrintS(" to 0\n");780 727 return NULL; 781 728 } … … 789 736 else 790 737 { 791 if (TEST_OPT_DEBUG) PrintS("-");792 738 j++; 793 739 } … … 1352 1298 while ((strat->Ll >= 0) 1353 1299 && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p)> Kstd1_deg) 1354 1300 && (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)) 1355 1301 { 1356 1302 deleteInL(strat->L,&strat->Ll,strat->Ll,strat); -
Singular/kstd2.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 4 1999-04-29 11:38:46Singular Exp $ */4 /* $Id: kstd2.cc,v 1.25 1999-04-29 16:57:15 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 72 72 if ((strat->L[i].p1==strat->P.p1) || (strat->L[i].p2==strat->P.p1)) 73 73 { 74 //PrintS("#");75 74 deleteInL(strat->L,&strat->Ll,i,strat); 76 75 } … … 85 84 PrintS("red:"); 86 85 wrp(h->p); 87 PrintS(" ");88 86 } 89 87 loop 90 88 { 91 if (TEST_OPT_DEBUG) Print("%d",j);92 89 if (pDivisibleBy(strat->S[j],(*h).p)) 93 90 { 94 if (TEST_OPT_DEBUG)95 {96 PrintS("+\nwith ");97 wrp(strat->S[j]);98 }99 91 if ((!exchanged) && (pEqual((*h).p,strat->S[j]))) 100 92 { 101 //PrintS("@");102 93 q = kFromInput(strat->S[j],strat); 103 94 if (q!=NULL) 104 95 { 105 //Print("%d*",pGetComp(q));106 96 exchanged = TRUE; 107 97 p = strat->S[j]; … … 126 116 //if (strat->interpt) test_int_std(strat->kIdeal); 127 117 /*- compute the s-polynomial -*/ 118 if (TEST_OPT_DEBUG) 119 { 120 PrintS(" with "); 121 wrp(strat->S[j]); 122 } 128 123 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 129 124 strat->spSpolyLoop); 125 if (TEST_OPT_DEBUG) 126 { 127 PrintS("\nto "); wrp((*h).p);PrintLn(); 128 } 130 129 if ((*h).p == NULL) 131 130 { 132 if (TEST_OPT_DEBUG) PrintS(" to 0\n");133 131 if (h->lcm!=NULL) pFree1((*h).lcm); 134 132 #ifdef KDEBUG … … 148 146 if (pGetComp((*h).p) > strat->syzComp) 149 147 { 150 //PrintS("syz");151 148 pDelete(&((*h).p)); 152 149 return; … … 156 153 if (!TEST_OPT_INTSTRATEGY) 157 154 { 158 //PrintS("r");159 155 pos = posInS(strat->S,strat->sl,(*h).p); 160 156 pNorm((*h).p); … … 186 182 * and the case of a degree-ordering 187 183 */ 188 static reductions = 0;189 184 190 185 static void redHomog (LObject* h,kStrategy strat) … … 198 193 int j = 0; 199 194 200 if (TEST_OPT_DEBUG)201 {202 PrintS("red:");203 wrp(h->p);204 PrintS(" ");205 }206 195 if (strat->ak!=0) 207 196 { 208 197 loop 209 198 { 210 if (TEST_OPT_DEBUG) Print("%d",j);211 199 if (pDivisibleBy1(strat->S[j],(*h).p)) 212 200 { 213 reductions++;214 if (TEST_OPT_DEBUG)215 {216 Print("+\n%d:with ", reductions);217 wrp(strat->S[j]);218 }219 201 //if (strat->interpt) test_int_std(strat->kIdeal); 220 202 /*- compute the s-polynomial -*/ 203 if (TEST_OPT_DEBUG) 204 { 205 PrintS("red:"); 206 wrp(h->p); 207 PrintS(" with "); 208 wrp(strat->S[j]); 209 } 221 210 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 222 211 strat->spSpolyLoop); 212 if (TEST_OPT_DEBUG) 213 { 214 PrintS("\nto "); 215 wrp(h->p); 216 PrintLn(); 217 } 223 218 if ((*h).p == NULL) 224 219 { 225 if (TEST_OPT_DEBUG) PrintS(" to 0\n");226 220 if (h->lcm!=NULL) pFree1((*h).lcm); 227 221 #ifdef KDEBUG … … 248 242 loop 249 243 { 250 if (TEST_OPT_DEBUG) Print("%d",j);251 244 if (pDivisibleBy2(strat->S[j],(*h).p)) 252 245 { 253 reductions++;254 if (TEST_OPT_DEBUG)255 {256 Print("+\n%d:with ",reductions);257 wrp(strat->S[j]);258 }259 246 //if (strat->interpt) test_int_std(strat->kIdeal); 260 247 /*- compute the s-polynomial -*/ 248 if (TEST_OPT_DEBUG) 249 { 250 PrintS("red:"); 251 wrp(h->p); 252 PrintS(" with "); 253 wrp(strat->S[j]); 254 } 261 255 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 262 256 strat->spSpolyLoop); 257 if (TEST_OPT_DEBUG) 258 { 259 PrintS("\nto "); 260 wrp(h->p); 261 PrintLn(); 262 } 263 263 if ((*h).p == NULL) 264 264 { 265 if (TEST_OPT_DEBUG) PrintS(" to 0\n");266 265 if (h->lcm!=NULL) pFree1((*h).lcm); 267 266 #ifdef KDEBUG … … 269 268 #endif 270 269 return; 271 }272 if (TEST_OPT_DEBUG)273 {274 Print(" to %d:", pLength((*h).p));275 wrp((*h).p);276 PrintS("\n");277 270 } 278 271 j = 0; … … 306 299 int k = 0; 307 300 308 if (TEST_OPT_DEBUG)309 {310 PrintS("red:");311 wrp(h->p);312 PrintS(" ");313 }314 301 if (strat->ak) 315 302 { 316 303 loop 317 304 { 318 if (TEST_OPT_DEBUG) Print("%d",j);319 305 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 320 306 { 321 307 //if (strat->interpt) test_int_std(strat->kIdeal); 308 /*- compute the s-polynomial -*/ 322 309 if (TEST_OPT_DEBUG) 323 310 { 324 PrintS("+\nwith "); 325 wrp(strat->S[j]); 326 } 327 /*- compute the s-polynomial -*/ 311 PrintS("red:"); 312 wrp(h->p); 313 PrintS(" with "); 314 wrp(strat->T[j].p); 315 } 328 316 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, 329 317 strat->spSpolyLoop); 318 if (TEST_OPT_DEBUG) 319 { 320 PrintS("\nto "); 321 wrp(h->p); 322 PrintLn(); 323 } 330 324 if ((*h).p == NULL) 331 325 { 332 if (TEST_OPT_DEBUG) PrintS(" to 0\n");333 326 if (h->lcm!=NULL) pFree1((*h).lcm); 334 327 #ifdef KDEBUG … … 362 355 363 356 // no module component 364 if (TEST_OPT_DEBUG) Print("%d",j);365 357 if (pDivisibleBy2(strat->T[j].p,(*h).p)) 366 358 { 367 359 //if (strat->interpt) test_int_std(strat->kIdeal); 360 /*- compute the s-polynomial -*/ 368 361 if (TEST_OPT_DEBUG) 369 362 { 370 PrintS("+\nwith "); 371 wrp(strat->S[j]); 372 } 373 /*- compute the s-polynomial -*/ 363 PrintS("red:"); 364 wrp(h->p); 365 PrintS(" with "); 366 wrp(strat->T[j].p); 367 } 374 368 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, 375 369 strat->spSpolyLoop); 370 if (TEST_OPT_DEBUG) 371 { 372 PrintS("\nto "); 373 wrp(h->p); 374 PrintLn(); 375 } 376 376 if ((*h).p == NULL) 377 377 { 378 if (TEST_OPT_DEBUG) PrintS(" to 0\n");379 378 if (h->lcm!=NULL) pFree1((*h).lcm); 380 379 #ifdef KDEBUG … … 422 421 int reddeg = pFDeg((*h).p); 423 422 424 if (TEST_OPT_DEBUG)425 {426 PrintS("red:");427 wrp(h->p);428 PrintS(" ");429 }430 423 loop 431 424 { … … 433 426 { 434 427 //if (strat->interpt) test_int_std(strat->kIdeal); 428 /*- compute the s-polynomial -*/ 435 429 if (TEST_OPT_DEBUG) 436 430 { 437 Print("\nwith S[%d] ",j); 438 wrp(strat->S[j]); 439 } 440 /*- compute the s-polynomial -*/ 431 PrintS("red:"); 432 wrp(h->p); 433 PrintS(" with "); 434 wrp(strat->T[j].p); 435 } 441 436 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether 442 437 , strat->spSpolyLoop); 438 if (TEST_OPT_DEBUG) 439 { 440 PrintS("\nto "); 441 wrp(h->p); 442 PrintLn(); 443 } 443 444 if ((*h).p == NULL) 444 445 { 445 if (TEST_OPT_DEBUG) PrintS(" to 0\n");446 446 if (h->lcm!=NULL) pFree1((*h).lcm); 447 447 #ifdef KDEBUG … … 450 450 return; 451 451 } 452 #ifdef KDEBUG453 else if (TEST_OPT_DEBUG)454 {455 PrintS("to:");456 wrp((*h).p);457 PrintLn();458 }459 #endif460 452 /*- try to reduce the s-polynomial -*/ 461 453 pass++; … … 494 486 if (j >= strat->sl) 495 487 { 496 if (TEST_OPT_DEBUG) PrintLn();497 488 if (TEST_OPT_INTSTRATEGY) 498 489 { … … 526 517 pass = j = 0; 527 518 d = reddeg = pFDeg((*h).p)+(*h).ecart; 528 if (TEST_OPT_DEBUG)529 {530 PrintS("red:");531 wrp((*h).p);532 }533 519 loop 534 520 { 535 521 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 536 522 { 537 if (TEST_OPT_DEBUG) Print(" T[%d]",j);538 523 pi = strat->T[j].p; 539 524 ei = strat->T[j].ecart; … … 553 538 if ((strat->T[i].ecart < ei) && pDivisibleBy1(strat->T[i].p,(*h).p)) 554 539 { 555 if (TEST_OPT_DEBUG) Print(" T[%d]",i);556 540 /* 557 541 * the polynomial to reduce with is now; … … 594 578 if (TEST_OPT_DEBUG) 595 579 { 596 PrintS("\nwith "); 580 PrintS("red:"); 581 wrp(h->p); 582 PrintS(" with "); 597 583 wrp(pi); 598 584 } … … 607 593 if (TEST_OPT_DEBUG) 608 594 { 609 PrintS(" 610 wrp( (*h).p);595 PrintS("\nto "); 596 wrp(h->p); 611 597 PrintLn(); 612 598 } … … 681 667 if (j >= strat->tl) 682 668 { 683 if (TEST_OPT_DEBUG) PrintLn();684 669 if (TEST_OPT_INTSTRATEGY) 685 670 { … … 863 848 int z = 3; 864 849 865 if (TEST_OPT_DEBUG)866 {867 PrintS("red:");wrp(h);868 }869 850 if (0 > strat->sl) 870 851 { 871 if (TEST_OPT_DEBUG) PrintLn();872 852 return h; 873 853 } … … 880 860 if (TEST_OPT_DEBUG) 881 861 { 882 Print("\nwith S[%d]:",j);wrp(strat->S[j]); 862 PrintS("red:"); 863 wrp(h); 864 PrintS(" with "); 865 wrp(strat->S[j]); 883 866 } 884 867 h = spSpolyRed(strat->S[j],h,strat->kNoether, strat->spSpolyLoop); … … 887 870 PrintS("\nto:"); 888 871 wrp(h); 889 if (h==NULL) PrintLn();890 872 } 891 873 if (h == NULL) return NULL; … … 1144 1126 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 1145 1127 //if (strat->redTailChange) 1146 1128 pCleardenom(strat->P.p); 1147 1129 } 1148 1130 } … … 1393 1375 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 1394 1376 //if (strat->redTailChange) 1395 1377 pCleardenom(strat->P.p); 1396 1378 } 1397 1379 } -
Singular/kutil.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.3 2 1999-04-29 11:38:48Singular Exp $ */4 /* $Id: kutil.cc,v 1.33 1999-04-29 16:57:16 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 2750 2750 pTest(h.p); 2751 2751 #endif 2752 #ifdef KDEBUG2752 #ifdef SDRING 2753 2753 if (TEST_OPT_DEBUG && pSDRING) 2754 2754 { … … 2920 2920 { 2921 2921 h.p=redBba(h.p,strat->sl,strat); 2922 2922 if (h.p!=NULL) 2923 2923 h.p=redtailBba(h.p,strat->sl,strat); 2924 2924 } … … 3094 3094 { 3095 3095 h1 = spSpolyRedNew(strat->S[j],h,strat->kNoether, strat->spSpolyLoop); 3096 if(TEST_OPT_DEBUG) 3097 { 3098 PrintS("reduce "); wrp(h); Print(" with S[%d] (",j);wrp(strat->S[j]); 3099 PrintS(")\nto "); wrp(h1); PrintLn(); 3100 } 3096 3101 pDelete(&h); 3097 3102 if (h1 == NULL) return NULL; … … 3147 3152 && ((strat->fromQ==NULL) || (strat->fromQ[i]==0))) 3148 3153 { 3149 if (TEST_OPT_DEBUG)3150 {3151 PrintS("reduce:");3152 wrp(strat->S[i]);3153 }3154 3154 pDelete(&redSi); 3155 3155 redSi = pHead(strat->S[i]); … … 3157 3157 if ((strat->ak!=0)&&(strat->S[i]!=NULL)) 3158 3158 strat->S[i]=redQ(strat->S[i],i+1,strat); /*reduce S[i] mod Q*/ 3159 if (TEST_OPT_DEBUG && (pComp(redSi,strat->S[i])!=0)) 3160 { 3161 PrintS("reduce:"); 3162 wrp(redSi);PrintS(" to ");wrp(strat->S[i]);PrintLn(); 3163 } 3159 3164 if (TEST_OPT_PROT && (pComp(redSi,strat->S[i])!=0)) 3160 3165 { … … 3168 3173 { 3169 3174 pDelete(&redSi); 3170 if (TEST_OPT_DEBUG) PrintS(" to 0");3171 3175 deleteInS(i,strat); 3172 3176 i--; … … 3233 3237 pNorm(strat->S[i]); 3234 3238 } 3235 if (TEST_OPT_DEBUG)3236 {3237 PrintS(" to ");3238 wrp(strat->S[i]);3239 }3240 3239 } 3241 if (TEST_OPT_DEBUG) PrintLn();3242 3240 } 3243 3241 i++; … … 3709 3707 /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ 3710 3708 else 3711 #endif 3709 #endif 3712 3710 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 3713 3711 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ -
Singular/misc.cc
rce5fb2 r743c32 578 578 579 579 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) 580 580 && rField_has_simple_inverse()) 581 581 { 582 582 test &=~Sy_bit(OPT_INTSTRATEGY); … … 602 602 Warn("cannot set option"); 603 603 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) 604 604 && rField_has_simple_inverse()) 605 605 { 606 606 test &=~Sy_bit(OPT_INTSTRATEGY); -
Singular/sdb.cc
rce5fb2 r743c32 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sdb.cc,v 1. 2 1999-04-20 17:02:48 Singular Exp $ */4 /* $Id: sdb.cc,v 1.3 1999-04-29 16:57:18 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: Singular debugger … … 15 15 #include "sdb.h" 16 16 17 int sdb_lines[ 6]={-1,-1,-1,-1,-1,-1,-1};17 int sdb_lines[]={-1,-1,-1,-1,-1,-1,-1,-1}; 18 18 19 19 int sdb_checkline(char f) … … 33 33 static char sdb_lastcmd='c'; 34 34 35 void sdb(Voice * currentVoice, char * currLine, int len )35 void sdb(Voice * currentVoice, char * currLine, int len, char *b) 36 36 { 37 37 int bp=0; … … 66 66 { 67 67 case 'd': 68 { 69 fprintf(stdout,"delete break point %d\n",bp); 68 70 currentVoice->pi->trace_flag &= (~Sy_bit(bp)); 71 if (bp!=0) 72 { 73 sdb_lines[bp-1]=-1; 74 } 75 int f=currentVoice->pi->trace_flag; 76 fprintf(stdout,"active breakpoints: \n"); 77 int i; 78 for(i=1;i<=7;i++) 79 { 80 f=f>>1; 81 if (f&1) 82 fprintf(stdout,"%d:line %d", i, sdb_lines[i-1]); 83 } 84 fprintf(stdout,"\n"); 69 85 break; 86 } 70 87 case 'n': 71 88 currentVoice->pi->trace_flag|= 1; 72 89 return; 73 // case 'e': 74 // { 90 case 'e': 91 { 92 int i=strlen(b); 93 while ((i>=0) && (b[i]<=' ')) i--; 94 if (i<0) 95 { 96 fprintf(stdout,"cannot set ~ at empty line\n"); 97 break; 98 } 99 if (b[i]!=';') 100 { 101 fprintf(stdout,"cannot set ~ at char `%c`\n",b[i]); 102 break; 103 } 104 b[i+1]='~'; 105 b[i+2]=';'; 106 b[i+3]='\n'; 107 b[i+4]='\0'; 108 return; 109 } 75 110 // sdb_lastcmd='c'; 76 111 // if (*(p+1)!=' ') -
Singular/sdb.h
rce5fb2 r743c32 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: sdb.h,v 1. 2 1999-04-20 17:02:49Singular Exp $ */6 /* $Id: sdb.h,v 1.3 1999-04-29 16:57:18 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: Singular debugger … … 13 13 extern int sdb_lines[]; 14 14 15 void sdb(Voice * currentVoice, char * currLine, int len );15 void sdb(Voice * currentVoice, char * currLine, int len, char * buffer); 16 16 #endif 17 17
Note: See TracChangeset
for help on using the changeset viewer.