Changeset 78abc7 in git
- Timestamp:
- Aug 18, 2014, 4:35:01 PM (9 years ago)
- Branches:
- (u'spielwiese', 'a7324b6e0b44a1a8ed3fa4d9ca3e2ff210ddd52c')
- Children:
- eacb78146504ca284c1888c739cb1aade67c8520
- Parents:
- 441944f17f356b9a04c768f8a43754bc29364747
- git-author:
- Yue Ren <ren@mathematik.uni-kl.de>2014-08-18 16:35:01+02:00
- git-committer:
- Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:04+01:00
- Location:
- Singular/dyn_modules/gfanlib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/groebnerCone.cc
r441944 r78abc7 34 34 int n = rVar(r); int* w = r->wvhdl[0]; 35 35 gfan::ZVector v = wvhdlEntryToZVector(n,w); 36 if (r->order[0]==ringorder_ws) 37 v = gfan::Integer((long)-1)*v; 36 38 if (!zc.contains(v)) 37 39 { -
Singular/dyn_modules/gfanlib/ppinitialReduction.cc
r441944 r78abc7 19 19 static bool pReduce(poly &g, const number p, const ring r) 20 20 { 21 if (g==NULL) 22 return false; 23 21 24 poly toBeChecked = pNext(g); 22 25 pNext(g) = NULL; poly gEnd = g; … … 107 110 bool ppreduceInitially(poly &h, const poly g, const ring r) 108 111 { 112 if (h==NULL || g==NULL) 113 return false; 109 114 p_Test(h,r); 110 115 p_Test(g,r); … … 204 209 for (int j=i+1; j<m; j++) 205 210 if (ppreduceInitially(I->m[i], I->m[j],r) && pReduce(I->m[i],p,r)) return true; 211 212 /*** 213 * removes the elements of I which have been reduced to 0 in the previous two passes 214 **/ 215 idSkipZeroes(I); 206 216 return false; 207 217 } … … 249 259 int n=idSize(I); 250 260 idInsertPoly(I,g); 251 poly cache; n++;int j;252 for (j=n -1; j>0; j--)261 int j; 262 for (j=n; j>0; j--) 253 263 { 254 264 if (p_LmCmp(I->m[j], I->m[j-1],r)>0) 255 265 { 256 cache = I->m[j];266 poly cache = I->m[j]; 257 267 I->m[j] = I->m[j-1]; 258 268 I->m[j-1] = cache; … … 281 291 if (ppreduceInitially(I->m[j], I->m[k], r) && pReduce(I->m[j],p,r)) return true; 282 292 293 /*** 294 * removes the elements of I which have been reduced to 0 in the previous two passes 295 **/ 296 idSkipZeroes(I); 283 297 return false; 284 298 } … … 475 489 476 490 477 /** *491 /** 478 492 * reduces I initially with respect to itself. 479 493 * assumes that the generators of I are homogeneous in x and that p-t is in I. 480 * */494 */ 481 495 bool ppreduceInitially(ideal I, ring r, number p) 482 496 { … … 498 512 else 499 513 { 500 std::pair< std::map<long,ideal>::iterator,bool> ret;501 ret = H.insert(std::pair<long,ideal>(d,idInit(16)));502 idInsertPoly(ret.first->second,I->m[i]);514 std::pair<long,ideal> Hd(d,idInit(1)); 515 Hd.second->m[0] = I->m[i]; 516 H.insert(Hd); 503 517 } 504 518 } … … 506 520 std::map<long,ideal>::iterator it=H.begin(); 507 521 ideal Hi = it->second; 522 assume(idSize(Hi)==1); 523 assume(pLength(Hi->m[0])==2); 524 it++; 525 Hi = it->second; 508 526 509 527 /*** … … 520 538 { 521 539 int l=idSize(Hi); int k=l; poly cache; 540 /** 541 * sorts Hi according to degree in t in descending order 542 * (lowest first, highest last) 543 */ 522 544 do 523 545 { -
Singular/dyn_modules/gfanlib/startingCone.cc
r441944 r78abc7 52 52 std::pair<gfan::ZVector,groebnerCone> tropicalStartingDataViaGroebnerFan(const ideal I, const ring r, const tropicalStrategy& currentStrategy) 53 53 { 54 std::cout << "computing starting cone" << std::endl; 54 55 currentStrategy.reduce(I,r); 56 std::cout << "finished reduction" << std::endl; 55 57 56 58 const groebnerCone sigma(I,r,currentStrategy); 59 std::cout << "finished first maximal Groebner cone" << std::endl; 57 60 gfan::ZVector startingPoint = sigma.tropicalPoint(); 58 61 if (startingPoint.size() > 0) … … 64 67 while (!workingList.empty()) 65 68 { 69 std::cout << "traversing groebner fan..." << std::endl; 66 70 const groebnerCone sigma = *(workingList.begin()); 67 71 groebnerCones neighbours = sigma.groebnerNeighbours(); -
Singular/dyn_modules/gfanlib/tropicalStrategy.cc
r441944 r78abc7 8 8 #include <kernel/ideals.h> 9 9 #include <kernel/GBEngine/stairc.h> 10 #include <Singular/ipshell.h> // for isPrime(int i) 10 11 11 12 /*** … … 56 57 startingIdeal(id_Copy(originalIdeal,originalRing)), 57 58 uniformizingParameter(NULL), 58 shortcutRing( rCopy(originalRing)),59 shortcutRing(NULL), 59 60 onlyLowerHalfSpace(false), 60 61 weightAdjustingAlgorithm1(nonvalued_adjustWeightForHomogeneity), … … 137 138 originalRing = rCopy(s); 138 139 139 /* replace Q with Z for the startingRing */ 140 startingRing = rCopy0(originalRing); 141 nKillChar(startingRing->cf); 142 startingRing->cf = nInitChar(n_Z,NULL); 143 rComplete(startingRing); 144 145 /* map p into the new coefficient domain */ 140 /* replace Q with Z for the startingRing 141 * and add an extra variable for tracking the uniformizing parameter */ 142 startingRing = constructStartingRing(originalRing); 143 144 /* map the uniformizing parameter into the new coefficient domain */ 146 145 nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf); 147 146 uniformizingParameter = nMap(q,originalRing->cf,startingRing->cf); 148 147 149 /* map Jinto the new polynomial ring */148 /* map the input ideal into the new polynomial ring */ 150 149 int k = idSize(J); 151 startingIdeal = idInit(k); 150 startingIdeal = idInit(k+1); 151 poly g = p_One(startingRing); 152 p_SetCoeff(g,uniformizingParameter,startingRing); 153 pNext(g) = p_One(startingRing); 154 p_SetExp(pNext(g),1,1,startingRing); 155 p_SetCoeff(pNext(g),n_Init(-1,startingRing->cf),startingRing); 156 p_Setm(pNext(g),startingRing); 157 startingIdeal->m[0] = g; 158 int n = rVar(originalRing); 159 int* shiftByOne = (int*) omAlloc((n+1)*sizeof(int)); 160 for (int i=1; i<=n; i++) 161 shiftByOne[i]=i+1; 152 162 for (int i=0; i<k; i++) 153 startingIdeal->m[i] = p_PermPoly(J->m[i],NULL,originalRing,startingRing,nMap,NULL,0); 163 startingIdeal->m[i+1] = p_PermPoly(J->m[i],shiftByOne,originalRing,startingRing,nMap,NULL,0); 164 omFreeSize(shiftByOne,(n+1)*sizeof(int)); 165 166 /* construct the shorcut ring */ 167 shortcutRing = rCopy0(startingRing); 168 nKillChar(shortcutRing->cf); 169 shortcutRing->cf = nInitChar(n_Zp,(void*)(long)IsPrime(n_Int(uniformizingParameter,startingRing->cf))); 170 rComplete(shortcutRing); 154 171 155 172 /* compute the dimension of the ideal in the original ring */ -
Singular/dyn_modules/gfanlib/tropicalStrategy.h
r441944 r78abc7 207 207 return b; 208 208 } 209 210 /** 211 * returns true, if I contains a monomial. 212 * returns false otherwise. 213 **/ 214 bool containsMonomial(ideal I, ring r) const 215 { 216 ring rFinite = rCopy0(r); 217 nKillChar(rFinite.coeffs()); 218 rFinite->cf = 219 } 209 220 }; 210 221 -
Singular/dyn_modules/gfanlib/tropicalTraversal.cc
r441944 r78abc7 8 8 while(!workingList.empty()) 9 9 { 10 std::cout << "starting traversal" << std::endl; 10 11 const groebnerCone sigma=*(workingList.begin()); 11 12 const groebnerCones neighbours = sigma.tropicalNeighbours();
Note: See TracChangeset
for help on using the changeset viewer.