Changeset 441944 in git


Ignore:
Timestamp:
Aug 6, 2014, 4:39:42 PM (10 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'spielwiese', 'd1d239e9808fca76a9497a01fa91ad4e8db6fba5')
Children:
78abc705dd6af8b10c453361ab125294a2432189
Parents:
3fe2153c36725d117f2ec7b959b05eb1cf5d0ac8
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2014-08-06 16:39:42+02:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:04+01:00
Message:
new: various starting point algorithms for principal ideals for natalia
Location:
Singular/dyn_modules/gfanlib
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/gfanlib/adjustWeights.cc

    r3fe215 r441944  
    9696  for (unsigned i=1; i<e.size(); i++)
    9797  {
    98     gfan::Integer kk = gfan::Integer((long)1)-(gfan::Integer((long)e[i].sign())*e[i])/w[i];
    99     if (k<kk)
    100       k = kk;
     98    if (e[i].sign()<=0)
     99    {
     100      gfan::Integer kk = gfan::Integer((long)1)-(e[i]/w[i]);
     101      if (k<kk)
     102        k = kk;
     103    }
    101104  }
    102105  /* compute e+k*w, check it for correctness and return it */
  • Singular/dyn_modules/gfanlib/groebnerCone.h

    r3fe215 r441944  
    1313#include <tropicalStrategy.h>
    1414
     15/** \file
     16 * implementation of the class groebnerCone
     17 *
     18 * groebnerCone is a class that encapsulates relevant (possibly redundant) information about a groebnerCone.
     19 * Moreover, it contains implrementation of several highly non-trivial algorithms, such as computing its neighbours
     20 * in the Groebner fan or computing its neighbours in the tropical variety.
     21 */
     22
    1523class groebnerCone;
    1624struct groebnerCone_compare;
     
    2230
    2331private:
     32  /**
     33   * ideal to which this Groebner cone belongs to
     34   */
    2435  ideal polynomialIdeal;
     36  /**
     37   * ring in which the ideal exists
     38   */
    2539  ring polynomialRing;
    2640  gfan::ZCone polyhedralCone;
  • Singular/dyn_modules/gfanlib/ppinitialReduction.cc

    r3fe215 r441944  
    1717 * with respect to p-t
    1818 **/
    19 static bool pReduce(poly g, const number p, const ring r)
     19static bool pReduce(poly &g, const number p, const ring r)
    2020{
    2121  poly toBeChecked = pNext(g);
     
    5555        p_AddExp(subst,1,power,r);
    5656        p_SetCoeff(subst,coeff,r);
    57         p_Setm(subst,r); pTest(subst);
     57        p_Setm(subst,r); p_Test(subst,r);
    5858        toBeChecked=p_LmDeleteAndNext(toBeChecked,r);
    5959        toBeChecked=p_Add_q(toBeChecked,subst,r);
    60         pTest(toBeChecked);
     60        p_Test(toBeChecked,r);
    6161      }
    6262      else
     
    6868    }
    6969  }
     70  p_Test(g,r);
    7071  return false;
    7172}
     
    106107bool ppreduceInitially(poly &h, const poly g, const ring r)
    107108{
    108   pTest(h); pTest(g); poly hCache;
     109  p_Test(h,r);
     110  p_Test(g,r);
     111  poly hCache;
    109112  for (hCache=h; hCache; pIter(hCache))
    110113    if (p_LeadmonomDivisibleBy(g,hCache,r)) break;
     
    117120    for (int i=2; i<=r->N; i++)
    118121      p_SetExp(hAlphaT,i,0,r);
    119     p_Setm(hAlphaT,r); pTest(hAlphaT);
    120     poly q1 = p_Mult_nn(h,gAlpha,r); pTest(q1);
    121     poly q2 = p_Mult_q(p_Copy(g,r),hAlphaT,r); pTest(q2);
    122     q2 = p_Neg(q2,r); pTest(q2);
     122    p_Setm(hAlphaT,r); p_Test(hAlphaT,r);
     123    poly q1 = p_Mult_nn(h,gAlpha,r); p_Test(q1,r);
     124    poly q2 = p_Mult_q(p_Copy(g,r),hAlphaT,r); p_Test(q2,r);
     125    q2 = p_Neg(q2,r); p_Test(q2,r);
    123126    h = p_Add_q(q1,q2,r);
    124     pTest(h);
     127    p_Test(h,r);
    125128    return true;
    126129  }
  • Singular/dyn_modules/gfanlib/startingCone.cc

    r3fe215 r441944  
    3535
    3636
     37static bool checkOneCodimensionalLinealitySpace(const groebnerCone sigma)
     38{
     39  gfan::ZCone zc = sigma.getPolyhedralCone();
     40  int linDim = zc.dimensionOfLinealitySpace();
     41  int dim = zc.dimension();
     42  return (linDim+1)==dim;
     43}
     44
     45
    3746/***
    3847 * Computes a starting point by traversing the Groebner fan,
     
    7887}
    7988
     89BOOLEAN positiveTropicalStartingPoint(leftv res, leftv args)
     90{
     91  leftv u = args;
     92  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
     93  {
     94    ideal I = (ideal) u->Data();
     95    if (idSize(I)==1)
     96    {
     97      tropicalStrategy currentStrategy(I,currRing);
     98      poly g = I->m[0];
     99      std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,currentStrategy);
     100      for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
     101      {
     102        gfan::ZMatrix ray = zc->extremeRays();
     103        for (int i=0; i<ray.getHeight(); i++)
     104        {
     105          if (ray[i].isPositive())
     106          {
     107            res->rtyp = BIGINTMAT_CMD;
     108            res->data = (void*) zVectorToBigintmat(ray[i]);
     109            return FALSE;
     110          }
     111        }
     112      }
     113      res->rtyp = BIGINTMAT_CMD;
     114      res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
     115      return FALSE;
     116    }
     117    WerrorS("positiveTropicalStartingPoint: ideal not principal");
     118    return TRUE;
     119  }
     120  WerrorS("positiveTropicalStartingPoint: unexpected parameters");
     121  return TRUE;
     122}
     123
     124BOOLEAN nonNegativeTropicalStartingPoint(leftv res, leftv args)
     125{
     126  leftv u = args;
     127  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
     128  {
     129    ideal I = (ideal) u->Data();
     130    if (idSize(I)==1)
     131    {
     132      tropicalStrategy currentStrategy(I,currRing);
     133      poly g = I->m[0];
     134      std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,currentStrategy);
     135      for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
     136      {
     137        gfan::ZMatrix ray = zc->extremeRays();
     138        for (int i=0; i<ray.getHeight(); i++)
     139        {
     140          if (ray[i].isNonNegative())
     141          {
     142            res->rtyp = BIGINTMAT_CMD;
     143            res->data = (void*) zVectorToBigintmat(ray[i]);
     144            return FALSE;
     145          }
     146        }
     147      }
     148      res->rtyp = BIGINTMAT_CMD;
     149      res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
     150      return FALSE;
     151    }
     152    WerrorS("nonNegativeTropicalStartingPoint: ideal not principal");
     153    return TRUE;
     154  }
     155  WerrorS("nonNegativeTropicalStartingPoint: unexpected parameters");
     156  return TRUE;
     157}
     158
     159BOOLEAN negativeTropicalStartingPoint(leftv res, leftv args)
     160{
     161  leftv u = args;
     162  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
     163  {
     164    ideal I = (ideal) u->Data();
     165    if (idSize(I)==1)
     166    {
     167      tropicalStrategy currentStrategy(I,currRing);
     168      poly g = I->m[0];
     169      std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,currentStrategy);
     170      for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
     171      {
     172        gfan::ZMatrix ray = zc->extremeRays();
     173        for (int i=0; i<ray.getHeight(); i++)
     174        {
     175          gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i];
     176          if (negatedRay.isPositive())
     177          {
     178            res->rtyp = BIGINTMAT_CMD;
     179            res->data = (void*) zVectorToBigintmat(ray[i]);
     180            return FALSE;
     181          }
     182        }
     183      }
     184      res->rtyp = BIGINTMAT_CMD;
     185      res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
     186      return FALSE;
     187    }
     188    WerrorS("negativeTropicalStartingPoint: ideal not principal");
     189    return TRUE;
     190  }
     191  WerrorS("negativeTropicalStartingPoint: unexpected parameters");
     192  return TRUE;
     193}
     194
     195BOOLEAN nonPositiveTropicalStartingPoint(leftv res, leftv args)
     196{
     197  leftv u = args;
     198  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
     199  {
     200    ideal I = (ideal) u->Data();
     201    if (idSize(I)==1)
     202    {
     203      tropicalStrategy currentStrategy(I,currRing);
     204      poly g = I->m[0];
     205      std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,currentStrategy);
     206      for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
     207      {
     208        gfan::ZMatrix ray = zc->extremeRays();
     209        for (int i=0; i<ray.getHeight(); i++)
     210        {
     211          gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i];
     212          if (negatedRay.isNonNegative())
     213          {
     214            res->rtyp = BIGINTMAT_CMD;
     215            res->data = (void*) zVectorToBigintmat(ray[i]);
     216            return FALSE;
     217          }
     218        }
     219      }
     220      res->rtyp = BIGINTMAT_CMD;
     221      res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
     222      return FALSE;
     223    }
     224    WerrorS("nonPositiveTropicalStartingPoint: ideal not principal");
     225    return TRUE;
     226  }
     227  WerrorS("nonPositiveTropicalStartingPoint: unexpected parameters");
     228  return TRUE;
     229}
     230
    80231BOOLEAN tropicalStartingPoint(leftv res, leftv args)
    81232{
     
    184335
    185336  assume(checkContainmentInTropicalVariety(tropicalStartingCone));
     337  assume(checkOneCodimensionalLinealitySpace(tropicalStartingCone));
    186338  return tropicalStartingCone;
    187339}
  • Singular/dyn_modules/gfanlib/startingCone.h

    r3fe215 r441944  
    88
    99BOOLEAN tropicalStartingPoint(leftv res, leftv args);
     10BOOLEAN positiveTropicalStartingPoint(leftv res, leftv args);
     11BOOLEAN nonNegativeTropicalStartingPoint(leftv res, leftv args);
     12BOOLEAN negativeTropicalStartingPoint(leftv res, leftv args);
     13BOOLEAN nonPositiveTropicalStartingPoint(leftv res, leftv args);
    1014BOOLEAN tropicalStartingCone(leftv res, leftv args);
    1115
  • Singular/dyn_modules/gfanlib/tropical.cc

    r3fe215 r441944  
    195195  // p->iiAddCproc("","tropicalCurve1",FALSE,tropicalCurve1);
    196196  p->iiAddCproc("","tropicalStartingPoint",FALSE,tropicalStartingPoint);
     197  p->iiAddCproc("","positiveTropicalStartingPoint",FALSE,positiveTropicalStartingPoint);
     198  p->iiAddCproc("","nonNegativeTropicalStartingPoint",FALSE,nonNegativeTropicalStartingPoint);
     199  p->iiAddCproc("","negativeTropicalStartingPoint",FALSE,negativeTropicalStartingPoint);
     200  p->iiAddCproc("","nonPositiveTropicalStartingPoint",FALSE,nonPositiveTropicalStartingPoint);
    197201  p->iiAddCproc("","tropicalStartingCone",FALSE,tropicalStartingCone);
    198202  p->iiAddCproc("","tropicalVariety",FALSE,tropicalVariety);
  • Singular/dyn_modules/gfanlib/tropicalStrategy.cc

    r3fe215 r441944  
    3838}
    3939
     40static bool noExtraReduction(ideal /*I*/, ring /*r*/, number /*p*/)
     41{
     42  return false;
     43}
     44
     45/**
     46 * Initializes all relevant structures and information for the trivial valuation case,
     47 * i.e. computing a tropical variety without any valuation.
     48 *g
     49 */
     50tropicalStrategy::tropicalStrategy(ideal I, ring r):
     51  originalRing(rCopy(r)),
     52  originalIdeal(id_Copy(I,r)),
     53  dimensionOfIdeal(dim(originalIdeal,originalRing)),
     54  linealitySpace(homogeneitySpace(originalIdeal,originalRing)),
     55  startingRing(rCopy(originalRing)),
     56  startingIdeal(id_Copy(originalIdeal,originalRing)),
     57  uniformizingParameter(NULL),
     58  shortcutRing(rCopy(originalRing)),
     59  onlyLowerHalfSpace(false),
     60  weightAdjustingAlgorithm1(nonvalued_adjustWeightForHomogeneity),
     61  weightAdjustingAlgorithm2(nonvalued_adjustWeightUnderHomogeneity),
     62  extraReductionAlgorithm(noExtraReduction)
     63{
     64  assume(rField_is_Q(r));
     65}
     66
     67/**
     68 * Given a polynomial ring r over the rational numbers and a weighted ordering,
     69 * returns a polynomial ring s over the integers with one extra variable, which is weighted -1.
     70 */
     71static ring constructStartingRing(ring r)
     72{
     73  assume(rField_is_Q(r));
     74
     75  ring s = rCopy0(r,FALSE,FALSE);
     76  nKillChar(s->cf);
     77  s->cf = nInitChar(n_Z,NULL);
     78
     79  int n = rVar(s)+1;
     80  s->N = n;
     81  char** oldNames = s->names;
     82  s->names = (char**) omAlloc((n+1)*sizeof(char**));
     83  s->names[0] = omStrDup("t");
     84  for (int i=1; i<n; i++)
     85    s->names[i] = oldNames[i-1];
     86  omFree(oldNames);
     87
     88  s->order = (int*) omAlloc0(3*sizeof(int));
     89  s->block0 = (int*) omAlloc0(3*sizeof(int));
     90  s->block1 = (int*) omAlloc0(3*sizeof(int));
     91  s->wvhdl = (int**) omAlloc0(3*sizeof(int**));
     92  s->order[0] = ringorder_ws;
     93  s->block0[0] = 1;
     94  s->block1[0] = n;
     95  s->wvhdl[0] = (int*) omAlloc(n*sizeof(int));
     96  s->wvhdl[0][0] = 1;
     97  for (int i=1; i<n; i++)
     98    s->wvhdl[0][i] = -(r->wvhdl[0][i-1]);
     99  s->order[1] = ringorder_C;
     100
     101  rComplete(s);
     102  return s;
     103}
     104
     105static ring writeOrderingAsWP(ring r)
     106{
     107  assume(r->order[0]==ringorder_wp || r->order[0]==ringorder_dp);
     108  if (r->order[0]==ringorder_dp)
     109  {
     110    ring s = rCopy0(r,FALSE,TRUE);
     111    rComplete(s);
     112    return s;
     113  }
     114  return rCopy(r);
     115}
    40116
    41117/***
     
    43119 * i.e. computing a tropical variety over the rational numbers with p-adic valuation
    44120 **/
    45 tropicalStrategy::tropicalStrategy(ideal J, number q, ring s)
     121tropicalStrategy::tropicalStrategy(ideal J, number q, ring s):
     122  originalRing(rCopy(s)),
     123  originalIdeal(id_Copy(J,s)),
     124  dimensionOfIdeal(dim(originalIdeal,originalRing)),
     125  linealitySpace(homogeneitySpace(originalIdeal,originalRing)),
     126  startingRing(rCopy(originalRing)),
     127  startingIdeal(id_Copy(originalIdeal,originalRing)),
     128  uniformizingParameter(NULL),
     129  shortcutRing(rCopy(originalRing)),
     130  onlyLowerHalfSpace(false),
     131  weightAdjustingAlgorithm1(nonvalued_adjustWeightForHomogeneity),
     132  weightAdjustingAlgorithm2(nonvalued_adjustWeightUnderHomogeneity),
     133  extraReductionAlgorithm(noExtraReduction)
    46134{
    47135  /* assume that the ground field of the originalRing is Q */
     
    75163  weightAdjustingAlgorithm2 = valued_adjustWeightUnderHomogeneity;
    76164  extraReductionAlgorithm = ppreduceInitially;
    77 }
    78 
    79 static bool nothing(ideal /*I*/, ring /*r*/, number /*p*/)
    80 {
    81   return false;
    82 }
    83 
    84 /***
    85  * Initializes all relevant structures and information for the valued case,
    86  * i.e. computing a tropical variety without any valuation.
    87  **/
    88 tropicalStrategy::tropicalStrategy(ideal I, ring r)
    89 {
    90   /* assume that the ground field of the originalRing is Q */
    91   assume(rField_is_Q(r));
    92 
    93   onlyLowerHalfSpace = false;                         // convex computations in the whole vector space
    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
    101 
    102   /* set function pointers to the appropiate functions */
    103   weightAdjustingAlgorithm1 = nonvalued_adjustWeightForHomogeneity;
    104   weightAdjustingAlgorithm2 = nonvalued_adjustWeightUnderHomogeneity;
    105   extraReductionAlgorithm = nothing;
    106165}
    107166
     
    113172  dimensionOfIdeal(currentStrategy.getDimensionOfIdeal()),
    114173  onlyLowerHalfSpace(currentStrategy.restrictToLowerHalfSpace()),
    115   weightAdjustingAlgorithm1(currentStrategy.getWeightAdjustingAlgorithm1()),
    116   weightAdjustingAlgorithm2(currentStrategy.getWeightAdjustingAlgorithm2()),
    117   extraReductionAlgorithm(currentStrategy.getExtraReductionAlgorithm())
     174  weightAdjustingAlgorithm1(currentStrategy.weightAdjustingAlgorithm1),
     175  weightAdjustingAlgorithm2(currentStrategy.weightAdjustingAlgorithm2),
     176  extraReductionAlgorithm(currentStrategy.extraReductionAlgorithm)
    118177{
    119178  if (startingRing) rTest(startingRing);
     
    140199  dimensionOfIdeal = currentStrategy.getDimensionOfIdeal();
    141200  onlyLowerHalfSpace = currentStrategy.restrictToLowerHalfSpace();
    142   weightAdjustingAlgorithm1 = currentStrategy.getWeightAdjustingAlgorithm1();
    143   weightAdjustingAlgorithm2 = currentStrategy.getWeightAdjustingAlgorithm2();
    144   extraReductionAlgorithm = currentStrategy.getExtraReductionAlgorithm();
     201  weightAdjustingAlgorithm1 = currentStrategy.weightAdjustingAlgorithm1;
     202  weightAdjustingAlgorithm2 = currentStrategy.weightAdjustingAlgorithm2;
     203  extraReductionAlgorithm = currentStrategy.extraReductionAlgorithm;
    145204
    146205  if (startingRing) rTest(startingRing);
  • Singular/dyn_modules/gfanlib/tropicalStrategy.h

    r3fe215 r441944  
    77#include <set>
    88
     9/** \file
     10 * implementation of the class tropicalStrategy
     11 *
     12 * tropicalStrategy is a class that contains information relevant for
     13 * computing tropical varieties that is dependent on the valuation of the coefficient field.
     14 * It represents the mutable part of an overall framework that is capable of
     15 * computing tropical varieties both over coefficient fields without valuation and
     16 * with valuation (currently: only p-adic valuation over rational numbers)
     17 */
     18
    919typedef gfan::ZVector (*wAdjAlg1)(gfan::ZVector);
    1020typedef gfan::ZVector (*wAdjAlg2)(gfan::ZVector,gfan::ZVector);
     
    1424{
    1525private:
     26  /**
     27   * polynomial ring over a field with valuation
     28   */
    1629  ring originalRing;
     30  /**
     31   * input ideal, assumed to be a homogeneous prime ideal
     32   */
    1733  ideal originalIdeal;
     34  /**
     35   * dimension of the input ideal
     36   */
    1837  int dimensionOfIdeal;
     38  /**
     39   * the homogeneity space of the Grobner fan
     40   */
     41  gfan::ZCone linealitySpace;
     42  /**
     43   * polynomial ring over the valuation ring extended by one extra variable t
     44   */
    1945  ring startingRing;
     46  /**
     47   * preimage of the input ideal under the map that sends t to the uniformizing parameter
     48   */
    2049  ideal startingIdeal;
     50  /**
     51   * uniformizing parameter in the valuation ring
     52   */
    2153  number uniformizingParameter;
    22   gfan::ZCone linealitySpace;
    23 
     54  /**
     55   * polynomial ring over the residue field
     56   */
     57  ring shortcutRing;
     58
     59  /**
     60   * true if valuation non-trivial, false otherwise
     61   */
    2462  bool onlyLowerHalfSpace;
    2563
     64  /**
     65   * A function such that:
     66   * Given weight w, returns a strictly positive weight u such that an ideal satisfying
     67   * the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w
     68   * if and only if it is homogeneous with respect to u
     69   */
    2670  gfan::ZVector (*weightAdjustingAlgorithm1) (gfan::ZVector w);
     71  /**
     72   * A function such that:
     73   * Given strictly positive weight w and weight v,
     74   * returns a strictly positive weight u such that on an ideal that is weighted homogeneous
     75   * with respect to w the weights u and v coincide
     76   */
    2777  gfan::ZVector (*weightAdjustingAlgorithm2) (gfan::ZVector v, gfan::ZVector w);
     78  /**
     79   * A function that reduces the generators of an ideal I so that
     80   * the inequalities and equations of the Groebner cone can be read off.
     81   */
    2882  bool (*extraReductionAlgorithm) (ideal I, ring r, number p);
    2983
    3084public:
    3185
     86  /**
     87   * Constructor for the trivial valuation case
     88   */
    3289  tropicalStrategy(const ideal I, const ring r);
     90  /**
     91   * Constructor for the non-trivial valuation case
     92   * p is the uniformizing parameter of the valuation
     93   */
    3394  tropicalStrategy(const ideal J, const number p, const ring s);
     95  /**
     96   * copy constructor
     97   */
    3498  tropicalStrategy(const tropicalStrategy& currentStrategy);
     99  /**
     100   * destructor
     101   */
    35102  ~tropicalStrategy();
     103  /**
     104   * assignment operator
     105   **/
    36106  tropicalStrategy& operator=(const tropicalStrategy& currentStrategy);
    37107
    38108
     109  /**
     110   * returns the polynomial ring over the field with valuation
     111   */
    39112  ring getOriginalRing() const
    40113  {
     
    43116  }
    44117
     118  /**
     119   * returns the polynomial ring over the valuation ring
     120   */
    45121  ring getStartingRing() const
    46122  {
     
    49125  }
    50126
    51   number getUniformizingParameter() const
    52   {
    53     return uniformizingParameter;
    54   }
    55 
     127  /**
     128   * returns the input ideal
     129   */
    56130  ideal getStartingIdeal() const
    57131  {
     
    60134  }
    61135
     136  /**
     137   * returns the dimension of the input ideal
     138   */
    62139  int getDimensionOfIdeal() const
    63140  {
     
    65142  }
    66143
     144  /**
     145   * returns the uniformizing parameter in the valuation ring
     146   */
     147  number getUniformizingParameter() const
     148  {
     149    return uniformizingParameter;
     150  }
     151
     152  /**
     153   * returns the homogeneity space of the preimage ideal
     154   */
    67155  gfan::ZCone getHomogeneitySpace() const
    68156  {
     
    70158  }
    71159
     160  /**
     161   * returns the dimension of the homogeneity space
     162   */
    72163  int getDimensionOfHomogeneitySpace() const
    73164  {
     
    75166  }
    76167
     168  /**
     169   * returns true, if valuation non-trivial, false otherwise
     170   */
    77171  bool restrictToLowerHalfSpace() const
    78172  {
     
    80174  }
    81175
    82   wAdjAlg1 getWeightAdjustingAlgorithm1() const
    83   {
    84     return weightAdjustingAlgorithm1;
    85   }
    86 
    87   wAdjAlg2 getWeightAdjustingAlgorithm2() const
    88   {
    89     return weightAdjustingAlgorithm2;
    90   }
    91 
    92   redAlg getExtraReductionAlgorithm() const
    93   {
    94     return extraReductionAlgorithm;
    95   }
    96 
     176  /**
     177   * Given weight w, returns a strictly positive weight u such that an ideal satisfying
     178   * the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w
     179   * if and only if it is homogeneous with respect to u
     180   */
    97181  gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const
    98182  {
     
    100184  }
    101185
     186  /**
     187   * Given strictly positive weight w and weight v,
     188   * returns a strictly positive weight u such that on an ideal that is weighted homogeneous
     189   * with respect to w the weights u and v coincide
     190   */
    102191  gfan::ZVector adjustWeightUnderHomogeneity(gfan::ZVector v, gfan::ZVector w) const
    103192  {
     
    105194  }
    106195
     196  /**
     197   * reduces the generators of an ideal I so that
     198   * the inequalities and equations of the Groebner cone can be read off.
     199   */
    107200  bool reduce(ideal I, ring r) const
    108201  {
    109202    rTest(r);  id_Test(I,r);
    110     return this->extraReductionAlgorithm(I,r,uniformizingParameter);
     203    nMapFunc nMap = n_SetMap(startingRing->cf,r->cf);
     204    number p = nMap(uniformizingParameter,startingRing->cf,r->cf);
     205    bool b = this->extraReductionAlgorithm(I,r,p);
     206    n_Delete(&p,r->cf);
     207    return b;
    111208  }
    112209};
  • Singular/dyn_modules/gfanlib/tropicalVariety.cc

    r3fe215 r441944  
    3737    {
    3838      tropicalStrategy currentStrategy(I,currRing);
    39       gfan::ZFan* tropI = tropicalVariety(I,currRing,currentStrategy);
     39      gfan::ZFan* tropI = tropicalVariety(currentStrategy);
    4040      res->rtyp = fanID;
    4141      res->data = (char*) tropI;
     
    4747      tropicalStrategy currentStrategy(I,p,currRing);
    4848      setOptionRedSB();
    49       gfan::ZFan* tropI = tropicalVariety(I,currRing,currentStrategy);
     49      gfan::ZFan* tropI = tropicalVariety(currentStrategy);
    5050      undoSetOptionRedSB();
    5151      res->rtyp = fanID;
  • Singular/dyn_modules/gfanlib/tropicalVarietyOfIdeals.cc

    r3fe215 r441944  
    33#include <tropicalTraversal.h>
    44
    5 gfan::ZFan* tropicalVariety(const ideal I, const ring r, const tropicalStrategy currentStrategy)
     5gfan::ZFan* tropicalVariety(const tropicalStrategy currentStrategy)
    66{
     7  ideal I = currentStrategy.getStartingIdeal();
     8  ring r = currentStrategy.getStartingRing();
    79  groebnerCone startingCone = tropicalStartingCone(I,r,currentStrategy);
    810  groebnerCones tropicalVariety = tropicalTraversal(startingCone);
  • Singular/dyn_modules/gfanlib/tropicalVarietyOfIdeals.h

    r3fe215 r441944  
    55#include <tropicalStrategy.h>
    66
    7 gfan::ZFan* tropicalVariety(const ideal I, const ring r, const tropicalStrategy currentStrategy);
     7gfan::ZFan* tropicalVariety(const tropicalStrategy currentStrategy);
    88
    99#endif
Note: See TracChangeset for help on using the changeset viewer.