Changeset fb1872 in git
- Timestamp:
- Jul 22, 2014, 3:39:35 PM (9 years ago)
- Branches:
- (u'spielwiese', 'a7324b6e0b44a1a8ed3fa4d9ca3e2ff210ddd52c')
- Children:
- 3fe2153c36725d117f2ec7b959b05eb1cf5d0ac8
- Parents:
- 06d5774722df3a09ae8f983da8c2b455d6224f31
- git-author:
- Yue Ren <ren@mathematik.uni-kl.de>2014-07-22 15:39:35+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:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/containsMonomial.cc
r06d5774 rfb1872 180 180 ideal Jstd = kStd(J,currRing->qideal,testHomog,&nullVector); 181 181 ideal JquotM = idQuot(Jstd,M,true,true); k++; 182 ideal JquotMredJ = kNF(J quotM,currRing->qideal,Jstd);182 ideal JquotMredJ = kNF(Jstd,currRing->qideal,JquotM); 183 183 b = idIs0(JquotMredJ); 184 184 id_Delete(&Jstd,r); id_Delete(&J,r); J = JquotM; -
Singular/dyn_modules/gfanlib/groebnerCone.cc
r06d5774 rfb1872 284 284 ideal inI = initial(I,r,R[i]); 285 285 poly s = checkForMonomialViaSuddenSaturation(inI,r); 286 id_Delete(&inI,r);287 286 if (s == NULL) 288 287 { 288 id_Delete(&inI,r); 289 289 p_Delete(&s,r); 290 290 return R[i]; 291 291 } 292 id_Delete(&inI,r); 292 293 p_Delete(&s,r); 293 294 } -
Singular/dyn_modules/gfanlib/startingCone.cc
r06d5774 rfb1872 84 84 ideal I = (ideal) u->Data(); 85 85 tropicalStrategy currentStrategy(I,currRing); 86 if (currentStrategy.getDimensionOfIdeal()==currentStrategy.getDimensionOfHomogeneitySpace()) 87 { 88 gfan::ZCone homogSpace = currentStrategy.getHomogeneitySpace(); 89 gfan::ZMatrix homogSpaceGenerators = homogSpace.generatorsOfLinealitySpace(); 90 assume(homogSpaceGenerators.getHeight()>0); 91 res->rtyp = BIGINTMAT_CMD; 92 res->data = (void*) zVectorToBigintmat(homogSpaceGenerators[0]); 93 return FALSE; 94 } 86 95 std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(I,currRing,currentStrategy); 87 96 gfan::ZVector startingPoint = startingData.first; -
Singular/dyn_modules/gfanlib/tropical.cc
r06d5774 rfb1872 16 16 17 17 18 gfan::ZCone homogeneitySpace(ideal I, ring r) 19 { 20 int n = rVar(r); 21 poly g; 22 int* leadexpv = (int*) omAlloc((n+1)*sizeof(int)); 23 int* tailexpv = (int*) omAlloc((n+1)*sizeof(int)); 24 gfan::ZVector leadexpw = gfan::ZVector(n); 25 gfan::ZVector tailexpw = gfan::ZVector(n); 26 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 27 for (int i=0; i<IDELEMS(I); i++) 28 { 29 g = (poly) I->m[i]; pGetExpV(g,leadexpv); 30 leadexpw = intStar2ZVector(n, leadexpv); 31 pIter(g); 32 while (g != NULL) 33 { 34 pGetExpV(g,tailexpv); 35 tailexpw = intStar2ZVector(n, tailexpv); 36 equations.appendRow(leadexpw-tailexpw); 37 pIter(g); 38 } 39 } 40 omFreeSize(leadexpv,(n+1)*sizeof(int)); 41 omFreeSize(tailexpv,(n+1)*sizeof(int)); 42 return gfan::ZCone(gfan::ZMatrix(0, equations.getWidth()),equations); 43 } 44 45 18 46 BOOLEAN homogeneitySpace(leftv res, leftv args) 19 47 { … … 24 52 if (v == NULL) 25 53 { 26 int n = currRing->N;27 54 ideal I = (ideal) u->Data(); 28 poly g;29 int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));30 int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));31 gfan::ZVector leadexpw = gfan::ZVector(n);32 gfan::ZVector tailexpw = gfan::ZVector(n);33 gfan::ZMatrix equations = gfan::ZMatrix(0,n);34 for (int i=0; i<IDELEMS(I); i++)35 {36 g = (poly) I->m[i]; pGetExpV(g,leadexpv);37 leadexpw = intStar2ZVector(n, leadexpv);38 pIter(g);39 while (g != NULL)40 {41 pGetExpV(g,tailexpv);42 tailexpw = intStar2ZVector(n, tailexpv);43 equations.appendRow(leadexpw-tailexpw);44 pIter(g);45 }46 }47 gfan::ZCone* gCone = new gfan::ZCone(gfan::ZMatrix(0, equations.getWidth()),equations);48 omFreeSize(leadexpv,(n+1)*sizeof(int));49 omFreeSize(tailexpv,(n+1)*sizeof(int));50 51 55 res->rtyp = coneID; 52 res->data = (void*) gCone;56 res->data = (void*) new gfan::ZCone(homogeneitySpace(I,currRing)); 53 57 return FALSE; 54 58 } -
Singular/dyn_modules/gfanlib/tropical.h
r06d5774 rfb1872 4 4 #include "Singular/ipid.h" 5 5 6 gfan::ZCone homogeneitySpace(ideal I, ring r); 6 7 void tropical_setup(SModulFunctions* p); 7 8 -
Singular/dyn_modules/gfanlib/tropicalStrategy.cc
r06d5774 rfb1872 3 3 #include <ppinitialReduction.h> 4 4 #include <ttinitialReduction.h> 5 #include <tropical.h> 5 6 6 7 // for various commands in dim(ideal I, ring r): … … 12 13 * Copied from jjDim in iparith.cc 13 14 **/ 14 staticint dim(ideal I, ring r)15 int dim(ideal I, ring r) 15 16 { 16 17 ring origin = currRing; … … 73 74 weightAdjustingAlgorithm1 = valued_adjustWeightForHomogeneity; 74 75 weightAdjustingAlgorithm2 = valued_adjustWeightUnderHomogeneity; 75 reductionAlgorithm = ppreduceInitially;76 extraReductionAlgorithm = ppreduceInitially; 76 77 } 77 78 78 static bool doNothing(ideal /*I*/, ring /*r*/, number /*p*/)79 static bool nothing(ideal /*I*/, ring /*r*/, number /*p*/) 79 80 { 80 81 return false; … … 89 90 /* assume that the ground field of the originalRing is Q */ 90 91 assume(rField_is_Q(r)); 92 93 onlyLowerHalfSpace = false; // convex computations in the whole vector space 91 94 originalRing = rCopy(r); 95 originalIdeal = id_Copy(I,r); 96 dimensionOfIdeal = dim(originalIdeal,originalRing); // compute dimension of ideal 97 startingRing = rCopy(originalRing); // starting ring is the original ring 98 startingIdeal = id_Copy(I,startingRing); 99 uniformizingParameter = NULL; // no uniformizing parameter 100 linealitySpace = homogeneitySpace(I,startingRing); // compute lineality space of tropical variety 92 101 93 /* the starting ring is the originaRing */ 94 startingRing = rCopy(originalRing); 95 96 /* the uniformizing parameter is non-existant*/ 97 uniformizingParameter = NULL; 98 99 /* set the startingIdeal */ 100 startingIdeal = id_Copy(I,startingRing); 101 102 /* compute the dimension of the ideal */ 103 dimensionOfIdeal = dim(startingIdeal,startingRing); 104 105 /* set the flag that convex computations only occur in the lower half space to false */ 106 onlyLowerHalfSpace = false; 107 108 /* set the function pointers to the appropiate functions */ 102 /* set function pointers to the appropiate functions */ 109 103 weightAdjustingAlgorithm1 = nonvalued_adjustWeightForHomogeneity; 110 104 weightAdjustingAlgorithm2 = nonvalued_adjustWeightUnderHomogeneity; 111 reductionAlgorithm = doNothing;105 extraReductionAlgorithm = nothing; 112 106 } 113 107 … … 121 115 weightAdjustingAlgorithm1(currentStrategy.getWeightAdjustingAlgorithm1()), 122 116 weightAdjustingAlgorithm2(currentStrategy.getWeightAdjustingAlgorithm2()), 123 reductionAlgorithm(currentStrategy.getReductionAlgorithm())117 extraReductionAlgorithm(currentStrategy.getExtraReductionAlgorithm()) 124 118 { 125 119 if (startingRing) rTest(startingRing); … … 148 142 weightAdjustingAlgorithm1 = currentStrategy.getWeightAdjustingAlgorithm1(); 149 143 weightAdjustingAlgorithm2 = currentStrategy.getWeightAdjustingAlgorithm2(); 150 reductionAlgorithm = currentStrategy.getReductionAlgorithm();144 extraReductionAlgorithm = currentStrategy.getExtraReductionAlgorithm(); 151 145 152 146 if (startingRing) rTest(startingRing); -
Singular/dyn_modules/gfanlib/tropicalStrategy.h
r06d5774 rfb1872 15 15 private: 16 16 ring originalRing; 17 ideal originalIdeal; 18 int dimensionOfIdeal; 17 19 ring startingRing; 20 ideal startingIdeal; 18 21 number uniformizingParameter; 19 ideal startingIdeal; 20 int dimensionOfIdeal; 22 gfan::ZCone linealitySpace; 21 23 bool onlyLowerHalfSpace; 22 24 23 25 gfan::ZVector (*weightAdjustingAlgorithm1) (gfan::ZVector w); 24 26 gfan::ZVector (*weightAdjustingAlgorithm2) (gfan::ZVector v, gfan::ZVector w); 25 bool (* reductionAlgorithm) (ideal I, ring r, number p);27 bool (*extraReductionAlgorithm) (ideal I, ring r, number p); 26 28 27 29 public: … … 62 64 } 63 65 66 gfan::ZCone getHomogeneitySpace() const 67 { 68 return linealitySpace; 69 } 70 71 int getDimensionOfHomogeneitySpace() const 72 { 73 return linealitySpace.dimension(); 74 } 75 64 76 bool restrictToLowerHalfSpace() const 65 77 { … … 77 89 } 78 90 79 redAlg get ReductionAlgorithm() const91 redAlg getExtraReductionAlgorithm() const 80 92 { 81 return reductionAlgorithm;93 return extraReductionAlgorithm; 82 94 } 83 95 … … 95 107 { 96 108 rTest(r); id_Test(I,r); 97 return this-> reductionAlgorithm(I,r,uniformizingParameter);109 return this->extraReductionAlgorithm(I,r,uniformizingParameter); 98 110 } 99 111 }; 100 112 113 int dim(ideal I, ring r); 114 101 115 #endif
Note: See TracChangeset
for help on using the changeset viewer.