Changeset 4b47563 in git
- Timestamp:
- Nov 21, 2014, 6:04:44 PM (9 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- bf83d38c96216c127968a607729c0b2aa4b88985
- Parents:
- e4c54031d2902cbf09cf0ab7914602044e166cc0
- git-author:
- Yue Ren <ren@mathematik.uni-kl.de>2014-11-21 18:04:44+01:00
- git-committer:
- Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:05+01:00
- Location:
- Singular/dyn_modules/gfanlib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/bbcone.cc
re4c540 r4b47563 104 104 delete zd; 105 105 } 106 gfan::ZCone* zc = (gfan::ZCone*)r->Data(); 107 newZc = new gfan::ZCone(*zc); 106 newZc = (gfan::ZCone*)r->CopyD(); 108 107 } 109 108 else if (r->Typ()==INT_CMD) -
Singular/dyn_modules/gfanlib/tropicalStrategy.cc
re4c540 r4b47563 515 515 } 516 516 517 ideal tropicalStrategy:: getStdOfInitialIdeal(const ideal inI, const ring r) const518 { 519 ideal inJ;517 ideal tropicalStrategy::computeStdOfInitialIdeal(const ideal inI, const ring r) const 518 { 519 // if valuation trivial, then compute std as usual 520 520 if (isValuationTrivial()) 521 // if valuation trivial, then compute std as usual 522 inJ = gfanlib_kStd_wrapper(inI,r); 523 else 524 { 525 // if valuation non-trivial, then uniformizing parameter is in ideal 526 // so switch to residue field first and compute standard basis over the residue field 527 ring rShortcut = copyAndChangeCoefficientRing(r); 528 nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf); 529 int k = idSize(inI); 530 ideal inIShortcut = idInit(k); 531 for (int i=0; i<k; i++) 532 inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,takingResidues,NULL,0); 533 ideal inJShortcut = gfanlib_kStd_wrapper(inIShortcut,rShortcut); 534 535 // and lift the result back to the ring with valuation 536 nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf); 537 k = idSize(inJShortcut); 538 inJ = idInit(k+1); 539 inJ->m[0] = p_One(r); 540 nMapFunc identity = n_SetMap(startingRing->cf,r->cf); 541 p_SetCoeff(inJ->m[0],identity(uniformizingParameter,startingRing->cf,r->cf),r); 542 for (int i=0; i<k; i++) 543 inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,rShortcut,r,takingRepresentatives,NULL,0); 544 545 id_Delete(&inIShortcut,rShortcut); 546 rDelete(rShortcut); 547 } 521 return gfanlib_kStd_wrapper(inI,r); 522 523 // if valuation non-trivial, then uniformizing parameter is in ideal 524 // so switch to residue field first and compute standard basis over the residue field 525 ring rShortcut = copyAndChangeCoefficientRing(r); 526 nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf); 527 int k = idSize(inI); 528 ideal inIShortcut = idInit(k); 529 for (int i=0; i<k; i++) 530 inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,takingResidues,NULL,0); 531 ideal inJShortcut = gfanlib_kStd_wrapper(inIShortcut,rShortcut); 532 533 // and lift the result back to the ring with valuation 534 nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf); 535 k = idSize(inJShortcut); 536 ideal inJ = idInit(k+1); 537 inJ->m[0] = p_One(r); 538 nMapFunc identity = n_SetMap(startingRing->cf,r->cf); 539 p_SetCoeff(inJ->m[0],identity(uniformizingParameter,startingRing->cf,r->cf),r); 540 for (int i=0; i<k; i++) 541 inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,rShortcut,r,takingRepresentatives,NULL,0); 542 543 id_Delete(&inJShortcut,rShortcut); 544 id_Delete(&inIShortcut,rShortcut); 545 rDelete(rShortcut); 548 546 return inJ; 549 547 } … … 658 656 ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal); 659 657 nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf); 660 int k = idSize(Ir); ideal inIsAdjusted = idInit(k); 658 int k = idSize(Ir); 659 ideal inIsAdjusted = idInit(k); 661 660 for (int i=0; i<k; i++) 662 661 inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0); 663 ideal inJsAdjusted = getStdOfInitialIdeal(inIsAdjusted,sAdjusted);662 ideal inJsAdjusted = computeStdOfInitialIdeal(inIsAdjusted,sAdjusted); 664 663 665 664 // find witnesses of the new standard basis elements of the initial ideal … … 680 679 // this->reduce(Jr,r); 681 680 // cleanup 681 id_Delete(&inIsAdjusted,sAdjusted); 682 682 id_Delete(&inJsAdjusted,sAdjusted); 683 683 rDelete(sAdjusted); 684 id_Delete(&inIr,r); 684 685 id_Delete(&Jr,r); 685 686 id_Delete(&inJr,r); -
Singular/dyn_modules/gfanlib/tropicalStrategy.h
re4c540 r4b47563 322 322 * given generators of the initial ideal, computes its standard basis 323 323 */ 324 ideal getStdOfInitialIdeal(const ideal inI, const ring r) const;324 ideal computeStdOfInitialIdeal(const ideal inI, const ring r) const; 325 325 326 326 /** -
Singular/dyn_modules/gfanlib/tropicalTraversal.cc
re4c540 r4b47563 8 8 while(!workingList.empty()) 9 9 { 10 std::cout << "starting traversal" << std::endl;10 // std::cout << "starting traversal" << std::endl; 11 11 const groebnerCone sigma=*(workingList.begin()); 12 12 const groebnerCones neighbours = sigma.tropicalNeighbours(); … … 18 18 tropicalVariety.insert(sigma); 19 19 workingList.erase(sigma); 20 std::cout << "tropicalVariety.size():" << tropicalVariety.size() << std::endl;21 std::cout << "workingList.size():" << workingList.size() << std::endl;20 // std::cout << "tropicalVariety.size():" << tropicalVariety.size() << std::endl; 21 // std::cout << "workingList.size():" << workingList.size() << std::endl; 22 22 } 23 23 return tropicalVariety; -
Singular/dyn_modules/gfanlib/tropicalVariety.cc
re4c540 r4b47563 76 76 if ((v!=NULL) && (v->Typ()==NUMBER_CMD)) 77 77 { 78 number p = (number) v-> CopyD();78 number p = (number) v->Data(); 79 79 tropicalStrategy currentStrategy(I,p,currRing); 80 80 std::set<gfan::ZCone> maxCones = tropicalVariety(g,currRing,currentStrategy); 81 81 res->rtyp = fanID; 82 82 res->data = (char*) toZFan(maxCones); 83 id_Delete(&I,currRing);84 n_Delete(&p,currRing->cf);85 83 return FALSE; 86 84 } … … 90 88 { 91 89 setOptionRedSB(); 90 ideal stdI; 92 91 if (!hasFlag(u,FLAG_STD)) 93 { 94 ideal stdI = gfanlib_kStd_wrapper(I,currRing); 95 id_Delete(&I,currRing); 96 I = stdI; 97 } 92 stdI = gfanlib_kStd_wrapper(I,currRing); 93 else 94 stdI = id_Copy(I,currRing); 98 95 tropicalStrategy currentStrategy(I,currRing); 99 96 gfan::ZFan* tropI = tropicalVariety(currentStrategy); … … 101 98 res->data = (char*) tropI; 102 99 undoSetOptionRedSB(); 103 id_Delete(& I,currRing);100 id_Delete(&stdI,currRing); 104 101 return FALSE; 105 102 } 106 103 if ((v!=NULL) && (v->Typ()==NUMBER_CMD)) 107 104 { 108 number p = (number) v->CopyD(); 105 number p = (number) v->Data(); 106 ideal stdI; 109 107 if (!hasFlag(u,FLAG_STD)) 110 { 111 ideal stdI = gfanlib_kStd_wrapper(I,currRing); 112 id_Delete(&I,currRing); 113 I = stdI; 114 } 115 tropicalStrategy currentStrategy(I,p,currRing); 108 stdI = gfanlib_kStd_wrapper(I,currRing); 109 else 110 stdI = id_Copy(I,currRing); 111 tropicalStrategy currentStrategy(stdI,p,currRing); 116 112 gfan::ZFan* tropI = tropicalVariety(currentStrategy); 117 113 res->rtyp = fanID; 118 114 res->data = (char*) tropI; 119 id_Delete(& I,currRing);115 id_Delete(&stdI,currRing); 120 116 return FALSE; 121 117 }
Note: See TracChangeset
for help on using the changeset viewer.