Changeset 670e639 in git


Ignore:
Timestamp:
Feb 1, 2015, 7:02:48 PM (9 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
44d34b600fd8727833693222ffbd36ce803e3e60
Parents:
5510099a60c7cd4cb8ef47b8e583ed11e4b4ffe3
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2015-02-01 19:02:48+01:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:06+01:00
Message:
chg: fixed delete for Groebner cones
Location:
Singular/dyn_modules/gfanlib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/gfanlib/groebnerCone.h

    r551009 r670e639  
    5858    if (polynomialRing) rDelete(polynomialRing);
    5959    polynomialIdeal = NULL;
     60    polynomialRing = NULL;
    6061  }
    6162
  • Singular/dyn_modules/gfanlib/startingCone.cc

    r551009 r670e639  
    1919 * is monomial free.
    2020 **/
    21 static bool checkContainmentInTropicalVariety(const groebnerCone sigma)
    22 {
    23   ideal I = sigma.getPolynomialIdeal();
    24   ring r = sigma.getPolynomialRing();
    25   const tropicalStrategy* currentStrategy = sigma.getTropicalStrategy();
    26 
    27   gfan::ZCone zc = sigma.getPolyhedralCone();
    28   gfan::ZMatrix zm = zc.extremeRays();
    29   for (int i=0; i<zm.getHeight(); i++)
    30   {
    31     gfan::ZVector w = zm[i];
    32     if (currentStrategy->isValuationNonTrivial() && w[0].sign()==0)
    33       continue;
    34     poly s = currentStrategy->checkInitialIdealForMonomial(I,r,w);
    35     if (s)
    36     {
    37       p_Delete(&s,r);
    38       return false;
    39     }
    40   }
    41 
    42   zm = zc.generatorsOfLinealitySpace();
    43   for (int i=0; i<zm.getHeight(); i++)
    44   {
    45     gfan::ZVector w = zm[i];
    46     if (currentStrategy->isValuationNonTrivial() && w[0].sign()==0)
    47       continue;
    48     poly s = currentStrategy->checkInitialIdealForMonomial(I,r,w);
    49     if (s)
    50     {
    51       p_Delete(&s,r);
    52       return false;
    53     }
    54   }
    55 
    56   return true;
    57 }
    58 
    59 
    60 static bool checkOneCodimensionalLinealitySpace(const groebnerCone sigma)
    61 {
    62   gfan::ZCone zc = sigma.getPolyhedralCone();
    63   int linDim = zc.dimensionOfLinealitySpace();
    64   int dim = zc.dimension();
    65   return (linDim+1)==dim;
    66 }
     21// static bool checkContainmentInTropicalVariety(const groebnerCone sigma)
     22// {
     23//   ideal I = sigma.getPolynomialIdeal();
     24//   ring r = sigma.getPolynomialRing();
     25//   const tropicalStrategy* currentStrategy = sigma.getTropicalStrategy();
     26
     27//   gfan::ZCone zc = sigma.getPolyhedralCone();
     28//   gfan::ZMatrix zm = zc.extremeRays();
     29//   for (int i=0; i<zm.getHeight(); i++)
     30//   {
     31//     gfan::ZVector w = zm[i];
     32//     if (currentStrategy->isValuationNonTrivial() && w[0].sign()==0)
     33//       continue;
     34//     poly s = currentStrategy->checkInitialIdealForMonomial(I,r,w);
     35//     if (s)
     36//     {
     37//       p_Delete(&s,r);
     38//       return false;
     39//     }
     40//   }
     41
     42//   zm = zc.generatorsOfLinealitySpace();
     43//   for (int i=0; i<zm.getHeight(); i++)
     44//   {
     45//     gfan::ZVector w = zm[i];
     46//     if (currentStrategy->isValuationNonTrivial() && w[0].sign()==0)
     47//       continue;
     48//     poly s = currentStrategy->checkInitialIdealForMonomial(I,r,w);
     49//     if (s)
     50//     {
     51//       p_Delete(&s,r);
     52//       return false;
     53//     }
     54//   }
     55
     56//   return true;
     57// }
     58
     59
     60// static bool checkOneCodimensionalLinealitySpace(const groebnerCone sigma)
     61// {
     62//   gfan::ZCone zc = sigma.getPolyhedralCone();
     63//   int linDim = zc.dimensionOfLinealitySpace();
     64//   int dim = zc.dimension();
     65//   return (linDim+1)==dim;
     66// }
    6767
    6868
     
    537537    id_Delete(&inI,r);
    538538
    539     assume(checkContainmentInTropicalVariety(startingCone));
     539    // assume(checkContainmentInTropicalVariety(startingCone));
    540540    return startingCone;
    541541  }
  • Singular/dyn_modules/gfanlib/tropicalTraversal.cc

    r551009 r670e639  
    4848  workingList.insert(startingCone);
    4949  const tropicalStrategy* currentStrategy=startingCone.getTropicalStrategy();
     50  std::cout << "starting traversal" << std::endl;
    5051  while(!workingList.empty())
    5152  {
    52     // std::cout << "starting traversal" << std::endl;
    5353    /**
    5454     * Pick an element the working list and compute interior points on its facets
    5555     */
     56    std::cout << "picking cone and computing interior facet points..." << std::endl;
    5657    groebnerCone sigma=*(workingList.begin());
    5758    gfan::ZMatrix interiorPoints = interiorPointsOfFacets(sigma.getPolyhedralCone());
     
    6667      {
    6768        ideal inI = initial(sigma.getPolynomialIdeal(),sigma.getPolynomialRing(),interiorPoint);
     69        std::cout << "picking interiorPoint and computing rays of tropical star..." << std::endl;
    6870        gfan::ZMatrix normalVectors = raysOfTropicalStar(inI,
    6971                                                         sigma.getPolynomialRing(),
     
    7274        id_Delete(&inI,sigma.getPolynomialRing());
    7375
     76        std::cout << "checking for th neccessity to flip..." << std::endl;
    7477        std::vector<bool> needToFlip = checkNecessaryFlips(tropicalVariety,workingList,interiorPoint,normalVectors);
    7578        for (int j=0; j<normalVectors.getHeight(); j++)
     
    7780          if (needToFlip[j])
    7881          {
     82            std::cout << "flipping cone..." << std::endl;
    7983            groebnerCone neighbour = sigma.flipCone(interiorPoint,normalVectors[j]);
    8084            workingList.insert(neighbour);
     
    8791    workingList.erase(sigma);
    8892    tropicalVariety.insert(sigma);
    89     // std::cout << "tropicalVariety.size():" << tropicalVariety.size() << std::endl;
    90     // std::cout << "workingList.size():" << workingList.size() << std::endl;
     93    std::cout << "tropicalVariety.size():" << tropicalVariety.size() << std::endl;
     94    std::cout << "workingList.size():" << workingList.size() << std::endl;
    9195  }
    9296  return tropicalVariety;
     
    98102  groebnerCones workingList;
    99103  workingList.insert(startingCone);
     104  std::cout << "starting traversal" << std::endl;
    100105  while(!workingList.empty())
    101106  {
    102     // std::cout << "starting traversal" << std::endl;
    103107    const groebnerCone sigma=*(workingList.begin());
    104108    const groebnerCones neighbours = sigma.tropicalNeighbours();
Note: See TracChangeset for help on using the changeset viewer.