Changeset 942846 in git
- Timestamp:
- Oct 18, 1999, 1:19:30 PM (25 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 04033394eb7a0db6486441c5de8d4bde3f0a1da3
- Parents:
- 60a365f1c6147d79e7b175c37ff30a7f49a5293a
- Location:
- Singular
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/kstd1.cc
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.4 0 1999-10-14 17:59:33 SingularExp $ */4 /* $Id: kstd1.cc,v 1.41 1999-10-18 11:19:26 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 121 121 * requires thar T is sorted by ecart 122 122 */ 123 voidredEcart19 (LObject* h,kStrategy strat)123 int redEcart19 (LObject* h,kStrategy strat) 124 124 { 125 125 int i,at,reddeg,d; … … 137 137 if (j > strat->tl) 138 138 { 139 return ;139 return 1; 140 140 } 141 141 if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev)) … … 161 161 (*h).p = NULL; 162 162 strat->fromT = FALSE; 163 return ;163 return -1; 164 164 } 165 165 } … … 177 177 { 178 178 if (h->lcm!=NULL) pFree1((*h).lcm); 179 return ;179 return 0; 180 180 } 181 181 h->sev = pGetShortExpVector(h->p); … … 198 198 { 199 199 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 200 return ;200 return -2; 201 201 } 202 202 } … … 219 219 { 220 220 i--; 221 if (i<0) return ;221 if (i<0) return 1; 222 222 } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i], 223 223 (*h).p, not_sev)); … … 225 225 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 226 226 (*h).p = NULL; 227 return ;227 return -1; 228 228 } 229 229 } … … 246 246 * element in T with respect to the given ecart 247 247 */ 248 voidredEcart (LObject* h,kStrategy strat)248 int redEcart (LObject* h,kStrategy strat) 249 249 { 250 250 poly pi; … … 263 263 if (j > strat->tl) 264 264 { 265 return ;265 return 1; 266 266 } 267 267 if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev)) … … 318 318 (*h).p = NULL; 319 319 strat->fromT = FALSE; 320 return ;320 return -1; 321 321 } 322 322 } … … 334 334 { 335 335 if (h->lcm!=NULL) pFree1((*h).lcm); 336 return ;336 return 0; 337 337 } 338 338 h->sev = pGetShortExpVector(h->p); … … 356 356 { 357 357 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 358 return ;358 return -2; 359 359 } 360 360 } … … 377 377 { 378 378 i--; 379 if (i<0) return ;379 if (i<0) return 1; 380 380 } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i], 381 381 (*h).p, not_sev)); … … 383 383 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 384 384 (*h).p = NULL; 385 return ;385 return -1; 386 386 } 387 387 } … … 404 404 * element in t with respect to the given pDivisibleBy 405 405 */ 406 voidredFirst (LObject* h,kStrategy strat)406 int redFirst (LObject* h,kStrategy strat) 407 407 { 408 408 int at,reddeg,d,i; … … 410 410 int j = 0; 411 411 412 if (h->p == NULL) return ;412 if (h->p == NULL) return 0; 413 413 if (TEST_OPT_CANCELUNIT) cancelunit(h); 414 414 d = pFDeg((*h).p)+(*h).ecart; … … 422 422 { 423 423 assume(h->sev == pGetShortExpVector(h->p)); 424 return ;424 return 1; 425 425 } 426 426 if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev)) … … 451 451 if (h->lcm!=NULL) pFree1((*h).lcm); 452 452 h->sev = 0; 453 return ;453 return 0; 454 454 } 455 455 h->sev = pGetShortExpVector(h->p); … … 464 464 { 465 465 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 466 return ;466 return -2; 467 467 } 468 468 } … … 485 485 { 486 486 i--; 487 if (i<0) return ;487 if (i<0) return 1; 488 488 } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i], 489 489 (*h).p, not_sev)); … … 492 492 (*h).p = NULL; 493 493 h->sev = 0; 494 return ;494 return 0; 495 495 } 496 496 } … … 513 513 * element in t with respect to the ecart and length 514 514 */ 515 voidredMoraBest (LObject* h,kStrategy strat)515 int redMoraBest (LObject* h,kStrategy strat) 516 516 { 517 517 poly pi; … … 530 530 if (j > strat->tl) 531 531 { 532 return ;532 return 1; 533 533 } 534 534 if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev)) … … 584 584 (*h).p = NULL; 585 585 strat->fromT = FALSE; 586 return ;586 return -1; 587 587 } 588 588 } … … 600 600 { 601 601 if (h->lcm!=NULL) pFree1((*h).lcm); 602 return ;602 return 0; 603 603 } 604 604 h->sev = pGetShortExpVector(h->p); … … 621 621 { 622 622 if (TEST_OPT_DEBUG) PrintS(" > sysComp\n"); 623 return ;623 return -2; 624 624 } 625 625 } … … 642 642 { 643 643 i--; 644 if (i<0) return ;644 if (i<0) return 1; 645 645 } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i], 646 646 (*h).p, not_sev)); … … 648 648 if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at); 649 649 (*h).p = NULL; 650 return ;650 return -1; 651 651 } 652 652 } … … 1740 1740 //Print("%d reductions canceled \n",strat->cel); 1741 1741 HCord=strat->HCord; 1742 FreeSizeOf((ADDRESS)strat,skStrategy);1742 kFreeStrat(strat); 1743 1743 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 1744 1744 return r; … … 1852 1852 l->m[1].data=(void *)strat->M; 1853 1853 } 1854 FreeSizeOf((ADDRESS)strat,skStrategy);1854 kFreeStrat(strat); 1855 1855 if (reduced>2) 1856 1856 { … … 1872 1872 else 1873 1873 p=kNF2(F,Q,p,strat,lazyReduce); 1874 FreeSizeOf((ADDRESS)strat,skStrategy);1874 kFreeStrat(strat); 1875 1875 return p; 1876 1876 } … … 1889 1889 else 1890 1890 res=kNF2(F,Q,p,strat,lazyReduce); 1891 FreeSizeOf((ADDRESS)strat,skStrategy);1891 kFreeStrat(strat); 1892 1892 return res; 1893 1893 } … … 1948 1948 // } 1949 1949 ideal shdl=strat->Shdl; 1950 FreeSizeOf((ADDRESS)strat,skStrategy);1950 kFreeStrat(strat); 1951 1951 return shdl; 1952 1952 } -
Singular/kstd2.cc
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.3 5 1999-10-15 16:07:06obachman Exp $ */4 /* $Id: kstd2.cc,v 1.36 1999-10-18 11:19:27 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 47 47 */ 48 48 #if 0 49 static voidredSyz (LObject* h,kStrategy strat)49 static int redSyz (LObject* h,kStrategy strat) 50 50 { 51 51 int j = 0,i=0,pos; … … 196 196 #else 197 197 198 static voidredSyz (LObject* h,kStrategy strat)198 static int redSyz (LObject* h,kStrategy strat) 199 199 { 200 200 int j = 0,i=0,pos; … … 280 280 (*h).lcm=NULL; 281 281 #endif 282 return ;282 return 0; 283 283 } 284 284 /*- try to reduce the s-polynomial -*/ … … 296 296 { 297 297 pDelete(&((*h).p)); 298 return ;298 return 0; 299 299 } 300 300 else … … 320 320 } 321 321 enterTBba((*h),strat->tl+1,strat); 322 return ;322 return 1; 323 323 } 324 324 j++; … … 333 333 * and the case of a degree-ordering 334 334 */ 335 static void redHomog (LObject* h,kStrategy strat) 336 { 337 if (strat->tl<0) 338 { 339 if (TEST_OPT_INTSTRATEGY) pCleardenom(h->p); 340 enterTBba((*h),0,strat); 341 return; 342 } 335 static int redHomog (LObject* h,kStrategy strat) 336 { 337 if (strat->tl<0) return 1; 343 338 #ifdef KDEBUG 344 339 if (TEST_OPT_DEBUG) … … 363 358 } 364 359 365 if (j > strat->tl) 366 { 367 if (TEST_OPT_INTSTRATEGY) 368 { 369 pCleardenom(h->p); 370 enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat); 371 } 372 else 373 enterTBba((*h),strat->tl+1,strat); 374 return; 375 } 360 if (j > strat->tl) return 1; 376 361 377 362 // now we found one which is divisible … … 391 376 (*h).lcm=NULL; 392 377 #endif 393 return ;378 return 0; 394 379 } 395 380 } … … 401 386 * and not a degree-ordering 402 387 */ 403 static void redLazy (LObject* h,kStrategy strat) 404 { 405 if (strat->tl<0) 406 { 407 enterTBba((*h),0,strat); 408 return; 409 } 410 388 static int redLazy (LObject* h,kStrategy strat) 389 { 390 if (strat->tl<0) return 1; 411 391 int at,d,i; 412 392 int j = 0; … … 428 408 } 429 409 430 if (j>strat->tl) 431 { 432 if (TEST_OPT_INTSTRATEGY) 433 { 434 pCleardenom(h->p);// also does a pContent 435 } 436 enterTBba((*h),strat->tl+1,strat); 437 return; 438 } 410 if (j>strat->tl) return 1; 439 411 440 412 if (TEST_OPT_DEBUG) … … 445 417 wrp(strat->T[j].p); 446 418 } 419 447 420 ksReducePoly(h, &(strat->T[j]), strat->kNoether); 421 448 422 if (TEST_OPT_DEBUG) 449 423 { … … 452 426 PrintLn(); 453 427 } 428 454 429 if ((*h).p == NULL) 455 430 { … … 458 433 (*h).lcm=NULL; 459 434 #endif 460 return ;435 return 0; 461 436 } 462 437 h->sev = pGetShortExpVector(h->p); … … 474 449 { 475 450 i--; 476 if (i<0) 477 { 478 enterTBba((*h),strat->tl+1,strat); 479 return; 480 } 451 if (i<0) return 1; 481 452 } 482 453 while (!pShortDivisibleBy(strat->S[i], strat->sevS[i], … … 485 456 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 486 457 (*h).p = NULL; 487 return ;458 return -1; 488 459 } 489 460 } … … 501 472 * element in T with respect to the given ecart 502 473 */ 503 static void redHoney (LObject* h,kStrategy strat) 504 { 505 if (strat->tl<0) 506 { 507 enterTBba((*h),0,strat); 508 return; 509 } 474 static int redHoney (LObject* h,kStrategy strat) 475 { 476 if (strat->tl<0) return 1; 510 477 511 478 poly pi; … … 530 497 { 531 498 h->sev = ~ not_sev; 532 if (TEST_OPT_INTSTRATEGY) 533 { 534 pCleardenom(h->p);// also does a pContent 535 } 536 at=strat->posInT(strat->T,strat->tl,(*h)); 537 enterTBba((*h),at,strat); 538 return; 499 return 1; 539 500 } 540 501 … … 587 548 if (TEST_OPT_DEBUG) Print(" ecart too big: -> L%d\n",at); 588 549 (*h).p = NULL; 589 return ;550 return -1; 590 551 } 591 552 } … … 623 584 (*h).lcm=NULL; 624 585 #endif 625 return ;586 return 0; 626 587 } 627 588 h->sev = pGetShortExpVector(h->p); … … 650 611 { 651 612 i--; 652 if (i<0) 653 { 654 at=strat->posInT(strat->T,strat->tl,(*h)); 655 enterTBba((*h),at,strat); 656 return; 657 } 613 if (i<0) return 1; 658 614 } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i], 659 615 h->p, not_sev)); … … 662 618 Print(" degree jumped: -> L%d\n",at); 663 619 (*h).p = NULL; 664 return ;620 return -1; 665 621 } 666 622 } … … 677 633 * reduces with elements from T and chooses the best possible 678 634 */ 679 static void redBest (LObject* h,kStrategy strat) 680 { 681 if (strat->tl<0) 682 { 683 enterTBba((*h),0,strat); 684 return; 685 } 686 635 static int redBest (LObject* h,kStrategy strat) 636 { 637 if (strat->tl<0) return 1; 687 638 int j,jbest,at,reddeg,d,pass; 688 639 poly p,ph; … … 724 675 (*h).lcm=NULL; 725 676 #endif 726 return ;677 return 0; 727 678 } 728 679 else if (pComp0(ph,p) == -1) … … 749 700 #endif 750 701 (*h).p = NULL; 751 return ;702 return 0; 752 703 } 753 704 if (strat->honey && pLexOrder) … … 766 717 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 767 718 (*h).p = NULL; 768 return ;719 return -1; 769 720 } 770 721 } … … 780 731 else 781 732 { 782 if (j >= strat->tl) 783 { 784 if (TEST_OPT_INTSTRATEGY) 785 { 786 pCleardenom(h->p);// also does a pContent 787 } 788 at=strat->posInT(strat->T,strat->tl,(*h)); 789 enterTBba((*h),at,strat); 790 return; 791 } 733 if (j >= strat->tl) return 1; 792 734 j++; 793 735 } … … 864 806 strat->red = redHomog; 865 807 if (TEST_OPT_MINRES && strat->homog && (strat->syzComp >0)) 808 { 866 809 strat->red = redSyz; 810 strat->posInT = posInT0; 811 } 867 812 868 813 if (pLexOrder && strat->honey) … … 903 848 } 904 849 850 void kinitBbaHeaps(kStrategy heap) 851 { 852 #if 0 853 // use extra heap for monoms of T, if not syzcomp 854 if (!strat->red == redSyz) 855 { 856 strat->THeap = mmCreateTempHeap(); 857 } 858 #endif 859 } 860 905 861 906 862 ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat) 907 863 { 908 int srmax,lrmax ;864 int srmax,lrmax, red_result; 909 865 int olddeg,reduc; 910 866 int hilbeledeg=1,hilbcount=0,minimcnt=0; … … 916 872 /*set enterS, spSpolyShort, reduce, red, initEcart, initEcartPair*/ 917 873 /*Shdl=*/initBuchMora(F, Q,strat); 918 if (strat->minim>0) 919 { 920 strat->M=idInit(IDELEMS(F),F->rank); 921 } 874 if (strat->minim>0) strat->M=idInit(IDELEMS(F),F->rank); 875 kinitBbaHeaps(strat); 922 876 srmax = strat->sl; 923 877 reduc = olddeg = lrmax = 0; … … 927 881 if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/ 928 882 if (TEST_OPT_DEBUG) messageSets(strat); 929 //test_int_std(strat->kIdeal);930 883 if (strat->Ll== 0) strat->interpt=TRUE; 931 884 if (TEST_OPT_DEGBOUND … … 944 897 strat->P = strat->L[strat->Ll]; 945 898 strat->Ll--; 946 kTest_TS(strat); 899 947 900 if (pNext(strat->P.p) == strat->tail) 948 901 { … … 953 906 strat->kNoether); 954 907 } 955 if((strat->P.p1==NULL) && (strat->minim>0)) 956 strat->P.p2=pCopy(strat->P.p); 957 if (strat->honey) 958 { 959 if (TEST_OPT_PROT) message(strat->P.ecart+pFDeg(strat->P.p),&olddeg,&reduc,strat); 960 } 961 else 962 { 963 if (TEST_OPT_PROT) message(pFDeg(strat->P.p),&olddeg,&reduc,strat); 964 } 908 if((strat->P.p1==NULL) && (strat->minim>0)) strat->P.p2=pCopy(strat->P.p); 909 910 if (TEST_OPT_PROT) 911 message((strat->honey ? strat->P.ecart : 0) + pFDeg(strat->P.p), 912 &olddeg,&reduc,strat); 913 965 914 /* reduction of the element choosen from L */ 966 strat->red(&strat->P,strat); 967 if (strat->P.p != NULL) 915 red_result = strat->red(&strat->P,strat); 916 917 // reduktion to non-zero new poly 918 if (red_result == 1) 968 919 { 969 920 /* statistic */ … … 972 923 { 973 924 int pos=posInS(strat->S,strat->sl,strat->P.p); 974 { 975 if (TEST_OPT_INTSTRATEGY) 925 if (TEST_OPT_INTSTRATEGY) 926 { 927 pCleardenom(strat->P.p); 928 if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog)) 976 929 { 977 if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog)) 978 { 979 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 980 // if (strat->redTailChange) 981 pCleardenom(strat->P.p); 982 } 930 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 931 pCleardenom(strat->P.p); 932 } 933 } 934 else 935 { 936 pNorm(strat->P.p); 937 if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog)) 938 { 939 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 940 } 941 } 942 943 if (TEST_OPT_DEBUG){PrintS("new s:");wrp(strat->P.p);PrintLn();} 944 945 if ((strat->P.p1==NULL) && (strat->minim>0)) 946 { 947 if (strat->minim==1) 948 { 949 strat->M->m[minimcnt]=pCopy(strat->P.p); 950 pDelete(&strat->P.p2); 983 951 } 984 952 else 985 953 { 986 pNorm(strat->P.p); 987 if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog)) 988 { 989 strat->P.p = redtailBba(strat->P.p,pos-1,strat); 990 } 954 strat->M->m[minimcnt]=strat->P.p2; 955 strat->P.p2=NULL; 991 956 } 992 if (TEST_OPT_DEBUG) 993 { 994 PrintS("new s:"); 995 wrp(strat->P.p); 996 PrintLn(); 997 } 998 if((strat->P.p1==NULL) && (strat->minim>0)) 999 { 1000 if (strat->minim==1) 1001 { 1002 strat->M->m[minimcnt]=pCopy(strat->P.p); 1003 pDelete(&strat->P.p2); 1004 } 1005 else 1006 { 1007 strat->M->m[minimcnt]=strat->P.p2; 1008 strat->P.p2=NULL; 1009 } 1010 minimcnt++; 1011 } 1012 enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat); 1013 if (strat->sl==-1) pos=0; 1014 else pos=posInS(strat->S,strat->sl,strat->P.p); 1015 strat->enterS(strat->P,pos,strat); 1016 } 957 minimcnt++; 958 } 959 960 // put stuff into T-Set 961 enterTBba(strat->P, strat->posInT(strat->T,strat->tl,strat->P), 962 strat); 963 enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat); 964 // do we really need to recompute posInS 965 strat->enterS(strat->P,posInS(strat->S,strat->sl,strat->P.p), strat); 1017 966 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 1018 967 } … … 1222 1171 } 1223 1172 pLexOrder = b; 1224 FreeSizeOf((ADDRESS)strat,skStrategy);1173 kFreeStrat(strat); 1225 1174 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 1226 1175 idSkipZeroes(r); -
Singular/kstdfac.cc
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1.2 5 1999-10-14 14:27:12obachman Exp $ */4 /* $Id: kstdfac.cc,v 1.26 1999-10-18 11:19:27 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 861 861 { 862 862 orgstrat=strat->next; 863 FreeSizeOf((ADDRESS)strat,skStrategy);863 kFreeStrat(strat); 864 864 strat=orgstrat; 865 865 } -
Singular/kutil.cc
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.4 0 1999-10-15 16:07:07obachman Exp $ */4 /* $Id: kutil.cc,v 1.41 1999-10-18 11:19:28 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 3590 3590 } 3591 3591 3592 void kFreeStrat(kStrategy strat) 3593 { 3594 if (strat->THeap != NULL) 3595 { 3596 mmMergeHeap(mm_specHeap, strat->THeap); 3597 mmUnGetTempHeap(&(strat->THeap)); 3598 } 3599 FreeSizeOf(strat, skStrategy); 3600 } 3601 3592 3602 rOrderType_t spGetOrderType(ring r, int modrank, int syzcomp) 3593 3603 { -
Singular/kutil.h
r60a365f r942846 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.1 8 1999-10-14 14:27:14obachman Exp $ */6 /* $Id: kutil.h,v 1.19 1999-10-18 11:19:28 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 28 28 memHeap heap; 29 29 unsigned long sev; 30 sTObject() { memset((void*) this, 0, sizeof(sTObject)); }30 sTObject() { memset((void*) this, 0, sizeof(sTObject)); heap = mm_specHeap;} 31 31 inline poly SetP(poly p_new); 32 32 }; … … 55 55 class skStrategy 56 56 { 57 public: 58 kStrategy next; 59 void (*red)(LObject * L,kStrategy strat); 60 void (*initEcart)(LObject * L); 61 int (*posInT)(const TSet T,const int tl,const LObject &h); 62 int (*posInL)(const LSet set, const int length, 63 const LObject &L,const kStrategy strat); 64 void (*enterS)(LObject h, int pos,kStrategy strat); 65 void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG); 66 int (*posInLOld)(const LSet Ls,const int Ll, 67 const LObject &Lo,const kStrategy strat); 68 pFDegProc pOldFDeg; 69 ideal Shdl; 70 ideal D; /*V(S) is in D(D)*/ 71 ideal M; /*set of minimal generators*/ 72 polyset S; 73 intset ecartS; 74 intset fromQ; 75 unsigned long* sevS; 76 TSet T; 77 LSet L; 78 LSet B; 79 poly kHEdge; 80 poly kNoether; 81 BOOLEAN * NotUsedAxis; 82 LObject P; 83 poly tail; 84 leftv kIdeal; 85 intvec * kModW; 86 intvec * kHomW; 87 BOOLEAN *pairtest;/*used for enterOnePair*/ 88 int cp,c3; 89 int sl,mu; 90 int tl,tmax; 91 int Ll,Lmax; 92 int Bl,Bmax; 93 int ak,LazyDegree,LazyPass; 94 int syzComp; 95 int HCord; 96 int lastAxis; 97 int newIdeal; 98 int minim; 99 BOOLEAN interpt; 100 BOOLEAN homog; 101 BOOLEAN kHEdgeFound; 102 BOOLEAN honey,sugarCrit; 103 BOOLEAN Gebauer,noTailReduction; 104 BOOLEAN fromT; 105 BOOLEAN noetherSet; 106 BOOLEAN update; 107 BOOLEAN posInLOldFlag; 108 /*FALSE, if posInL == posInL10*/ 109 char redTailChange; 110 char news; 111 char newt;/*used for messageSets*/ 57 public: 58 kStrategy next; 59 int (*red)(LObject * L,kStrategy strat); 60 void (*initEcart)(LObject * L); 61 int (*posInT)(const TSet T,const int tl,const LObject &h); 62 int (*posInL)(const LSet set, const int length, 63 const LObject &L,const kStrategy strat); 64 void (*enterS)(LObject h, int pos,kStrategy strat); 65 void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG); 66 int (*posInLOld)(const LSet Ls,const int Ll, 67 const LObject &Lo,const kStrategy strat); 68 pFDegProc pOldFDeg; 69 ideal Shdl; 70 ideal D; /*V(S) is in D(D)*/ 71 ideal M; /*set of minimal generators*/ 72 polyset S; 73 intset ecartS; 74 intset fromQ; 75 unsigned long* sevS; 76 TSet T; 77 LSet L; 78 LSet B; 79 poly kHEdge; 80 poly kNoether; 81 BOOLEAN * NotUsedAxis; 82 LObject P; 83 poly tail; 84 leftv kIdeal; 85 intvec * kModW; 86 intvec * kHomW; 87 memHeap THeap; // if != NULL, heap for monoms of T 88 BOOLEAN use_redheap; // if TRUE, use extra heap for reductions 89 BOOLEAN *pairtest;/*used for enterOnePair*/ 90 int cp,c3; 91 int sl,mu; 92 int tl,tmax; 93 int Ll,Lmax; 94 int Bl,Bmax; 95 int ak,LazyDegree,LazyPass; 96 int syzComp; 97 int HCord; 98 int lastAxis; 99 int newIdeal; 100 int minim; 101 BOOLEAN interpt; 102 BOOLEAN homog; 103 BOOLEAN kHEdgeFound; 104 BOOLEAN honey,sugarCrit; 105 BOOLEAN Gebauer,noTailReduction; 106 BOOLEAN fromT; 107 BOOLEAN noetherSet; 108 BOOLEAN update; 109 BOOLEAN posInLOldFlag; 110 /*FALSE, if posInL == posInL10*/ 111 char redTailChange; 112 char news; 113 char newt;/*used for messageSets*/ 112 114 }; 113 115 … … 168 170 void updateResult(ideal r,ideal Q,kStrategy strat); 169 171 void completeReduce (kStrategy strat); 172 void kFreeStrat(kStrategy strat); 170 173 BOOLEAN homogTest(polyset F, int Fmax); 171 174 BOOLEAN newHEdge(polyset S, int ak,kStrategy strat); -
Singular/mmalloc.c
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmalloc.c,v 1.1 6 1999-10-14 14:27:18obachman Exp $ */4 /* $Id: mmalloc.c,v 1.17 1999-10-18 11:19:29 obachman Exp $ */ 5 5 6 6 /* … … 583 583 if (ptr == NULL) 584 584 { 585 mmGarbageCollectHeaps( 3);585 mmGarbageCollectHeaps(4); 586 586 ptr = malloc(size); 587 587 if (ptr == NULL) … … 609 609 if (res == NULL) 610 610 { 611 mmGarbageCollectHeaps( 3);611 mmGarbageCollectHeaps(4); 612 612 /* Can do a realloc again: manpage reads: 613 613 "If realloc() fails the original block is left untouched - … … 642 642 if (page == NULL) 643 643 { 644 mmGarbageCollectHeaps( 3);644 mmGarbageCollectHeaps(4); 645 645 page = PALLOC(SIZE_OF_PAGE); 646 646 if (page == NULL) -
Singular/mmemory.h
r60a365f r942846 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: mmemory.h,v 1.2 4 1999-10-14 14:27:19 obachman Exp $ */6 /* $Id: mmemory.h,v 1.25 1999-10-18 11:19:29 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 201 201 **********************************/ 202 202 /* creates and initializes a temporary heap */ 203 extern memHeap mm CreateTempHeap(size_t size);203 extern memHeap mmGetTempHeap(size_t size); 204 204 #ifndef HEAP_DEBUG 205 /* UNCONDITIONALLY clears and dest oys temporary heap */206 extern void mm DestroyTempHeap(memHeap *heap_p);205 /* UNCONDITIONALLY clears and destroys temporary heap */ 206 extern void mmUnGetTempHeap(memHeap *heap_p); 207 207 #else 208 #define mm DestroyTempHeap(h) mmDebugDestroyTempHeap(h)209 extern void mm DebugDestroyTempHeap(memHeap *heap);208 #define mmUnGetTempHeap(h) mmDebugDestroyTempHeap(h) 209 extern void mmUnGetTempHeap(memHeap *heap); 210 210 #endif /* HEAP_DEBUG */ 211 211 … … 213 213 /* if strict & 1, does it even if free ptr has not changed w.r.t. last gc */ 214 214 /* if strict & 2, also releases free pages */ 215 /* if strict & 4, gc also of temp heaps */ 215 216 extern void mmGarbageCollectHeaps(int strict); 216 217 extern void mmGarbageCollectHeap(memHeap heap, int strict); -
Singular/mmheap.c
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmheap.c,v 1.1 1 1999-10-14 14:27:19obachman Exp $ */4 /* $Id: mmheap.c,v 1.12 1999-10-18 11:19:30 obachman Exp $ */ 5 5 #include <stdio.h> 6 6 #include "mod2.h" … … 229 229 heap->current = NULL; 230 230 heap->last_gc = NULL; 231 } 232 else if (! strict && heap->current == heap->last_gc) 231 return; 232 } 233 234 if (! strict && heap->current == heap->last_gc) 233 235 { 234 236 return; -
Singular/mmisc.c
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmisc.c,v 1.1 5 1999-10-15 16:07:09obachman Exp $ */4 /* $Id: mmisc.c,v 1.16 1999-10-18 11:19:30 obachman Exp $ */ 5 5 6 6 /* … … 166 166 verbose &= ~Sy_bit(V_SHOW_MEM); 167 167 } 168 168 169 while (s_heap != NULL) 169 170 { … … 171 172 s_heap = s_heap->next; 172 173 } 173 if (strict )174 if (strict & 4) 174 175 { 175 176 s_heap = mm_TempHeaps; … … 258 259 int mm_bytesAlloc = mm_bytesValloc + mm_bytesMalloc; 259 260 261 #if 0 260 262 if ( ABS(mm_bytesAlloc - mm_printMark)>(100*1024) ) 261 263 { … … 265 267 mm_printMark=mm_bytesAlloc; 266 268 } 269 #else 270 if ( ABS(mm_bytesAlloc - mm_printMark)>(1000*1024) ) 271 { 272 mmPrintStat(); 273 mm_printMark=mm_bytesAlloc; 274 } 275 #endif 267 276 } 268 277 -
Singular/mmtables.c
r60a365f r942846 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmtables.c,v 1. 3 1999-10-14 14:27:21obachman Exp $ */4 /* $Id: mmtables.c,v 1.4 1999-10-18 11:19:30 obachman Exp $ */ 5 5 6 6 /* … … 23 23 #define MAX_INDEX ((MAX_BLOCK_SIZE - 1) >> 2) 24 24 #define HALF_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 8)*4) 25 26 const size_t mm_mcbSizesAlign8 [] = { 8, 16, 24, 32, 27 40, 48, 56, 64, 28 80, 96, 112, 128, 29 160, 192, 224, 256, 30 HALF_MAX_BLOCK_SIZE, MAX_BLOCK_SIZE}; 31 const size_t mm_mcbSizesAlign4 [] = { 8, 12, 16, 20, 32 24, 28, 32, 33 40, 48, 56, 64, 34 80, 96, 112, 128, 35 160, 192, 224, 256, 36 HALF_MAX_BLOCK_SIZE, MAX_BLOCK_SIZE}; 25 #define QUARTER_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 16)*4) 26 #define EIGHTS_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 32)*4) 27 28 const size_t mm_mcbSizesAlign8 [] = 29 { 8, 16, 24, 32, 30 40, 48, 56, 64, 31 80, 96, 112, 128, 32 160, 192, 224, 33 QUARTER_MAX_BLOCK_SIZE, 34 QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 35 HALF_MAX_BLOCK_SIZE, 36 HALF_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 37 HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE, 38 HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 39 MAX_BLOCK_SIZE}; 40 const size_t mm_mcbSizesAlign4 [] = 41 { 8, 12, 16, 20, 42 24, 28, 32, 43 40, 48, 56, 64, 44 80, 96, 112, 128, 45 160, 192, 224, 46 QUARTER_MAX_BLOCK_SIZE, 47 QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 48 HALF_MAX_BLOCK_SIZE, 49 HALF_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 50 HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE, 51 HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE, 52 MAX_BLOCK_SIZE}; 37 53 38 54 char mm_IndiciesAlign8[MAX_INDEX + 1]; … … 317 333 int main() 318 334 { 335 #if 0 319 336 mmInitIndexTable(mm_IndiciesAlign8, mm_mcbSizesAlign8, 320 337 mmGetBinaryIndexAlign8); 321 338 mmInitIndexTable(mm_IndiciesAlign4, mm_mcbSizesAlign4, 322 339 mmGetBinaryIndex); 340 #else 341 mmInitIndexTable(mm_IndiciesAlign8, mm_mcbSizesAlign8, 342 NULL); 343 mmInitIndexTable(mm_IndiciesAlign4, mm_mcbSizesAlign4, 344 NULL); 345 #endif 323 346 324 347 printf("#ifndef MM_TABLES_INC\n#define MM_TABLES_INC\n");
Note: See TracChangeset
for help on using the changeset viewer.