Changeset 8a150b in git
- Timestamp:
- Apr 29, 1999, 1:38:59 PM (25 years ago)
- Branches:
- (u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
- Children:
- ce5fb2786eb5fa61fee54f85fe8647ef13e7be20
- Parents:
- 4be737ee7176ba0340ece58c1e6920d666833ac2
- Location:
- Singular
- Files:
-
- 5 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
r4be737 r8a150b 72 72 comm.cc kstd1.cc kstd2.cc kutil.cc lists.cc \ 73 73 longalg.cc longrat.cc longrat0.cc \ 74 maps.cc matpol.cc misc.cc sdb.cc \75 mminit.cc modulop.cc sparsmat.cc \74 maps.cc matpol.cc misc.cc sdb.cc gnumpfl.cc\ 75 mminit.cc modulop.cc mpr_complex.cc sparsmat.cc \ 76 76 fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc \ 77 77 numbers.cc polys.cc polys0.cc polys1.cc polys-impl.cc \ … … 95 95 subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \ 96 96 cntrlc.h ipprint.h ring.h timer.h sdb.h \ 97 febase.h ipshell.h shortfl.h tok.h \97 febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \ 98 98 mmemory.h mmprivate.h mmheap.h mmpage.h page.h \ 99 ffields.h khstd.h silink.h sparsmat.h \99 ffields.h khstd.h silink.h sparsmat.h gnumpfl.h \ 100 100 fglm.h comm.h kstd1.h modulop.h sing_dbm.h weight.h \ 101 101 fglmgauss.h fglmvec.h kstd2.h mpsr.h sing_mp.h \ … … 116 116 ${INCS} 117 117 118 OBJS=grammar.o scanner.o matpol.o binom.o \118 OBJS=grammar.o scanner.o matpol.o binom.o mpr_complex.o gnumpfl.o \ 119 119 febase.o feread.o timer.o intvec.o attrib.o lists.o\ 120 120 longrat.o longrat0.o misc.o ring.o numbers.o maps.o\ … … 332 332 ## 333 333 334 OBJG1= grammar.og scanner.og matpol.og binom.og \334 OBJG1= grammar.og scanner.og matpol.og binom.og gnumpfl.og mpr_complex.og \ 335 335 febase.og feread.og timer.og intvec.og attrib.og lists.og\ 336 336 longrat.og longrat0.og misc.og ring.og numbers.og maps.og\ … … 408 408 ## 409 409 410 OBJP1= grammar.op scanner.op matpol.op binom.op \410 OBJP1= grammar.op scanner.op matpol.op binom.op gnumpfl.op mpr_complex.op \ 411 411 febase.op feread.op timer.op intvec.op attrib.op lists.op\ 412 412 longrat.op longrat0.op misc.op ring.op numbers.op maps.op\ … … 434 434 ## 435 435 436 OBJB1= grammar.ob scanner.ob matpol.ob binom.ob \436 OBJB1= grammar.ob scanner.ob matpol.ob binom.ob gnumpfl.ob mpr_complex.ob \ 437 437 febase.ob feread.ob timer.ob intvec.ob attrib.ob lists.ob\ 438 438 longrat.ob longrat0.ob misc.ob ring.ob numbers.ob maps.ob\ -
Singular/extra.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1. 89 1999-04-20 17:02:47Singular Exp $ */4 /* $Id: extra.cc,v 1.90 1999-04-29 11:38:40 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 912 912 { 913 913 procinfov p=(procinfov)h->Data(); 914 915 916 917 918 914 if (p->language!=LANG_SINGULAR) 915 { 916 WerrorS("set breakpoints only in Singular procedures"); 917 return TRUE; 918 } 919 919 int lineno=p->data.s.body_lineno; 920 920 if ((h->next!=NULL) && (h->next->Typ()==INT_CMD)) 921 921 { 922 922 lineno=(int)h->next->Data(); 923 923 } 924 924 int i; 925 926 927 928 929 930 931 } 925 if (lineno== -1) 926 { 927 i=p->trace_flag; 928 p->trace_flag &=1; 929 Print("breakpoints in %s deleted(%#x)\n",p->procname,i &255); 930 return FALSE; 931 } 932 932 i=0; 933 933 while((i<7) && (sdb_lines[i]!=-1)) i++; … … 937 937 return FALSE; 938 938 } 939 940 939 else 940 { 941 941 sdb_lines[i]=lineno; 942 943 942 i++; 943 Print("breakpoint %d, at line %d in %s\n",i,lineno,p->procname); 944 944 p->trace_flag|=(1<<i); 945 945 } 946 946 } 947 947 else -
Singular/fglmzero.cc
r4be737 r8a150b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmzero.cc,v 1.2 2 1999-03-09 12:28:47 obachmanExp $2 // $Id: fglmzero.cc,v 1.23 1999-04-29 11:38:41 Singular Exp $ 3 3 4 4 /**************************************** … … 139 139 140 140 int * perm = (int *)Alloc0( (_nfunc+1)*sizeof( int ) ); 141 maFindPerm( source->names, source->N, NULL, 0, currRing->names, 141 maFindPerm( source->names, source->N, NULL, 0, currRing->names, 142 142 currRing->N, NULL, 0, perm, NULL , currRing->ch); 143 nSetMap( rInternalChar(source), source->parameter, source->P, 143 nSetMap( rInternalChar(source), source->parameter, source->P, 144 144 source->minpoly ); 145 145 … … 149 149 if ( colp->owner == TRUE ) { 150 150 for ( row= colp->size-1, elemp= colp->elems; row >= 0; 151 152 151 row--, elemp++ ) 152 { 153 153 newelem= nMap( elemp->elem ); 154 154 nDelete( & elemp->elem ); -
Singular/iparith.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.14 5 1999-04-26 12:58:45Singular Exp $ */4 /* $Id: iparith.cc,v 1.146 1999-04-29 11:38:44 Singular Exp $ */ 5 5 6 6 /* … … 1512 1512 BITSET save_test=test; 1513 1513 naSetChar(rInternalChar(r),TRUE,r->parameter,rPar(r)); 1514 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1515 rPar(currRing)); 1514 nSetChar(currRing,TRUE); 1516 1515 test=save_test; 1517 1516 } … … 5812 5811 #endif 5813 5812 assume(0); 5814 return -1;5815 } 5816 5813 return 0; 5814 } 5815 -
Singular/kstd1.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.3 1 1999-03-08 17:30:38Singular Exp $ */4 /* $Id: kstd1.cc,v 1.32 1999-04-29 11:38:45 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 132 132 if (j > strat->tl) 133 133 { 134 #ifdef KDEBUG135 134 if (TEST_OPT_DEBUG) PrintLn(); 136 #endif137 135 return; 138 136 } 139 #ifdef KDEBUG140 137 if (TEST_OPT_DEBUG) Print("%d",j); 141 #endif142 138 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 143 139 { 144 140 //if (strat->interpt) test_int_std(strat->kIdeal); 145 #ifdef KDEBUG146 141 if (TEST_OPT_DEBUG) PrintS("+"); 147 #endif148 142 /*- compute the s-polynomial -*/ 149 143 if (strat->T[j].ecart > (*h).ecart) … … 162 156 /*- h will not become the next element to reduce -*/ 163 157 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 164 #ifdef KDEBUG165 158 if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at); 166 #endif167 159 (*h).p = NULL; 168 160 strat->fromT = FALSE; … … 182 174 if ((*h).p == NULL) 183 175 { 184 #ifdef KDEBUG185 176 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 186 #endif187 177 if (h->lcm!=NULL) pFree1((*h).lcm); 188 178 return; … … 205 195 if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp)) 206 196 { 207 #ifdef KDEBUG208 197 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 209 #endif210 198 return; 211 199 } … … 231 219 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 232 220 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 233 #ifdef KDEBUG234 221 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 235 #endif236 222 (*h).p = NULL; 237 223 return; … … 244 230 } 245 231 j = 0; 246 #ifdef KDEBUG247 232 if TEST_OPT_DEBUG PrintLn(); 248 #endif249 233 } 250 234 else 251 235 { 252 #ifdef KDEBUG253 236 if (TEST_OPT_DEBUG) PrintS("-"); 254 #endif255 237 j++; 256 238 } … … 276 258 if (j > strat->tl) 277 259 { 278 #ifdef KDEBUG279 260 if (TEST_OPT_DEBUG) PrintLn(); 280 #endif281 261 return; 282 262 } 283 #ifdef KDEBUG284 263 if (TEST_OPT_DEBUG) Print("%d",j); 285 #endif286 264 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 287 265 { 288 266 //if (strat->interpt) test_int_std(strat->kIdeal); 289 #ifdef KDEBUG290 267 if (TEST_OPT_DEBUG) PrintS("+"); 291 #endif292 268 /*- compute the s-polynomial -*/ 293 269 pi = strat->T[j].p; … … 305 281 i++; 306 282 if (i > strat->tl) break; 307 #ifdef KDEBUG308 283 if (TEST_OPT_DEBUG) Print("%d",i); 309 #endif310 284 if ((((strat->T[i]).ecart < ei) 311 285 || (((strat->T[i]).ecart == ei) … … 313 287 && pDivisibleBy1((strat->T[i]).p,(*h).p)) 314 288 { 315 #ifdef KDEBUG316 289 if (TEST_OPT_DEBUG) PrintS("+"); 317 #endif318 290 /* 319 291 * the polynomial to reduce with is now; … … 323 295 li = strat->T[i].length; 324 296 } 325 #ifdef KDEBUG326 297 else if (TEST_OPT_DEBUG) PrintS("-"); 327 #endif328 298 } 329 299 /* … … 345 315 /*- h will not become the next element to reduce -*/ 346 316 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 347 #ifdef KDEBUG348 317 if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at); 349 #endif350 318 (*h).p = NULL; 351 319 strat->fromT = FALSE; … … 361 329 } 362 330 } 363 #ifdef KDEBUG364 331 if (TEST_OPT_DEBUG) 365 332 { … … 368 335 wrp(pi); 369 336 } 370 #endif371 337 doRed(h,&pi,strat->fromT,strat); 372 338 strat->fromT=FALSE; 373 #ifdef KDEBUG374 339 if (TEST_OPT_DEBUG) 375 340 { … … 378 343 PrintLn(); 379 344 } 380 #endif381 345 if ((*h).p == NULL) 382 346 { … … 401 365 if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp)) 402 366 { 403 #ifdef KDEBUG404 367 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 405 #endif406 368 return; 407 369 } … … 428 390 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 429 391 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 430 #ifdef KDEBUG431 392 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 432 #endif433 393 (*h).p = NULL; 434 394 return; … … 444 404 else 445 405 { 446 #ifdef KDEBUG447 406 if (TEST_OPT_DEBUG) PrintS("-"); 448 #endif449 407 j++; 450 408 } … … 469 427 if (j > strat->tl) 470 428 { 471 #ifdef KDEBUG472 429 if (TEST_OPT_DEBUG) PrintLn(); 473 #endif474 430 return; 475 431 } 476 #ifdef KDEBUG477 432 if (TEST_OPT_DEBUG) Print("%d",j); 478 #endif479 433 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 480 434 { 481 435 //if (strat->interpt) test_int_std(strat->kIdeal); 482 #ifdef KDEBUG483 436 if (TEST_OPT_DEBUG) PrintS("+\n"); 484 #endif485 437 /* 486 438 * the polynomial to reduce with is; … … 489 441 if (!TEST_OPT_INTSTRATEGY) 490 442 pNorm(strat->T[j].p); 491 #ifdef KDEBUG492 443 if (TEST_OPT_DEBUG) 493 444 { … … 496 447 wrp(strat->T[j].p); 497 448 } 498 #endif499 449 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, 500 450 strat->spSpolyLoop); 501 #ifdef KDEBUG502 451 if (TEST_OPT_DEBUG) 503 452 { … … 505 454 wrp(h->p); 506 455 } 507 #endif508 456 if ((*h).p == NULL) 509 457 { … … 519 467 if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp)) 520 468 { 521 #ifdef KDEBUG522 469 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 523 #endif524 470 return; 525 471 } … … 546 492 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 547 493 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 548 #ifdef KDEBUG549 494 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 550 #endif551 495 (*h).p = NULL; 552 496 return; … … 559 503 } 560 504 j = 0; 561 #ifdef KDEBUG562 505 if TEST_OPT_DEBUG PrintLn(); 563 #endif564 506 } 565 507 else 566 508 { 567 #ifdef KDEBUG568 509 if (TEST_OPT_DEBUG) PrintS("-"); 569 #endif570 510 j++; 571 511 } … … 591 531 if (j > strat->tl) 592 532 { 593 #ifdef KDEBUG594 533 if (TEST_OPT_DEBUG) PrintLn(); 595 #endif596 534 return; 597 535 } 598 #ifdef KDEBUG599 536 if (TEST_OPT_DEBUG) Print("%d",j); 600 #endif601 537 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 602 538 { 603 539 //if (strat->interpt) test_int_std(strat->kIdeal); 604 #ifdef KDEBUG605 540 if (TEST_OPT_DEBUG) PrintS("+"); 606 #endif607 541 /*- compute the s-polynomial -*/ 608 542 pi = strat->T[j].p; … … 619 553 i++; 620 554 if (i > strat->tl) break; 621 #ifdef KDEBUG622 555 if (TEST_OPT_DEBUG) Print("%d",i); 623 #endif624 556 if (((strat->T[i].ecart < ei) 625 557 || ((strat->T[i].ecart == ei) … … 627 559 && pDivisibleBy1(strat->T[i].p,(*h).p)) 628 560 { 629 #ifdef KDEBUG630 561 if (TEST_OPT_DEBUG) PrintS("+"); 631 #endif632 562 /* 633 563 * the polynomial to reduce with is now: … … 639 569 else 640 570 { 641 #ifdef KDEBUG642 571 if (TEST_OPT_DEBUG) PrintS("-"); 643 #endif644 572 } 645 573 } … … 662 590 /*- h will not become the next element to reduce -*/ 663 591 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 664 #ifdef KDEBUG665 592 if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at); 666 #endif667 593 (*h).p = NULL; 668 594 strat->fromT = FALSE; … … 678 604 } 679 605 } 680 #ifdef KDEBUG681 606 if (TEST_OPT_DEBUG) 682 607 { … … 685 610 wrp(pi); 686 611 } 687 #endif688 612 doRed(h,&pi,strat->fromT,strat); 689 613 strat->fromT=FALSE; 690 #ifdef KDEBUG691 614 if (TEST_OPT_DEBUG) 692 #endif693 615 { 694 616 PrintS(" to "); … … 716 638 if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp)) 717 639 { 718 #ifdef KDEBUG719 640 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 720 #endif721 641 return; 722 642 } … … 743 663 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 744 664 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 745 #ifdef KDEBUG746 665 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 747 #endif748 666 (*h).p = NULL; 749 667 return; … … 756 674 } 757 675 j = 0; 758 #ifdef KDEBUG759 676 if TEST_OPT_DEBUG PrintLn(); 760 #endif761 677 } 762 678 else 763 679 { 764 #ifdef KDEBUG765 680 if (TEST_OPT_DEBUG) PrintS("-"); 766 #endif767 681 j++; 768 682 } … … 791 705 if (j > strat->tl) 792 706 { 793 #ifdef KDEBUG794 707 if (TEST_OPT_DEBUG) PrintLn(); 795 #endif796 708 return H.p; 797 709 } 798 #ifdef KDEBUG799 710 if (TEST_OPT_DEBUG) Print("%d",j); 800 #endif801 711 if (pDivisibleBy1(strat->T[j].p,H.p)) 802 712 { 803 713 //if (strat->interpt) test_int_std(strat->kIdeal); 804 #ifdef KDEBUG805 714 if (TEST_OPT_DEBUG) PrintS("+"); 806 #endif807 715 /*- remember the found T-poly -*/ 808 716 pi = strat->T[j].p; … … 820 728 if (j > strat->tl) break; 821 729 if (ei <= H.ecart) break; 822 #ifdef KDEBUG823 730 if (TEST_OPT_DEBUG) Print("%d",j); 824 #endif825 731 if (((strat->T[j].ecart < ei) 826 732 || ((strat->T[j].ecart == ei) … … 828 734 && pDivisibleBy1(strat->T[j].p,H.p)) 829 735 { 830 #ifdef KDEBUG831 736 if (TEST_OPT_DEBUG) PrintS("+"); 832 #endif833 737 /* 834 738 * the polynomial to reduce with is now; … … 840 744 else 841 745 { 842 #ifdef KDEBUG843 746 if (TEST_OPT_DEBUG) PrintS("-"); 844 #endif845 747 } 846 748 } … … 863 765 if (H.p == NULL) 864 766 { 865 #ifdef KDEBUG866 767 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 867 #endif868 768 return NULL; 869 769 } … … 877 777 if (H.p == NULL) 878 778 { 879 #ifdef KDEBUG880 779 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 881 #endif882 780 return NULL; 883 781 } … … 891 789 else 892 790 { 893 #ifdef KDEBUG894 791 if (TEST_OPT_DEBUG) PrintS("-"); 895 #endif896 792 j++; 897 793 } … … 1261 1157 strat->ecartS[atS] = p.ecart; 1262 1158 strat->sl++; 1263 #ifdef KDEBUG1264 1159 if (TEST_OPT_DEBUG) 1265 1160 { … … 1268 1163 PrintLn(); 1269 1164 } 1270 #endif1271 1165 if ((!strat->kHEdgeFound) || (strat->kNoether!=NULL)) HEckeTest(p.p,strat); 1272 1166 if (strat->kHEdgeFound) … … 1447 1341 if (lrmax< strat->Ll) lrmax=strat->Ll; /*stat*/ 1448 1342 //test_int_std(strat->kIdeal); 1449 #ifdef KDEBUG1450 1343 if (TEST_OPT_DEBUG) messageSets(strat); 1451 #endif1452 1344 if (TEST_OPT_DEGBOUND 1453 1345 && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p)> Kstd1_deg)) … … 1564 1456 } 1565 1457 if (strat->P.lcm!=NULL) pFree1(strat->P.lcm); 1566 #ifdef KDEBUG1567 1458 strat->P.lcm=NULL; 1568 #endif1569 1459 #ifdef SDRING 1570 1460 } … … 1867 1757 if (TEST_OPT_SB_1) 1868 1758 strat->newIdeal = newIdeal; 1869 if (rField_has_simple_inverse() || rField_is_R())1759 if (rField_has_simple_inverse()) 1870 1760 strat->LazyPass=20; 1871 1761 else … … 2082 1972 if(!TEST_OPT_RETURN_SB) 2083 1973 strat->syzComp = syzComp; 2084 if (rField_has_simple_inverse() || rField_is_R())1974 if (rField_has_simple_inverse()) 2085 1975 strat->LazyPass=20; 2086 1976 else -
Singular/kstd2.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 3 1999-03-08 17:30:39Singular Exp $ */4 /* $Id: kstd2.cc,v 1.24 1999-04-29 11:38:46 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 81 81 } 82 82 } 83 #ifdef KDEBUG84 83 if (TEST_OPT_DEBUG) 85 84 { … … 88 87 PrintS(" "); 89 88 } 90 #endif91 89 loop 92 90 { 93 #ifdef KDEBUG94 91 if (TEST_OPT_DEBUG) Print("%d",j); 95 #endif96 92 if (pDivisibleBy(strat->S[j],(*h).p)) 97 93 { 98 #ifdef KDEBUG99 94 if (TEST_OPT_DEBUG) 100 95 { … … 102 97 wrp(strat->S[j]); 103 98 } 104 #endif105 99 if ((!exchanged) && (pEqual((*h).p,strat->S[j]))) 106 100 { … … 136 130 if ((*h).p == NULL) 137 131 { 138 #ifdef KDEBUG139 132 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 140 #endif141 133 if (h->lcm!=NULL) pFree1((*h).lcm); 142 134 #ifdef KDEBUG … … 194 186 * and the case of a degree-ordering 195 187 */ 196 #ifdef KDEBUG197 188 static reductions = 0; 198 #endif199 189 200 190 static void redHomog (LObject* h,kStrategy strat) … … 208 198 int j = 0; 209 199 210 #ifdef KDEBUG211 200 if (TEST_OPT_DEBUG) 212 201 { … … 215 204 PrintS(" "); 216 205 } 217 #endif218 206 if (strat->ak!=0) 219 207 { 220 208 loop 221 209 { 222 #ifdef KDEBUG223 210 if (TEST_OPT_DEBUG) Print("%d",j); 224 #endif225 211 if (pDivisibleBy1(strat->S[j],(*h).p)) 226 212 { 227 #ifdef KDEBUG228 213 reductions++; 229 214 if (TEST_OPT_DEBUG) … … 232 217 wrp(strat->S[j]); 233 218 } 234 #endif235 219 //if (strat->interpt) test_int_std(strat->kIdeal); 236 220 /*- compute the s-polynomial -*/ … … 239 223 if ((*h).p == NULL) 240 224 { 241 #ifdef KDEBUG242 225 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 243 #endif244 226 if (h->lcm!=NULL) pFree1((*h).lcm); 245 227 #ifdef KDEBUG … … 266 248 loop 267 249 { 268 #ifdef KDEBUG269 250 if (TEST_OPT_DEBUG) Print("%d",j); 270 #endif271 251 if (pDivisibleBy2(strat->S[j],(*h).p)) 272 252 { 273 #ifdef KDEBUG274 253 reductions++; 275 254 if (TEST_OPT_DEBUG) … … 278 257 wrp(strat->S[j]); 279 258 } 280 #endif281 259 //if (strat->interpt) test_int_std(strat->kIdeal); 282 260 /*- compute the s-polynomial -*/ … … 285 263 if ((*h).p == NULL) 286 264 { 287 #ifdef KDEBUG288 265 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 289 #endif290 266 if (h->lcm!=NULL) pFree1((*h).lcm); 291 267 #ifdef KDEBUG … … 294 270 return; 295 271 } 296 #ifdef KDEBUG297 272 if (TEST_OPT_DEBUG) 298 273 { … … 301 276 PrintS("\n"); 302 277 } 303 #endif304 278 j = 0; 305 279 } … … 332 306 int k = 0; 333 307 334 #ifdef KDEBUG335 308 if (TEST_OPT_DEBUG) 336 309 { … … 339 312 PrintS(" "); 340 313 } 341 #endif342 314 if (strat->ak) 343 315 { 344 316 loop 345 317 { 346 #ifdef KDEBUG347 318 if (TEST_OPT_DEBUG) Print("%d",j); 348 #endif349 319 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 350 320 { 351 321 //if (strat->interpt) test_int_std(strat->kIdeal); 352 #ifdef KDEBUG353 322 if (TEST_OPT_DEBUG) 354 323 { … … 356 325 wrp(strat->S[j]); 357 326 } 358 #endif359 327 /*- compute the s-polynomial -*/ 360 328 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, … … 362 330 if ((*h).p == NULL) 363 331 { 364 #ifdef KDEBUG365 332 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 366 #endif367 333 if (h->lcm!=NULL) pFree1((*h).lcm); 368 334 #ifdef KDEBUG … … 396 362 397 363 // no module component 398 #ifdef KDEBUG399 364 if (TEST_OPT_DEBUG) Print("%d",j); 400 #endif401 365 if (pDivisibleBy2(strat->T[j].p,(*h).p)) 402 366 { 403 367 //if (strat->interpt) test_int_std(strat->kIdeal); 404 #ifdef KDEBUG405 368 if (TEST_OPT_DEBUG) 406 369 { … … 408 371 wrp(strat->S[j]); 409 372 } 410 #endif411 373 /*- compute the s-polynomial -*/ 412 374 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, … … 414 376 if ((*h).p == NULL) 415 377 { 416 #ifdef KDEBUG417 378 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 418 #endif419 379 if (h->lcm!=NULL) pFree1((*h).lcm); 420 380 #ifdef KDEBUG … … 462 422 int reddeg = pFDeg((*h).p); 463 423 464 #ifdef KDEBUG465 424 if (TEST_OPT_DEBUG) 466 425 { … … 469 428 PrintS(" "); 470 429 } 471 #endif472 430 loop 473 431 { … … 475 433 { 476 434 //if (strat->interpt) test_int_std(strat->kIdeal); 477 #ifdef KDEBUG478 435 if (TEST_OPT_DEBUG) 479 436 { … … 481 438 wrp(strat->S[j]); 482 439 } 483 #endif484 440 /*- compute the s-polynomial -*/ 485 441 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether … … 487 443 if ((*h).p == NULL) 488 444 { 489 #ifdef KDEBUG490 445 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 491 #endif492 446 if (h->lcm!=NULL) pFree1((*h).lcm); 493 447 #ifdef KDEBUG … … 523 477 } 524 478 while (!pDivisibleBy1(strat->S[i],(*h).p)); 525 #ifdef KDEBUG526 479 if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at); 527 #endif528 480 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 529 481 (*h).p = NULL; … … 542 494 if (j >= strat->sl) 543 495 { 544 #ifdef KDEBUG545 496 if (TEST_OPT_DEBUG) PrintLn(); 546 #endif547 497 if (TEST_OPT_INTSTRATEGY) 548 498 { … … 576 526 pass = j = 0; 577 527 d = reddeg = pFDeg((*h).p)+(*h).ecart; 578 #ifdef KDEBUG579 528 if (TEST_OPT_DEBUG) 580 529 { … … 582 531 wrp((*h).p); 583 532 } 584 #endif585 533 loop 586 534 { 587 535 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 588 536 { 589 #ifdef KDEBUG590 537 if (TEST_OPT_DEBUG) Print(" T[%d]",j); 591 #endif592 538 pi = strat->T[j].p; 593 539 ei = strat->T[j].ecart; … … 607 553 if ((strat->T[i].ecart < ei) && pDivisibleBy1(strat->T[i].p,(*h).p)) 608 554 { 609 #ifdef KDEBUG610 555 if (TEST_OPT_DEBUG) Print(" T[%d]",i); 611 #endif612 556 /* 613 557 * the polynomial to reduce with is now; … … 635 579 { 636 580 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 637 #ifdef KDEBUG638 581 if (TEST_OPT_DEBUG) Print(" ecart too big: -> L%d\n",at); 639 #endif640 582 (*h).p = NULL; 641 583 return; … … 650 592 } 651 593 } 652 #ifdef KDEBUG653 594 if (TEST_OPT_DEBUG) 654 595 { … … 656 597 wrp(pi); 657 598 } 658 #endif659 599 if (strat->fromT) 660 600 { … … 665 605 else 666 606 (*h).p = spSpolyRed(pi,(*h).p,strat->kNoether, strat->spSpolyLoop); 667 #ifdef KDEBUG668 607 if (TEST_OPT_DEBUG) 669 608 { … … 672 611 PrintLn(); 673 612 } 674 #endif675 613 if ((*h).p == NULL) 676 614 { … … 726 664 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 727 665 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 728 #ifdef KDEBUG729 666 if (TEST_OPT_DEBUG) 730 667 Print(" degree jumped: -> L%d\n",at); 731 #endif732 668 (*h).p = NULL; 733 669 return; … … 745 681 if (j >= strat->tl) 746 682 { 747 #ifdef KDEBUG748 683 if (TEST_OPT_DEBUG) PrintLn(); 749 #endif750 684 if (TEST_OPT_INTSTRATEGY) 751 685 { … … 929 863 int z = 3; 930 864 931 #ifdef KDEBUG932 865 if (TEST_OPT_DEBUG) 933 866 { 934 867 PrintS("red:");wrp(h); 935 868 } 936 #endif937 869 if (0 > strat->sl) 938 870 { 939 #ifdef KDEBUG940 871 if (TEST_OPT_DEBUG) PrintLn(); 941 #endif942 872 return h; 943 873 } … … 948 878 //if (strat->interpt) test_int_std(strat->kIdeal); 949 879 /*- compute the s-polynomial -*/ 950 #ifdef KDEBUG951 880 if (TEST_OPT_DEBUG) 952 881 { 953 882 Print("\nwith S[%d]:",j);wrp(strat->S[j]); 954 883 } 955 #endif956 884 h = spSpolyRed(strat->S[j],h,strat->kNoether, strat->spSpolyLoop); 957 #ifdef KDEBUG958 885 if (TEST_OPT_DEBUG) 959 886 { … … 962 889 if (h==NULL) PrintLn(); 963 890 } 964 #endif965 891 if (h == NULL) return NULL; 966 892 z++; … … 1078 1004 { 1079 1005 if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/ 1080 #ifdef KDEBUG1081 1006 if (TEST_OPT_DEBUG) messageSets(strat); 1082 #endif1083 1007 //test_int_std(strat->kIdeal); 1084 1008 if (strat->Ll== 0) strat->interpt=TRUE; … … 1231 1155 } 1232 1156 } 1233 #ifdef KDEBUG1234 1157 if (TEST_OPT_DEBUG) 1235 1158 { … … 1238 1161 PrintLn(); 1239 1162 } 1240 #endif1241 1163 if((strat->P.p1==NULL) && (strat->minim>0)) 1242 1164 { … … 1292 1214 if((stdTrace!=NULL && stdTrace->ResultSend) || (stdTrace == NULL)) 1293 1215 { 1294 #ifdef KDEBUG1295 1216 if (TEST_OPT_DEBUG) messageSets(strat); 1296 #endif1297 1217 /* complete reduction of the standard basis--------- */ 1298 1218 if (TEST_OPT_REDSB) completeReduce(strat); … … 1358 1278 { 1359 1279 if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/ 1360 #ifdef KDEBUG1361 1280 if (TEST_OPT_DEBUG) messageSets(strat); 1362 #endif1363 1281 //test_int_std(strat->kIdeal); 1364 1282 if (strat->Ll== 0) strat->interpt=TRUE; … … 1486 1404 } 1487 1405 } 1488 #ifdef KDEBUG1489 1406 if (TEST_OPT_DEBUG) 1490 1407 { … … 1493 1410 PrintLn(); 1494 1411 } 1495 #endif1496 1412 if((strat->P.p1==NULL) && (strat->minim>0)) 1497 1413 { … … 1529 1445 kTest(strat); 1530 1446 } 1531 #ifdef KDEBUG1532 1447 if (TEST_OPT_DEBUG) messageSets(strat); 1533 #endif1534 1448 /* complete reduction of the standard basis--------- */ 1535 1449 if (TEST_OPT_REDSB) completeReduce(strat); … … 1680 1594 kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy)); 1681 1595 1682 if (rField_has_simple_inverse() || rField_is_R())1596 if (rField_has_simple_inverse()) 1683 1597 strat->LazyPass=20; 1684 1598 else -
Singular/kstdfac.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1.2 1 1999-03-08 17:30:39Singular Exp $ */4 /* $Id: kstdfac.cc,v 1.22 1999-04-29 11:38:47 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 753 753 sleftv v; memset(&v,0,sizeof(v)); 754 754 755 if (rField_has_simple_inverse() || rField_is_R())755 if (rField_has_simple_inverse()) 756 756 strat->LazyPass=20; 757 757 else -
Singular/kutil.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.3 1 1998-11-16 08:41:18 Singular Exp $ */4 /* $Id: kutil.cc,v 1.32 1999-04-29 11:38:48 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 3147 3147 && ((strat->fromQ==NULL) || (strat->fromQ[i]==0))) 3148 3148 { 3149 #ifdef KDEBUG3150 3149 if (TEST_OPT_DEBUG) 3151 3150 { … … 3153 3152 wrp(strat->S[i]); 3154 3153 } 3155 #endif3156 3154 pDelete(&redSi); 3157 3155 redSi = pHead(strat->S[i]); … … 3170 3168 { 3171 3169 pDelete(&redSi); 3172 #ifdef KDEBUG3173 3170 if (TEST_OPT_DEBUG) PrintS(" to 0"); 3174 #endif3175 3171 deleteInS(i,strat); 3176 3172 i--; … … 3202 3198 if (h.p!=NULL) 3203 3199 { 3204 #ifdef KDEBUG3205 3200 if (TEST_OPT_DEBUG) 3206 3201 { … … 3209 3204 PrintLn(); 3210 3205 } 3211 #endif3212 3206 if (TEST_OPT_INTSTRATEGY) 3213 3207 { … … 3239 3233 pNorm(strat->S[i]); 3240 3234 } 3241 #ifdef KDEBUG3242 3235 if (TEST_OPT_DEBUG) 3243 3236 { … … 3245 3238 wrp(strat->S[i]); 3246 3239 } 3247 #endif3248 3240 } 3249 #ifdef KDEBUG3250 3241 if (TEST_OPT_DEBUG) PrintLn(); 3251 #endif3252 3242 } 3253 3243 i++; … … 3579 3569 * - in local rings, - in lex order case, -in ring over extensions */ 3580 3570 strat->noTailReduction = !TEST_OPT_REDTAIL; 3581 #ifdef KDEBUG3582 3571 if (TEST_OPT_DEBUG) 3583 3572 { … … 3585 3574 else PrintS("ideal/module is not homogeneous\n"); 3586 3575 } 3587 #endif3588 3576 } 3589 3577 … … 3883 3871 } 3884 3872 strat->HCord=j; 3885 #ifdef KDEBUG3886 3873 if (TEST_OPT_DEBUG) 3887 3874 { … … 3890 3877 PrintLn(); 3891 3878 } 3892 #endif3893 3879 } 3894 3880 if (pComp(strat->kNoether,newNoether)!=1) -
Singular/longrat.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1.1 7 1998-05-27 17:14:06Singular Exp $ */4 /* $Id: longrat.cc,v 1.18 1999-04-29 11:38:49 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 1941 1941 void nlNormalize (number &x) 1942 1942 { 1943 #ifdef LDEBUG1944 nlTest(x);1945 #endif1946 1943 if ((SR_HDL(x) & SR_INT) ||(x==NULL)) 1947 1944 return; 1945 #ifdef LDEBUG 1946 nlTest(x); 1947 #endif 1948 1948 if (x->s==3) 1949 1949 { -
Singular/mpsr.h
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr.h,v 1.1 4 1999-03-08 18:11:48Singular Exp $ */4 /* $Id: mpsr.h,v 1.15 1999-04-29 11:38:51 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 100 100 { 101 101 #ifdef PDEBUG 102 nSetChar(r InternalChar(rg), TRUE, rg->parameter,rPar(rg));102 nSetChar(rg, TRUE); 103 103 #else 104 nSetChar(r InternalChar(rg), complete, rg->parameter,rPar(rg));104 nSetChar(rg, complete); 105 105 #endif 106 106 pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1, -
Singular/mpsr_GetMisc.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_GetMisc.cc,v 1.1 3 1999-03-08 18:11:49Singular Exp $ */4 /* $Id: mpsr_GetMisc.cc,v 1.14 1999-04-29 11:38:52 Singular Exp $ */ 5 5 6 6 /*************************************************************** … … 38 38 { 39 39 // check for currRing 40 if (currRing != NULL && rInternalChar(currRing) == ch) 40 if (currRing != NULL && rInternalChar(currRing) == ch) 41 41 // orig: currRing->ch==ch ??? 42 42 { 43 43 int i, n = currRing->N; 44 44 char **names = currRing->names; 45 45 46 46 for (i=0; i<n; i++) 47 47 { … … 60 60 ring mpsr_rDefault(short ch) 61 61 { 62 if (currRing != NULL && rInternalChar(currRing) == ch) 62 if (currRing != NULL && rInternalChar(currRing) == ch) 63 63 // orig: currRing->ch==ch ??? 64 64 { … … 157 157 int i, n; 158 158 poly *m1, *m2; 159 159 160 160 if (id2 == NULL) return 0; 161 161 if ((n = IDELEMS(id1)) != IDELEMS(id2)) return 0; … … 172 172 } 173 173 174 174 175 175 // returns TRUE, if r1 less or equals r2 176 176 // FALSE, otherwise … … 201 201 r1->order[1] != r2->order[1]) 202 202 return 0; 203 203 204 204 for (i=0; i<rPar(r1);i++) 205 205 { … … 259 259 lv = mlv1->lv; 260 260 while (lv->next != NULL) lv = lv->next; 261 261 262 262 lv->next = mlv2->lv; 263 263 mlv1->r = r; … … 274 274 { 275 275 int i, n; 276 276 277 277 while (l != NULL) 278 278 { 279 279 short typ = l->Typ(); 280 280 281 281 switch(typ) 282 282 { … … 310 310 break; 311 311 } 312 312 313 313 case LIST_CMD: 314 314 { … … 342 342 mpsr_SetCurrRing(to_ring, TRUE); 343 343 nSetMap(rInternalChar(from_ring), from_ring->parameter, 344 344 rPar(from_ring), from_ring->minpoly); 345 345 l->data = (void *) nMap(nn); 346 346 mpsr_SetCurrRing(from_ring, FALSE); … … 351 351 } 352 352 } 353 354 353 354 355 355 // searches for a ring handle which has a ring which is equal to r 356 356 // if one is found, then this one is set to the new global ring … … 366 366 return; 367 367 } 368 368 369 369 rTest(r); 370 370 // try to find an idhdl which is an equal ring … … 420 420 return grname; 421 421 } 422 422 423 423 // searches through the Singular namespace for a matching name: 424 424 // the first found is returned together witht the respective ring … … 431 431 #endif /* HAVE_NAMESPACES */ 432 432 r = NULL; 433 433 434 434 if (h != NULL) 435 435 { … … 445 445 h2 = (IDRING(h)->idroot!=NULL ?IDRING(h)->idroot->get(name, 0) : 446 446 (idhdl) NULL); 447 447 448 448 if (h2 != NULL) 449 449 { … … 550 550 #ifdef PARI_BIGINT_TEST 551 551 init(4000000, 2); 552 #endif 552 #endif 553 553 } 554 554 -
Singular/numbers.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: numbers.cc,v 1. 8 1999-01-21 15:00:08Singular Exp $ */4 /* $Id: numbers.cc,v 1.9 1999-04-29 11:38:52 Singular Exp $ */ 5 5 6 6 /* … … 18 18 #include "longalg.h" 19 19 #include "modulop.h" 20 #include "gnumpfl.h" 21 #include "ring.h" 20 22 #ifndef FAST_AND_DIRTY 21 23 #undef npMultM … … 88 90 * init operations for characteristic c (complete==TRUE) 89 91 * init nDelete for characteristic c (complete==FALSE) 90 * param: the names of the parameters (read-only)91 92 */ 92 void nSetChar( int c, BOOLEAN complete, char ** param, int pars)93 void nSetChar(ring r, BOOLEAN complete) 93 94 { 95 int c=rInternalChar(r); 96 94 97 if (nNULL!=NULL) 95 98 { … … 103 106 nSize = ndSize; 104 107 } 105 //Print("n:c=%d compl=%d param=%d\n",c,complete,param); 106 if ((c == 1) || (c< (-1))) 107 { 108 naSetChar(c,complete,param,pars); 108 //Print("n:c=%d compl=%d param=%d\n",c,complete,r->parameter); 109 //if ((c == 1) || (c< (-1))) 110 if (rField_is_Extension(r)) 111 { 112 naSetChar(c,complete,r->parameter,rPar(r)); 109 113 #ifdef LDEBUG 110 114 nDBDelete= naDBDelete; … … 152 156 } 153 157 else 154 if ( c == 0)158 if (rField_is_Q(r)) 155 159 { 156 160 #ifdef LDEBUG … … 195 199 } 196 200 } 197 else if ( (c>1)&&(param==NULL))201 else if (rField_is_Zp(r)) 198 202 /*----------------------char. p----------------*/ 199 203 { … … 241 245 } 242 246 else 243 if (c>1) 247 /* -------------- GF(p^m) -----------------------*/ 248 if (rField_is_GF(r)) 244 249 { 245 250 #ifdef LDEBUG … … 251 256 { 252 257 test &= ~Sy_bit(OPT_INTSTRATEGY); /*26*/ 253 nfSetChar(c, param);258 nfSetChar(c,r->parameter); 254 259 nNew = nDummy1; 255 260 nNormalize=nDummy2; … … 288 293 } 289 294 else 290 //if (c==(-1)) // the rest... 295 /* -------------- R -----------------------*/ 296 //if (c==(-1)) 297 if (rField_is_R(r)) 291 298 { 292 299 #ifdef LDEBUG … … 330 337 } 331 338 } 339 else 340 /* -------------- long R -----------------------*/ 341 if (rField_is_long_R(r)) 342 { 343 setGMPFloatPrecBytes(r->ch_flags); 344 #ifdef LDEBUG 345 nDBDelete= ngfDBDelete; 346 #else 347 nDelete= ngfDelete; 348 #endif 349 if (complete) 350 { 351 nNew=ngfNew; 352 nNormalize=nDummy2; 353 nInit = ngfInit; 354 nInt = ngfInt; 355 nAdd = ngfAdd; 356 nSub = ngfSub; 357 nMult = ngfMult; 358 nDiv = ngfDiv; 359 nExactDiv= ngfDiv; 360 nIntDiv= ngfDiv; 361 nIntMod= ngfIntMod; 362 nNeg = ngfNeg; 363 nInvers= ngfInvers; 364 nCopy = ngfCopy; 365 nGreater = ngfGreater; 366 nEqual = ngfEqual; 367 nIsZero = ngfIsZero; 368 nIsOne = ngfIsOne; 369 nIsMOne = ngfIsMOne; 370 nGreaterZero = ngfGreaterZero; 371 nWrite = ngfWrite; 372 nRead = ngfRead; 373 nPower = ngfPower; 374 nGcd = ndGcd; 375 nLcm = ndGcd; /* tricky, isn't it ?*/ 376 nSetMap=ngfSetMap; 377 nName=ndName; 378 /*nSize = ndSize;*/ 379 #ifdef LDEBUG 380 nDBTest=ngfDBTest; 381 #endif 382 } 383 } 384 #ifdef TEST 385 else 386 { 387 WerrorS("unknown field"); 388 } 389 #endif 332 390 if (complete&&(!errorreported)) nNULL=nInit(0); 333 391 } -
Singular/numbers.h
r4be737 r8a150b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1. 5 1997-08-12 17:14:42Singular Exp $ */6 /* $Id: numbers.h,v 1.6 1999-04-29 11:38:54 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 65 65 #endif 66 66 int nGetChar(); 67 void nSetChar( int c, BOOLEAN complete, char **param, int pars);67 void nSetChar(ring r, BOOLEAN complete); 68 68 69 69 #ifndef FAST_AND_DIRTY -
Singular/polys0.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys0.cc,v 1. 9 1998-10-06 08:24:27Singular Exp $ */4 /* $Id: polys0.cc,v 1.10 1999-04-29 11:38:54 Singular Exp $ */ 5 5 6 6 /* … … 27 27 BOOLEAN wroteCoef=FALSE,writeGen=FALSE; 28 28 29 nNormalize(pGetCoeff(p)); 29 if (pGetCoeff(p)!=NULL) 30 nNormalize(pGetCoeff(p)); 30 31 31 32 if (((pGetComp(p) == (short)ko) -
Singular/polys1.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys1.cc,v 1.2 0 1999-04-14 18:32:00Singular Exp $ */4 /* $Id: polys1.cc,v 1.21 1999-04-29 11:38:55 Singular Exp $ */ 5 5 6 6 /* … … 493 493 if (rc == NULL) 494 494 return pMonPower(p,i); 495 495 /* else: binom */ 496 496 int char_p=rChar(currRing); 497 497 if (pNext(rc) != NULL) 498 498 return pPow(p,i); 499 500 501 502 499 if ((char_p==0) || (i<=char_p)) 500 return pTwoMonPower(p,i); 501 poly p_p=pTwoMonPower(pCopy(p),char_p); 502 return pMult(pPower(p,i-char_p),p_p); 503 503 } 504 504 /*end default:*/ -
Singular/ring.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.5 1 1999-04-17 12:30:23Singular Exp $ */4 /* $Id: ring.cc,v 1.52 1999-04-29 11:38:56 Singular Exp $ */ 5 5 6 6 /* … … 71 71 72 72 /*------------ global variables related to coefficients ------------*/ 73 nSetChar(r ->ch, complete, r->parameter, rPar(r));73 nSetChar(r, complete); 74 74 75 75 /*------------ global variables related to polys -------------------*/ … … 319 319 return TRUE; 320 320 } 321 321 322 322 // initialize fields of R 323 323 R->order=(int *)Alloc0(n*sizeof(int)); … … 403 403 break; 404 404 } 405 405 406 406 case ringorder_no: 407 407 R->order[n] = ringorder_unspec; 408 408 return TRUE; 409 409 410 410 default: 411 411 Werror("Internal Error: Unknown ordering %d", (*iv)[1]); … … 416 416 } 417 417 418 // check for complete coverage 418 // check for complete coverage 419 419 if ((R->order[n]==ringorder_c) || (R->order[n]==ringorder_C)) n--; 420 420 if (R->block1[n] != R->N) … … 426 426 (R->order[n]==ringorder_lp) || 427 427 (R->order[n]==ringorder_ls)) 428 && 428 && 429 429 R->block0[n] <= R->N) 430 430 { … … 445 445 static BOOLEAN rSleftvList2StringArray(sleftv* sl, char** p) 446 446 { 447 447 448 448 while(sl!=NULL) 449 449 { … … 454 454 sleftv s_sl; 455 455 iiConvert(POLY_CMD,ANY_TYPE,-1,sl,&s_sl); 456 if (s_sl.Name() != sNoName) 456 if (s_sl.Name() != sNoName) 457 457 *p = mstrdup(s_sl.Name()); 458 458 else … … 460 460 sl->next = s_sl.next; 461 461 s_sl.next = NULL; 462 s_sl.CleanUp(); 462 s_sl.CleanUp(); 463 463 if (*p == NULL) return TRUE; 464 464 } … … 478 478 // 479 479 // rInit itself: 480 // 480 // 481 481 // INPUT: s: name, pn: ch & parameter (names), rv: variable (names) 482 482 // ord: ordering 483 // RETURN: currRingHdl on success 483 // RETURN: currRingHdl on success 484 484 // NULL on error 485 485 // NOTE: * makes new ring to current ring, on success … … 489 489 { 490 490 int ch; 491 int float_len=0; 491 492 ring R = NULL; 492 493 idhdl tmp = NULL; … … 502 503 { 503 504 ch=-1; 505 if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD)) 506 { 507 float_len=(int)pn->next->Data(); 508 pn=pn->next; 509 } 504 510 } 505 511 else … … 509 515 } 510 516 pn=pn->next; 511 517 512 518 /* characteristic -----------------------------------------------*/ 513 519 /* input: 0 ch=0 : Q parameter=NULL ffChar=FALSE … … 521 527 { 522 528 int l = 0; 523 524 if (ch!=0 && (ch<2) || (ch > 32003)) 529 530 if (ch!=0 && (ch<2) || (ch > 32003)) 525 531 { 526 532 Warn("%d is invalid characteristic of ground field. 32003 is used.", ch); … … 546 552 R = (ring) Alloc0(sizeof(sip_sring)); 547 553 R->ch = ch; 548 554 if (ch == -1) 555 { 556 R->ch_flags= float_len; 557 } 558 549 559 /* parameter -------------------------------------------------------*/ 550 560 if (pn!=NULL) … … 579 589 goto rInitError; 580 590 } 581 591 582 592 /* ordering -------------------------------------------------------------*/ 583 593 if (rSleftvOrdering2Ordering(ord, R)) … … 587 597 if (rComplete(R)) 588 598 goto rInitError; 589 599 590 600 // try to enter the ring into the name list // 591 601 if ((tmp = enterid(s, myynest, RING_CMD, &IDROOT))==NULL) 592 602 goto rInitError; 593 603 594 604 memcpy(IDRING(tmp),R,sizeof(*R)); 595 605 // set current ring … … 611 621 BOOLEAN rComplete(ring r, int force) 612 622 { 613 623 614 624 int VarCompIndex, VarLowIndex, VarHighIndex; 615 625 // check number of vars and number of params 616 626 if (r->N + 1 > (int) MAX_EXPONENT_NUMBER) 617 627 { 618 Werror("Too many ring variables: %d is the maximum", 628 Werror("Too many ring variables: %d is the maximum", 619 629 MAX_EXPONENT_NUMBER -1); 620 630 return TRUE; 621 631 } 622 632 623 633 624 634 r->VarOffset = (int*) Alloc((r->N + 1)*sizeof(int)); … … 694 704 PrintS("// characteristic : "); 695 705 if ( rField_is_R(r) ) PrintS("0 (real)\n"); /* R */ 696 else Print ("%d\n",rChar(r)); /* Fp(a) */ 706 else if ( rField_is_long_R(r) ) 707 Print("0 (real:%d digits)\n",r->ch_flags); /* long R */ 708 else 709 Print ("%d\n",rChar(r)); /* Fp(a) */ 697 710 if (r->parameter!=NULL) 698 711 { … … 780 793 { 781 794 int i, j; 782 795 783 796 if (r == NULL) return; 784 797 785 798 // delete order stuff 786 799 if (r->order != NULL) … … 804 817 assume(r->block0 == NULL && r->block1 == NULL && r->wvhdl == NULL); 805 818 } 806 819 807 820 // delete varnames 808 821 if(r->names!=NULL) … … 814 827 Free((ADDRESS)r->names,r->N*sizeof(char *)); 815 828 } 816 829 817 830 // delete parameter 818 831 if (r->parameter!=NULL) … … 828 841 Free((ADDRESS)r->parameter,rPar(r)*sizeof(char *)); 829 842 } 830 if (r->VarOffset != NULL) 843 if (r->VarOffset != NULL) 831 844 Free((ADDRESS)r->VarOffset, (r->N +1)*sizeof(int)); 832 845 Free(r, sizeof(ip_sring)); … … 1301 1314 if (r2->minpoly!=NULL) 1302 1315 { 1303 nSetChar(r InternalChar(r1),TRUE,r1->parameter,rPar(r1));1316 nSetChar(r1,TRUE); 1304 1317 if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */ 1305 1318 && naEqual(r1->minpoly,r2->minpoly)) … … 1309 1322 tmpR.minpoly=naCopy(r1->minpoly); 1310 1323 tmpR.P=1; 1311 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1312 rPar(currRing)); 1324 nSetChar(currRing,TRUE); 1313 1325 } 1314 1326 else 1315 1327 { 1316 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1317 rPar(currRing)); 1328 nSetChar(currRing,TRUE); 1318 1329 WerrorS("different minpolys"); 1319 1330 return -1; … … 1328 1339 tmpR.parameter[0]=mstrdup(r1->parameter[0]); 1329 1340 tmpR.P=1; 1330 nSetChar(r InternalChar(r1),TRUE,r1->parameter,rPar(r1));1341 nSetChar(r1,TRUE); 1331 1342 tmpR.minpoly=naCopy(r1->minpoly); 1332 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1333 rPar(currRing)); 1343 nSetChar(currRing,TRUE); 1334 1344 } 1335 1345 else … … 1350 1360 tmpR.parameter[0]=mstrdup(r1->parameter[0]); 1351 1361 tmpR.P=1; 1352 nSetChar(r InternalChar(r2),TRUE,r2->parameter,rPar(r2));1362 nSetChar(r2,TRUE); 1353 1363 tmpR.minpoly=naCopy(r2->minpoly); 1354 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1355 rPar(currRing)); 1364 nSetChar(currRing,TRUE); 1356 1365 } 1357 1366 else … … 1405 1414 if (r1->minpoly!=NULL) 1406 1415 { 1407 nSetChar(r InternalChar(r1),TRUE,r1->parameter,rPar(r1));1416 nSetChar(r1,TRUE); 1408 1417 tmpR.minpoly=naCopy(r1->minpoly); 1409 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1410 rPar(currRing)); 1418 nSetChar(currRing,TRUE); 1411 1419 } 1412 1420 } … … 1432 1440 if (r2->minpoly!=NULL) 1433 1441 { 1434 nSetChar(r InternalChar(r1),TRUE,r1->parameter,rPar(r1));1442 nSetChar(r1,TRUE); 1435 1443 tmpR.minpoly=naCopy(r2->minpoly); 1436 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1437 rPar(currRing)); 1444 nSetChar(currRing,TRUE); 1438 1445 } 1439 1446 } … … 1468 1475 if (r1->minpoly!=NULL) 1469 1476 { 1470 nSetChar(r InternalChar(r1),TRUE,r1->parameter,rPar(r1));1477 nSetChar(r1,TRUE); 1471 1478 tmpR.minpoly=naCopy(r1->minpoly); 1472 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1473 rPar(currRing)); 1479 nSetChar(currRing,TRUE); 1474 1480 } 1475 1481 } … … 1498 1504 if (r2->minpoly!=NULL) 1499 1505 { 1500 nSetChar(r InternalChar(r2),TRUE,r2->parameter,rPar(r2));1506 nSetChar(r2,TRUE); 1501 1507 tmpR.minpoly=naCopy(r2->minpoly); 1502 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1503 rPar(currRing)); 1508 nSetChar(currRing,TRUE); 1504 1509 } 1505 1510 } … … 1645 1650 tmpR.block0[i]=rb->block0[i]; 1646 1651 tmpR.block1[i]=rb->block1[i]; 1647 1648 1652 if (rb->wvhdl[i]!=NULL) 1653 WarnS("rSum: weights not implemented"); 1649 1654 } 1650 1655 tmpR.block0[0]=1; -
Singular/ring.h
r4be737 r8a150b 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.2 3 1999-03-19 14:18:06 obachmanExp $ */9 /* $Id: ring.h,v 1.24 1999-04-29 11:38:57 Singular Exp $ */ 10 10 11 11 /* includes */ … … 59 59 { return (r->ch == 0) && (r->parameter==NULL); } 60 60 inline BOOLEAN rField_is_R(ring r=currRing) 61 { return (r->ch == -1) ; }61 { return (r->ch == -1) && (r->ch_flags==0); } 62 62 inline BOOLEAN rField_is_GF(ring r=currRing) 63 63 { return (r->ch > 1) && (r->parameter!=NULL); } … … 68 68 inline BOOLEAN rField_is_Q_a(ring r=currRing) 69 69 { return (r->ch == 1); } 70 inline BOOLEAN rField_is_long_R(ring r=currRing) 71 { return (r->ch == -1) && (r->ch_flags!=0); } 70 72 inline BOOLEAN rField_has_simple_inverse(ring r=currRing) 71 { return (r->ch>1); } /* Z/p and GF(p,n) */ 73 { return (r->ch>1) || (r->ch== -1); } /* Z/p and GF(p,n) and R and long_R*/ 74 inline BOOLEAN rField_is_Extension(ring r=currRing) 75 { return (rField_is_Q_a(r)) || (rField_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/ 72 76 73 77 enum -
Singular/spolys.cc
r4be737 r8a150b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: spolys.cc,v 1.1 8 1999-03-08 17:30:51Singular Exp $ */4 /* $Id: spolys.cc,v 1.19 1999-04-29 11:38:57 Singular Exp $ */ 5 5 6 6 /* … … 794 794 void spSet(ring r) 795 795 { 796 if (( !rField_has_simple_inverse(r))797 ||TEST_OPT_INTSTRATEGY /* Q, Q(a), Fp(a) */796 if ((TEST_OPT_INTSTRATEGY /* Q, Q(a), Fp(a) */ 797 || (rField_is_R()) || (rField_is_long_R())) 798 798 #ifdef SRING 799 799 && (pSRING==0) -
Singular/structs.h
r4be737 r8a150b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.1 8 1999-02-26 15:32:06Singular Exp $ */6 /* $Id: structs.h,v 1.19 1999-04-29 11:38:58 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 132 132 #endif 133 133 short ch; /* characteristic */ 134 short ch_flags; /* additional char-flags */ 134 135 short N; /* number of vars */ 135 136 -
Singular/utils.cc
r4be737 r8a150b 28 28 exit(1); 29 29 } 30 30 31 31 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 32 32 void main_init(int argc, char *argv[]) … … 87 87 procinfo *iiInitSingularProcinfo(procinfov pi, char *libname, 88 88 char *procname, int line, long pos, 89 89 BOOLEAN pstatic = FALSE) 90 90 { 91 91 pi->libname = (char *)malloc(strlen(libname)+1); … … 128 128 if(!found_info && !warning_info) warning_info++; 129 129 if(!found_version && !warning_version) warning_version++; 130 if(pi->data.s.body_end==0) 130 if(pi->data.s.body_end==0) 131 131 pi->data.s.body_end = pi->data.s.proc_end; 132 132 133 133 if(lpverbose) printf("// "); 134 134 printf( "%c %-15s %20s ", pi->is_static ? 'l' : 'g', pi->libname, 135 135 pi->procname); 136 136 printf("line %4d,%5ld-%-5ld %4d,%5ld-%-5ld %4d,%5ld-%-5ld\n", 137 138 139 140 137 pi->data.s.proc_lineno, pi->data.s.proc_start, pi->data.s.def_end, 138 pi->data.s.body_lineno, pi->data.s.body_start, pi->data.s.body_end, 139 pi->data.s.example_lineno, pi->data.s.example_start, 140 pi->data.s.proc_end); 141 141 if(check) { 142 142 if(!pi->is_static && (pi->data.s.body_start-pi->data.s.def_end)<4) 143 143 printf("*** Procedure '%s' is global and has no help-section.\n", 144 144 pi->procname); 145 145 if(!pi->is_static && !pi->data.s.example_start) 146 146 printf("*** Procedure '%s' is global and has no example-section.\n",\ 147 147 pi->procname); 148 148 if(found_proc_in_proc) 149 149 printf("*** found proc within procedure '%s'.\n", pi->procname); … … 153 153 if( fp != NULL) { // loading body 154 154 len1 = pi->data.s.def_end - pi->data.s.proc_start; 155 if(pi->data.s.body_end==0) 155 if(pi->data.s.body_end==0) 156 156 len2 = pi->data.s.proc_end - pi->data.s.body_start; 157 157 else len2 = pi->data.s.body_end - pi->data.s.body_start;
Note: See TracChangeset
for help on using the changeset viewer.