Changeset ff4e34f in git
- Timestamp:
- Oct 4, 2000, 3:12:05 PM (24 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f103fb07c2e69147dd1bca55b8421e35361355a8
- Parents:
- 122d498cedb975079e9eff3554a721e5e8f3af86
- Location:
- Singular
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/kInline.cc
r122d49 rff4e34f 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: kInline.cc,v 1. 3 2000-09-25 12:26:31 obachman Exp $9 * Version: $Id: kInline.cc,v 1.4 2000-10-04 13:12:01 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef KINLINE_CC … … 17 17 #include "p_Procs.h" 18 18 #include "kbuckets.h" 19 19 #include "omalloc.h" 20 21 #define HAVE_TAIL_BIN 22 // #define HAVE_LM_BIN 23 24 KINLINE skStrategy::skStrategy() 25 { 26 memset(this, 0, sizeof(skStrategy)); 27 tailRing = currRing; 28 P.tailRing = currRing; 29 P.lmRing = currRing; 30 #ifdef HAVE_LM_BIN 31 lmBin = omGetStickyBinOfBin(currRing->PolyBin); 32 #endif 33 #ifdef HAVE_TAIL_BIN 34 tailBin = omGetStickyBinOfBin(currRing->PolyBin); 35 #endif 36 } 37 38 KINLINE skStrategy::~skStrategy() 39 { 40 if (lmBin != NULL) 41 omMergeStickyBinIntoBin(lmBin, currRing->PolyBin); 42 if (tailBin != NULL) 43 omMergeStickyBinIntoBin(tailBin, 44 (tailRing!= NULL ? tailRing->PolyBin: 45 currRing->PolyBin)); 46 } 47 20 48 KINLINE TSet initT () { return (TSet)omAlloc0(setmax*sizeof(TObject)); } 21 49 … … 97 125 } 98 126 99 KINLINE poly sLObject::GetP(ring get_lmRing = currRing )127 KINLINE poly sLObject::GetP(ring get_lmRing = currRing, omBin lmBin = NULL) 100 128 { 101 129 kTest_L(this); … … 112 140 if (get_lmRing != lmRing) 113 141 { 114 p = k_LmShallowCopyDelete_tailRing_2_lmRing(p, tailRing, lmRing); 115 get_lmRing = lmRing; 116 } 117 } 142 if (lmBin == NULL) lmBin = get_lmRing->PolyBin; 143 p = k_LmShallowCopyDelete_tailRing_2_lmRing(p,lmRing, get_lmRing,lmBin); 144 lmRing = get_lmRing; 145 } 146 else if (lmBin != NULL) 147 { 148 p = p_LmShallowCopyDelete(p, lmRing, lmBin); 149 } 150 } 151 118 152 kTest_L(this); 119 153 return p; … … 126 160 * 127 161 ***************************************************************/ 128 129 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing )162 163 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin tailBin) 130 164 { 131 165 int i; 132 poly np = p_ New(tailRing);166 poly np = p_Init(tailRing, tailBin); 133 167 pNext(np) = pNext(p); 134 168 pSetCoeff0(np, pGetCoeff(p)); … … 147 181 } 148 182 149 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing )150 { 151 return k_LmInit_lmRing_2_tailRing(p, tailRing, lmRing );183 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin lmBin) 184 { 185 return k_LmInit_lmRing_2_tailRing(p, tailRing, lmRing, lmBin); 152 186 } 153 187 154 188 // this should be made more efficient 155 KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing )156 { 157 poly np = k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing );189 KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin tailBin) 190 { 191 poly np = k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing, tailBin); 158 192 p_LmFree(p, lmRing); 159 193 return np; 160 194 } 161 195 162 KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing )163 { 164 poly np = k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing );196 KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin lmBin) 197 { 198 poly np = k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing, lmBin); 165 199 p_LmFree(p, tailRing); 166 200 return np; 167 201 } 168 202 203 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing) 204 { 205 return k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing, tailRing->PolyBin); 206 } 207 208 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing) 209 { 210 return k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing, lmRing->PolyBin); 211 } 212 213 KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing) 214 { 215 return k_LmShallowCopyDelete_lmRing_2_tailRing(p, lmRing, tailRing, tailRing->PolyBin); 216 } 217 218 KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing) 219 { 220 return k_LmShallowCopyDelete_tailRing_2_lmRing(p, tailRing, lmRing, lmRing->PolyBin); 221 } 222 169 223 #endif // defined(KINLINE) || defined(KUTIL_CC) 170 224 #endif // KINLINE_CC -
Singular/kspoly.cc
r122d49 rff4e34f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kspoly.cc,v 1.1 0 2000-09-25 12:26:32obachman Exp $ */4 /* $Id: kspoly.cc,v 1.11 2000-10-04 13:12:01 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Routines for Spoly creation and reductions … … 111 111 int use_buckets, ring tailRing) 112 112 { 113 assume(kTest_L(Pair));113 kTest_L(Pair); 114 114 poly p1 = Pair->p1; 115 115 poly p2 = Pair->p2; -
Singular/kstd1.cc
r122d49 rff4e34f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.5 4 2000-09-18 09:19:07obachman Exp $ */4 /* $Id: kstd1.cc,v 1.55 2000-10-04 13:12:01 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 1771 1771 //Print("%d reductions canceled \n",strat->cel); 1772 1772 HCord=strat->HCord; 1773 kFreeStrat(strat);1773 delete(strat); 1774 1774 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 1775 1775 return r; … … 1897 1897 l->m[1].data=(void *)strat->M; 1898 1898 } 1899 kFreeStrat(strat);1899 delete(strat); 1900 1900 if (reduced>2) 1901 1901 { … … 1917 1917 else 1918 1918 p=kNF2(F,Q,p,strat,lazyReduce); 1919 kFreeStrat(strat);1919 delete(strat); 1920 1920 return p; 1921 1921 } … … 1934 1934 else 1935 1935 res=kNF2(F,Q,p,strat,lazyReduce); 1936 kFreeStrat(strat);1936 delete(strat); 1937 1937 return res; 1938 1938 } … … 1993 1993 // } 1994 1994 ideal shdl=strat->Shdl; 1995 kFreeStrat(strat);1995 delete(strat); 1996 1996 return shdl; 1997 1997 } -
Singular/kstd2.cc
r122d49 rff4e34f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.4 8 2000-09-25 12:26:32 obachman Exp $ */4 /* $Id: kstd2.cc,v 1.49 2000-10-04 13:12:02 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 623 623 /* statistic */ 624 624 if (TEST_OPT_PROT) PrintS("s"); 625 strat->P.GetP( );625 strat->P.GetP(currRing, strat->lmBin); 626 626 /* enter P.p into s and L */ 627 627 { … … 877 877 } 878 878 pLexOrder = b; 879 kFreeStrat(strat);879 delete(strat); 880 880 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 881 881 idSkipZeroes(r); -
Singular/kstdfac.cc
r122d49 rff4e34f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1.4 1 2000-09-25 12:26:32 obachman Exp $ */4 /* $Id: kstdfac.cc,v 1.42 2000-10-04 13:12:02 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 884 884 { 885 885 orgstrat=strat->next; 886 kFreeStrat(strat);886 delete(strat); 887 887 strat=orgstrat; 888 888 } -
Singular/kutil.cc
r122d49 rff4e34f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.6 3 2000-09-25 12:26:33 obachman Exp $ */4 /* $Id: kutil.cc,v 1.64 2000-10-04 13:12:03 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 3243 3243 } 3244 3244 else atT = 0; 3245 3246 if (strat->tailBin != NULL) 3247 pNext(p.p)=p_ShallowCopyDelete(pNext(p.p), 3248 (strat->tailRing != NULL ? 3249 strat->tailRing : currRing), 3250 strat->tailBin); 3245 3251 strat->T[atT].p = p.p; 3246 3252 strat->T[atT].ecart = p.ecart; … … 3282 3288 strat->T[atT].length = p.length; 3283 3289 3284 strat->T[atT].pLength = p.pLength; 3290 if (strat->tailBin != NULL) 3291 pNext(p.p)=p_ShallowCopyDelete(pNext(p.p), 3292 (strat->tailRing != NULL ? 3293 strat->tailRing : currRing), 3294 strat->tailBin); 3295 if (strat->use_buckets && p.pLength <= 0) 3296 strat->T[atT].pLength = pLength(p.p); 3297 else 3298 strat->T[atT].pLength = p.pLength; 3299 3285 3300 if (p.sev == 0) 3286 3301 { … … 3624 3639 } 3625 3640 3626 void kFreeStrat(kStrategy strat)3627 {3628 omFreeSize(strat, sizeof(skStrategy));3629 }3630 3631 3641 rOrderType_t spGetOrderType(ring r, int modrank, int syzcomp) 3632 3642 { -
Singular/kutil.h
r122d49 rff4e34f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.3 1 2000-09-25 12:26:34obachman Exp $ */6 /* $Id: kutil.h,v 1.32 2000-10-04 13:12:03 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 58 58 KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether); 59 59 KINLINE void sLObject::Tail_Mult_nn(number n); 60 KINLINE poly GetP(ring LmRing = currRing );60 KINLINE poly GetP(ring LmRing = currRing, omBin bin = NULL); 61 61 KINLINE void CanonicalizeP(); 62 62 }; … … 126 126 BOOLEAN use_buckets; 127 127 ring tailRing; 128 omBin lmBin; 129 omBin tailBin; 128 130 /*FALSE, if posInL == posInL10*/ 129 131 char redTailChange; … … 131 133 char newt;/*used for messageSets*/ 132 134 133 skStrategy() 134 { 135 memset(this, 0, sizeof(skStrategy)); 136 tailRing = currRing; 137 P.tailRing = currRing; 138 P.lmRing = currRing; 139 }; 140 135 KINLINE skStrategy(); 136 KINLINE ~skStrategy(); 141 137 }; 142 138 … … 208 204 209 205 KINLINE TSet initT (); 206 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin bin); 207 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin bin); 208 KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin bin); 209 KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin bin); 210 210 211 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing); 211 212 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing); -
Singular/pInline1.h
r122d49 rff4e34f 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline1.h,v 1. 4 2000-09-20 12:56:36obachman Exp $9 * Version: $Id: pInline1.h,v 1.5 2000-10-04 13:12:04 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE1_H … … 60 60 * 61 61 ***************************************************************/ 62 PINLINE1 poly p_Init(ring r )62 PINLINE1 poly p_Init(ring r, omBin bin) 63 63 { 64 64 p_CheckRing1(r); 65 pAssume1(bin != NULL && r->PolyBin->sizeW == bin->sizeW); 65 66 poly p; 66 omTypeAlloc0Bin(poly, p, r->PolyBin);67 omTypeAlloc0Bin(poly, p, bin); 67 68 p_SetRingOfPoly(p, r); 68 69 return p; 69 70 } 71 PINLINE1 poly p_Init(ring r) 72 { 73 return p_Init(r, r->PolyBin); 74 } 75 70 76 PINLINE1 poly p_LmInit(poly p, ring r) 71 77 { … … 90 96 _pSetCoeff0(np, n_Copy(_pGetCoeff(p), r)); 91 97 return np; 98 } 99 100 PINLINE1 poly p_LmShallowCopyDelete(poly p, const ring r, omBin bin) 101 { 102 p_CheckPolyRing1(p, r); 103 pAssume1(bin->sizeW == r->PolyBin->sizeW); 104 poly new_p = p_New(r); 105 p_MemCopy_LengthGeneral(new_p->exp, p->exp, r->ExpLSize); 106 pSetCoeff0(new_p, pGetCoeff(p)); 107 pNext(new_p) = pNext(p); 108 omFreeBinAddr(p); 109 return new_p; 92 110 } 93 111 -
Singular/pInline2.h
r122d49 rff4e34f 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline2.h,v 1. 6 2000-09-25 12:26:35obachman Exp $9 * Version: $Id: pInline2.h,v 1.7 2000-10-04 13:12:04 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE2_H … … 169 169 * 170 170 ***************************************************************/ 171 PINLINE2 poly p_New(ring r )171 PINLINE2 poly p_New(ring r, omBin bin) 172 172 { 173 173 p_CheckRing2(r); 174 pAssume2(bin != NULL && r->PolyBin->sizeW == bin->sizeW); 174 175 poly p; 175 omTypeAllocBin(poly, p, r->PolyBin);176 omTypeAllocBin(poly, p, bin); 176 177 p_SetRingOfPoly(p, r); 177 178 return p; 179 } 180 181 PINLINE2 poly p_New(ring r) 182 { 183 return p_New(r, r->PolyBin); 178 184 } 179 185 … … 302 308 p_LmDelete(p, lmRing); 303 309 } 310 } 311 312 PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin) 313 { 314 p_CheckPolyRing2(p, r); 315 pAssume2(r->PolyBin->sizeW == bin->sizeW); 316 return r->p_Procs->p_ShallowCopyDelete(p, r, bin); 304 317 } 305 318 -
Singular/p_Procs.cc
r122d49 rff4e34f 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Procs.cc,v 1.1 2 2000-09-25 12:26:35obachman Exp $9 * Version: $Id: p_Procs.cc,v 1.13 2000-10-04 13:12:04 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include <string.h> … … 64 64 // 3 -- special cases for length <= 4 65 65 // 4 -- special cases for length <= 8 66 const int HAVE_FAST_LENGTH = 3;66 const int HAVE_FAST_LENGTH = 4; 67 67 68 68 // Set HAVE_FAST_ORD to: -
Singular/p_polys.h
r122d49 rff4e34f 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 9/00 10 * Version: $Id: p_polys.h,v 1. 2 2000-09-20 12:56:37obachman Exp $10 * Version: $Id: p_polys.h,v 1.3 2000-10-04 13:12:05 obachman Exp $ 11 11 *******************************************************************/ 12 12 #ifndef P_POLYS_H … … 97 97 ***************************************************************/ 98 98 PINLINE2 poly p_New(ring r); 99 PINLINE2 poly p_New(ring r, omBin bin); 99 100 PINLINE1 poly p_Init(ring r); 101 PINLINE1 poly p_Init(ring rm, omBin bin); 100 102 PINLINE1 poly p_LmInit(poly p, ring r); 101 103 PINLINE1 poly p_Head(poly p, ring r); … … 180 182 PINLINE2 void p_Delete(poly *p, const ring lmRing, const ring tailRing); 181 183 184 // copys monomials of p, allocates nwe monomials from bin, 185 // deletes monomoals of p 186 PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin); 187 // simial but does it only for leading monomial 188 PINLINE1 poly p_LmShallowCopyDelete(poly p, const ring r, omBin bin); 182 189 183 190 /***************************************************************
Note: See TracChangeset
for help on using the changeset viewer.