Changeset 34183a in git


Ignore:
Timestamp:
Jul 7, 2016, 3:08:59 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
a1299c28602fe2bb5ab848f4dd82bb5d10a66412c66a53f1b58e7f846551ad48a7866b06bf852f5fcd79608c61d713b22b8e9ae861168cbd02e4fab9
Parents:
382febc4b9c1d345489e23122c487898797e979d
Message:
removed idSize -> idElem/IDELEMS
Files:
20 edited

Legend:

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

    r382feb r34183a  
    6868  /* compute initial ideal and map it to the new ordering */
    6969  ideal inIr = initial(I,r,interiorPoint);
    70   int k = idSize(I); ideal inIsAdjusted = idInit(k);
     70  int k = IDELEMS(I); ideal inIsAdjusted = idInit(k);
    7171  for (int i=0; i<k; i++)
    72     inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0);
     72  {
     73    if (inIr->m[i]!=NULL)
     74    {
     75      inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0);
     76    }
     77  }
    7378  id_Delete(&inIr,r);
    7479
     
    104109  rTest(s);
    105110  identity = n_SetMap(sAdjusted->cf,s->cf);
    106   k = idSize(IsAdjustedGB); ideal IsGB = idInit(k);
     111  k = IDELEMS(IsAdjustedGB); ideal IsGB = idInit(k);
    107112  for (int i=0; i<k; i++)
    108     IsGB->m[i] = p_PermPoly(IsAdjustedGB->m[i],NULL,sAdjusted,s,identity,NULL,0);
     113  {
     114    if (IsAdjustedGB->m[i]!=NULL)
     115    {
     116      IsGB->m[i] = p_PermPoly(IsAdjustedGB->m[i],NULL,sAdjusted,s,identity,NULL,0);
     117    }
     118  }
    109119  id_Delete(&IsAdjustedGB,sAdjusted);
    110120  rDelete(sAdjusted);
  • Singular/dyn_modules/gfanlib/groebnerComplex.cc

    r382feb r34183a  
    3131        number p = (number) v->Data();
    3232        tropicalStrategy currentStrategy(I,p,currRing);
    33         if (idSize(I)==1)
     33        if ((I->m[0]!=NULL) && (idElem(I)==1))
    3434        {
    3535          try
  • Singular/dyn_modules/gfanlib/groebnerCone.cc

    r382feb r34183a  
    143143  gfan::ZVector tailexpw = gfan::ZVector(n);
    144144  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
    145   for (int i=0; i<idSize(polynomialIdeal); i++)
     145  for (int i=0; i<IDELEMS(polynomialIdeal); i++)
    146146  {
    147147    g = polynomialIdeal->m[i];
     
    193193  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
    194194  int* expv = (int*) omAlloc((n+1)*sizeof(int));
    195   for (int i=0; i<idSize(polynomialIdeal); i++)
     195  for (int i=0; i<IDELEMS(polynomialIdeal); i++)
    196196  {
    197197    poly g = polynomialIdeal->m[i];
     
    251251  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
    252252  int* expv = (int*) omAlloc((n+1)*sizeof(int));
    253   for (int i=0; i<idSize(polynomialIdeal); i++)
     253  for (int i=0; i<IDELEMS(polynomialIdeal); i++)
    254254  {
    255255    poly g = polynomialIdeal->m[i];
     
    303303  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
    304304  int* expv = (int*) omAlloc((n+1)*sizeof(int));
    305   for (int i=0; i<idSize(inI); i++)
     305  for (int i=0; i<IDELEMS(inI); i++)
    306306  {
    307307    poly g = inI->m[i];
     
    319319  }
    320320  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
    321   for (int i=0; i<idSize(polynomialIdeal); i++)
     321  for (int i=0; i<IDELEMS(polynomialIdeal); i++)
    322322  {
    323323    poly g = polynomialIdeal->m[i];
  • Singular/dyn_modules/gfanlib/groebnerFan.cc

    r382feb r34183a  
    9393    if (v==NULL)
    9494    {
    95       if (idSize(I)==1)
     95      if ((I->m[0]!=NULL) && (idElem(I)==1))
    9696      {
    9797        try
  • Singular/dyn_modules/gfanlib/initial.cc

    r382feb r34183a  
    6060ideal initial(const ideal I, const ring r, const gfan::ZVector w)
    6161{
    62   int k = idSize(I); ideal inI = idInit(k);
     62  int k = IDELEMS(I); ideal inI = idInit(k);
    6363  for (int i=0; i<k; i++)
    6464    inI->m[i] = initial(I->m[i],r,w);
     
    9696ideal initial(const ideal I, const ring r, const gfan::ZVector w, const gfan::ZMatrix W)
    9797{
    98   int k = idSize(I); ideal inI = idInit(k);
     98  int k = IDELEMS(I); ideal inI = idInit(k);
    9999  for (int i=0; i<k; i++)
    100100    inI->m[i] = initial(I->m[i],r,w,W);
     
    144144{
    145145  ideal I = *IStar;
    146   int k = idSize(I);
     146  int k = IDELEMS(I);
    147147  for (int i=0; i<k; i++)
    148148    initial(&I->m[i],r,w);
     
    192192{
    193193  ideal I = *IStar;
    194   int k = idSize(I);
     194  int k = IDELEMS(I);
    195195  for (int i=0; i<k; i++)
    196196    initial(&I->m[i],r,w,W);
  • Singular/dyn_modules/gfanlib/lift.cc

    r382feb r34183a  
    1212// {
    1313//   nMapFunc identity = n_SetMap(r->cf,s->cf);
    14 //   int k = idSize(I); ideal Is = idInit(k);
     14//   int k = IDELEMS(I); ideal Is = idInit(k);
    1515//   for (int i=0; i<k; i++)
    1616//     Is->m[i] = p_PermPoly(I->m[i],NULL,r,s,identity,NULL,0);
     
    2525{
    2626  nMapFunc identity = n_SetMap(s->cf,r->cf);
    27   int k = idSize(inI); ideal inIr = idInit(k);
     27  int k = IDELEMS(inI); ideal inIr = idInit(k);
    2828  for (int i=0; i<k; i++)
    29     inIr->m[i] = p_PermPoly(inI->m[i],NULL,s,r,identity,NULL,0);
     29  {
     30    if(inI->m[i]!=NULL)
     31    {
     32      inIr->m[i] = p_PermPoly(inI->m[i],NULL,s,r,identity,NULL,0);
     33    }
     34  }
    3035  ideal Ir = witness(inIr,J,r);
    3136
     
    3338  ideal Is = idInit(k);
    3439  for (int i=0; i<k; i++)
    35     Is->m[i] = p_PermPoly(Ir->m[i],NULL,r,s,identity,NULL,0);
     40  {
     41    if(Ir->m[i]!=NULL)
     42    {
     43      Is->m[i] = p_PermPoly(Ir->m[i],NULL,r,s,identity,NULL,0);
     44    }
     45  }
    3646
    3747  id_Delete(&inIr,r);
  • Singular/dyn_modules/gfanlib/ppinitialReduction.cc

    r382feb r34183a  
    245245void ptNormalize(ideal I, const number p, const ring r)
    246246{
    247   for (int i=0; i<idSize(I); i++)
     247  for (int i=0; i<IDELEMS(I); i++)
    248248    ptNormalize(&(I->m[i]),p,r);
    249249  return;
     
    301301void pReduce(ideal &I, const number p, const ring r)
    302302{
    303   int k = idSize(I);
     303  int k = IDELEMS(I);
    304304  for (int i=0; i<k; i++)
    305305  {
     
    311311    }
    312312  }
    313   return;
    314313}
    315314
     
    395394bool ppreduceInitially(ideal I, const number p, const ring r)
    396395{
    397   int m=idSize(I),n=m; poly cache;
     396  idSkipZeroes(I);
     397  int m=IDELEMS(I),n=m; poly cache;
    398398  do
    399399  {
     
    401401    for (int i=1; i<n; i++)
    402402    {
    403       if (p_LmCmp(I->m[i-1],I->m[i],r)<0)
     403      if (p_LmCmp(I->m[i-1],I->m[i],r)<0) /*p_LmCmp(p,q): requires: p,q!=NULL*/
    404404      {
    405405        cache=I->m[i-1];
     
    481481  p_Test(g,r);
    482482  idInsertPoly(I,g);
    483   int n=idSize(I);
     483  idSkipZeroes(I);
     484  int n=IDELEMS(I);
    484485  int j;
    485486  for (j=n-1; j>0; j--)
    486487  {
    487     if (p_LmCmp(I->m[j], I->m[j-1],r)>0)
     488    if (p_LmCmp(I->m[j], I->m[j-1],r)>0) /*p_LmCmp(p,q) requires: p,q!=NULL */
    488489    {
    489490      poly cache = I->m[j];
     
    666667   *   T is sorted by the ordering on the temrs the pairs correspond to.
    667668   **/
    668   int m=idSize(H);
     669  int m=IDELEMS(H);
    669670  ideal I = idInit(m);
    670671  std::vector<mark> T;
    671672  for (int i=0; i<m; i++)
    672673  {
    673     I->m[i]=H->m[i];
    674     if (pNext(I->m[i])!=NULL)
    675       T.push_back(std::pair<int,int>(i,1));
     674    if(H->m[i]!=NULL)
     675    {
     676      I->m[i]=H->m[i];
     677      if (pNext(I->m[i])!=NULL)
     678        T.push_back(std::pair<int,int>(i,1));
     679    }
    676680  }
    677681
     
    680684   *   by adding suitable elements to I and reducing it initially with respect to itself
    681685   **/
    682   int k=idSize(G);
     686  int k=IDELEMS(G);
    683687  while (T.size()>0)
    684688  {
    685689    sortMarks(I,r,T);
    686     int i=0; for (; i<k; i++)
    687       if (p_LeadmonomDivisibleBy(G->m[i],getTerm(I,T[0]),r)) break;
     690    int i=0;
     691    for (; i<k; i++)
     692    {
     693      if(G->m[i]!=NULL)
     694      {
     695        if (p_LeadmonomDivisibleBy(G->m[i],getTerm(I,T[0]),r)) break;
     696      }
     697    }
    688698    if (i<k)
    689699    {
     
    705715   * Step 4: cleanup, delete all polynomials in I which have been added in Step 3
    706716   **/
    707   k=idSize(I);
     717  k=IDELEMS(I);
    708718  for (int i=0; i<k; i++)
    709719  {
    710     for (int j=0; j<m; j++)
    711     {
    712       if (p_LeadmonomDivisibleBy(H->m[j],I->m[i],r))
    713       {
    714         I->m[i]=NULL;
    715         break;
     720    if(I->m[i]!=NULL)
     721    {
     722      for (int j=0; j<m; j++)
     723      {
     724        if ((H->m[j]!=NULL)
     725        && (p_LeadmonomDivisibleBy(H->m[j],I->m[i],r)))
     726        {
     727          I->m[i]=NULL;
     728          break;
     729        }
    716730      }
    717731    }
     
    765779   *  the lowest component should only contain p-t
    766780   **/
    767   std::map<long,ideal> H; int n = idSize(I);
     781  std::map<long,ideal> H; int n = IDELEMS(I);
    768782  for (int i=0; i<n; i++)
    769783  {
    770     I->m[i] = p_Cleardenom(I->m[i],r);
    771     long d = 0;
    772     for (int j=2; j<=r->N; j++)
    773       d += p_GetExp(I->m[i],j,r);
    774     std::map<long,ideal>::iterator it = H.find(d);
    775     if (it != H.end())
    776       idInsertPoly(it->second,I->m[i]);
    777     else
    778     {
    779       std::pair<long,ideal> Hd(d,idInit(1));
    780       Hd.second->m[0] = I->m[i];
    781       H.insert(Hd);
     784    if(I->m[i]!=NULL)
     785    {
     786      I->m[i] = p_Cleardenom(I->m[i],r);
     787      long d = 0;
     788      for (int j=2; j<=r->N; j++)
     789        d += p_GetExp(I->m[i],j,r);
     790      std::map<long,ideal>::iterator it = H.find(d);
     791      if (it != H.end())
     792        idInsertPoly(it->second,I->m[i]);
     793      else
     794      {
     795        std::pair<long,ideal> Hd(d,idInit(1));
     796        Hd.second->m[0] = I->m[i];
     797        H.insert(Hd);
     798      }
    782799    }
    783800  }
     
    794811   **/
    795812  if (ppreduceInitially(Hi,p,r)) return true;
     813  idSkipZeroes(Hi);
    796814  id_Test(Hi,r);
    797815  id_Test(I,r);
     
    803821  for (it++; it!=H.end(); it++)
    804822  {
    805     int l=idSize(Hi); int k=l; poly cache;
     823    int l=IDELEMS(Hi); int k=l; poly cache;
    806824    /**
    807825     * sorts Hi according to degree in t in descending order
  • Singular/dyn_modules/gfanlib/startingCone.cc

    r382feb r34183a  
    119119  {
    120120    ideal I = (ideal) u->Data();
    121     if (idSize(I)==1)
     121    if ((I->m[0]!=NULL) && (idElem(I)==1))
    122122    {
    123123      tropicalStrategy currentStrategy(I,currRing);
     
    154154  {
    155155    ideal I = (ideal) u->Data();
    156     if (idSize(I)==1)
     156    if ((I->m[0]!=NULL) && (idElem(I)==1))
    157157    {
    158158      tropicalStrategy currentStrategy(I,currRing);
     
    189189  {
    190190    ideal I = (ideal) u->Data();
    191     if (idSize(I)==1)
     191    if ((I->m[0]!=NULL) && (idElem(I)==1))
    192192    {
    193193      tropicalStrategy currentStrategy(I,currRing);
     
    225225  {
    226226    ideal I = (ideal) u->Data();
    227     if (idSize(I)==1)
     227    if ((I->m[0]!=NULL) && (idElem(I)==1))
    228228    {
    229229      tropicalStrategy currentStrategy(I,currRing);
     
    262262    ideal I = (ideal) u->Data();
    263263    tropicalStrategy currentStrategy(I,currRing);
    264     if (idSize(I)==1)
     264    if ((I->m[0]!=NULL) && (idElem(I)==1))
    265265    {
    266266      poly g = I->m[0];
     
    311311  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
    312312  int* expv = (int*) omAlloc((n+1)*sizeof(int));
    313   int k = idSize(I);
     313  int k = IDELEMS(I);
    314314  for (int i=0; i<k; i++)
    315315  {
     
    344344    // inI <- I
    345345    ring s = rCopy(r);
    346     int k = idSize(I); ideal inI = idInit(k);
     346    int k = IDELEMS(I); ideal inI = idInit(k);
    347347    nMapFunc identityMap = n_SetMap(r->cf,s->cf);
    348348    for (int i=0; i<k; i++)
    349       inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
     349    {
     350      if(I->m[i]!=NULL)
     351      {
     352        inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
     353      }
     354    }
    350355
    351356    // repeatedly computes a point in the tropical variety outside the lineality space,
     
    408413    // inJ <- I
    409414    ring s = rCopy(r);
    410     int k = idSize(I); ideal inJ = idInit(k);
     415    int k = IDELEMS(I); ideal inJ = idInit(k);
    411416    nMapFunc identityMap = n_SetMap(r->cf,s->cf);
    412417    for (int i=0; i<k; i++)
    413       inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
     418    {
     419      if(I->m[i]!=NULL)
     420      {
     421        inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
     422      }
     423    }
    414424
    415425    // and check whether the dimension of its homogeneity space
     
    464474    rComplete(rShortcut);
    465475    rTest(rShortcut);
    466     k = idSize(inJ);
     476    k = IDELEMS(inJ);
    467477    ideal inJShortcut = idInit(k);
    468478    nMapFunc takingResidues = n_SetMap(s->cf,rShortcut->cf);
    469479    for (int i=0; i<k; i++)
    470       inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0);
     480    {
     481      if(inJ->m[i]!=NULL)
     482      {
     483        inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0);
     484      }
     485    }
    471486    idSkipZeroes(inJShortcut);
    472487    id_Delete(&inJ,s);
     
    496511    rTest(s);
    497512
    498     k = idSize(inJShortcut); // inJ will be overwritten with initial of inJ
     513    k = IDELEMS(inJShortcut); // inJ will be overwritten with initial of inJ
    499514    inJ = idInit(k+1);
    500515    inJ->m[0] = p_One(s);    // with respect to that weight
     
    503518    nMapFunc findingRepresentatives = n_SetMap(sShortcut->cf,s->cf);
    504519    for (int i=0; i<k; i++)              // and then come the rest
    505       inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0);
     520    {
     521      if(inJShortcut->m[i]!=NULL)
     522      {
     523        inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0);
     524      }
     525    }
    506526
    507527    ideal J = currentStrategy.computeLift(inJ,s,inI,I,r);
  • Singular/dyn_modules/gfanlib/tropical.cc

    r382feb r34183a  
    164164
    165165  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
    166   for (int i=0; i<idSize(I); i++)
     166  for (int i=0; i<IDELEMS(I); i++)
    167167  {
    168168    g = (poly) I->m[i];
     
    184184  ideal inI = initial(I,currRing,w);
    185185  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
    186   for (int i=0; i<idSize(I); i++)
     186  for (int i=0; i<IDELEMS(I); i++)
    187187  {
    188188    g = (poly) inI->m[i];
  • Singular/dyn_modules/gfanlib/tropicalCurves.cc

    r382feb r34183a  
    117117                                     const tropicalStrategy* currentStrategy)
    118118{
    119   int k = idSize(inI);
     119  int k = IDELEMS(inI);
    120120  int d = currentStrategy->getExpectedDimension();
    121121
     
    124124  ZConesSortedByDimension C = tropicalVarietySortedByDimension(inI->m[0],r,currentStrategy);
    125125  for (int i=1; i<k; i++)
    126     C = intersect(C,tropicalVarietySortedByDimension(inI->m[i],r,currentStrategy),d);
     126  {
     127    if(inI->m[i]!=NULL)
     128    {
     129      C = intersect(C,tropicalVarietySortedByDimension(inI->m[i],r,currentStrategy),d);
     130    }
     131  }
    127132
    128133  /* Cycle through all maximal cones of the refinement.
  • Singular/dyn_modules/gfanlib/tropicalStrategy.cc

    r382feb r34183a  
    4848static void swapElements(ideal I, ideal J)
    4949{
    50   assume(idSize(I)==idSize(J));
    51 
    52   for (int i=idSize(I)-1; i>=0; i--)
     50  assume(IDELEMS(I)==IDELEMS(J));
     51
     52  for (int i=IDELEMS(I)-1; i>=0; i--)
    5353  {
    5454    poly cache = I->m[i];
     
    9797  omFree(wvhdl);
    9898
    99   int k = idSize(I);
     99  int k = IDELEMS(I);
    100100  ideal IShortcut = idInit(k);
    101101  nMapFunc intoShortcut = n_SetMap(r->cf,rShortcut->cf);
    102102  for (int i=0; i<k; i++)
    103     IShortcut->m[i] = p_PermPoly(I->m[i],NULL,r,rShortcut,intoShortcut,NULL,0);
     103  {
     104    if(I->m[i]!=NULL)
     105    {
     106      IShortcut->m[i] = p_PermPoly(I->m[i],NULL,r,rShortcut,intoShortcut,NULL,0);
     107    }
     108  }
    104109
    105110  ideal JShortcut = gfanlib_kStd_wrapper(IShortcut,rShortcut);
     
    226231
    227232  // map originalIdeal from originalRing into startingRing
    228   int k = idSize(originalIdeal);
     233  int k = IDELEMS(originalIdeal);
    229234  ideal J = idInit(k+1);
    230235  nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf);
     
    234239    shiftByOne[i]=i+1;
    235240  for (int i=0; i<k; i++)
    236     J->m[i] = p_PermPoly(originalIdeal->m[i],shiftByOne,originalRing,startingRing,nMap,NULL,0);
     241  {
     242    if(originalIdeal->m[i]!=NULL)
     243    {
     244      J->m[i] = p_PermPoly(originalIdeal->m[i],shiftByOne,originalRing,startingRing,nMap,NULL,0);
     245    }
     246  }
    237247  omFreeSize(shiftByOne,(n+1)*sizeof(int));
    238248
     
    375385  poly pt = p_Add_q(p,p_Neg(t,r),r);
    376386
    377   int k = idSize(I);
     387  int k = IDELEMS(I);
    378388  int l;
    379389  for (l=0; l<k; l++)
     
    476486{
    477487  // quick check whether I already contains an ideal
    478   int k = idSize(I);
     488  int k = IDELEMS(I);
    479489  for (int i=0; i<k; i++)
    480490  {
    481491    poly g = I->m[i];
    482     if (pNext(g)==NULL && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf)))
     492    if (g!=NULL
     493    && pNext(g)==NULL
     494    && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf)))
    483495      return std::pair<poly,int>(g,i);
    484496  }
     
    553565  else
    554566  {
    555     assume(idSize(inI)==idSize(I));
     567    assume(IDELEMS(inI)==IDELEMS(I));
    556568    int uni = findPositionOfUniformizingBinomial(I,r);
    557569    assume(uni>=0);
     
    562574    ring rShortcut = copyAndChangeCoefficientRing(r);
    563575
    564     int k = idSize(inJ);
    565     int l = idSize(I);
     576    int k = IDELEMS(inJ);
     577    int l = IDELEMS(I);
    566578    ideal inJShortcut = idInit(k);
    567579    ideal inIShortcut = idInit(l);
     
    634646  ring rShortcut = copyAndChangeCoefficientRing(r);
    635647  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
    636   int k = idSize(inI);
     648  int k = IDELEMS(inI);
    637649  ideal inIShortcut = idInit(k);
    638650  for (int i=0; i<k; i++)
     
    642654  // and lift the result back to the ring with valuation
    643655  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
    644   k = idSize(inJShortcut);
     656  k = IDELEMS(inJShortcut);
    645657  ideal inJ = idInit(k+1);
    646658  inJ->m[0] = p_One(r);
     
    658670ideal tropicalStrategy::computeLift(const ideal inJs, const ring s, const ideal inIr, const ideal Ir, const ring r) const
    659671{
    660   int k = idSize(inJs);
     672  int k = IDELEMS(inJs);
    661673  ideal inJr = idInit(k);
    662674  nMapFunc identitysr = n_SetMap(s->cf,r->cf);
     
    765777  ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal);
    766778  nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf);
    767   int k = idSize(Ir);
     779  int k = IDELEMS(Ir);
    768780  ideal inIsAdjusted = idInit(k);
    769781  for (int i=0; i<k; i++)
     
    773785  // find witnesses of the new standard basis elements of the initial ideal
    774786  // with the help of the old standard basis of the ideal
    775   k = idSize(inJsAdjusted);
     787  k = IDELEMS(inJsAdjusted);
    776788  ideal inJr = idInit(k);
    777789  identity = n_SetMap(sAdjusted->cf,r->cf);
     
    816828  poly pt = p_Add_q(p,p_Neg(t,r),r);
    817829
    818   for (int i=0; i<idSize(I); i++)
     830  for (int i=0; i<IDELEMS(I); i++)
    819831  {
    820832    if (p_EqualPolys(I->m[i],pt,r))
     
    841853  poly pt = p_Add_q(p,p_Neg(t,r),r);
    842854
    843   for (int i=0; i<idSize(I); i++)
     855  for (int i=0; i<IDELEMS(I); i++)
    844856  {
    845857    if (p_EqualPolys(I->m[i],pt,r))
     
    867879  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
    868880
    869   for (int i=0; i<idSize(inI); i++)
     881  for (int i=0; i<IDELEMS(inI); i++)
    870882  {
    871883    if (p_EqualPolys(inI->m[i],p,r))
  • Singular/dyn_modules/gfanlib/tropicalStrategy.h

    r382feb r34183a  
    55#include <gfanlib/gfanlib_zcone.h>
    66#include <polys/simpleideals.h>
    7 #include <kernel/ideals.h> // for idSize
     7#include <kernel/ideals.h> // for idElem
    88#include <set>
    99#include <callgfanlib_conversion.h>
  • Singular/dyn_modules/gfanlib/tropicalVariety.cc

    r382feb r34183a  
    100100    leftv v = u->next;
    101101
    102     if (idSize(I)==1)
     102    if ((I->m[0]!=NULL) && (idElem(I)==1))
    103103    {
    104104      poly g = I->m[0];
  • Singular/dyn_modules/gfanlib/witness.cc

    r382feb r34183a  
    3434poly witness(const poly m, const ideal I, const ideal inI, const ring r)
    3535{
    36   assume(idSize(I)==idSize(inI));
     36  assume(IDELEMS(I)==IDELEMS(inI));
    3737  matrix Q = divisionDiscardingRemainder(m,inI,r);
    3838
    39   int k = idSize(I);
     39  int k = IDELEMS(I);
    4040  poly f = p_Mult_q(p_Copy(I->m[0],r),Q->m[0],r);
    4141  Q->m[0] = NULL;
     
    5959    rChangeCurrRing(origin);
    6060
    61   int k = idSize(inI);
     61  int k = IDELEMS(inI);
    6262  ideal I = idInit(k);
    6363  for (int i=0; i<k; i++)
  • Singular/dyn_modules/syzextra/mod_main.cc

    r382feb r34183a  
    401401  { \
    402402    /* const ring rrr = (iLevel > 0) ? save : save; */ \
    403     Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
     403    Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, IDELEMS(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
    404404    PrintLn(); \
    405405  } \
  • Singular/iparith.cc

    r382feb r34183a  
    40804080    //Anne's Idea for std(4,2x) = 0 bug
    40814081    long dcurr = d;
    4082     for(i=0;i<idSize(vv);i++)
     4082    for(i=0;i<IDELEMS(vv);i++)
    40834083    {
    40844084      if(vv->m[i] != NULL && !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf))
     
    40884088        pSetCoeff0(c,nCopy(pGetCoeff(vv->m[i])));
    40894089        idInsertPoly(vc,c);
    4090         for(j = 0;j<idSize(vc)-1;j++)
     4090        idSkipZeroes(vc);
     4091        for(j = 0;j<IDELEMS(vc)-1;j++)
    40914092        {
    4092           if(n_DivBy(pGetCoeff(vc->m[j]),pGetCoeff(c),currRing->cf))
     4093          if((vc->m[j]!=NULL)
     4094          && (n_DivBy(pGetCoeff(vc->m[j]),pGetCoeff(c),currRing->cf)))
    40934095          {
    40944096            pDelete(&vc->m[j]);
  • kernel/GBEngine/nc.cc

    r382feb r34183a  
    306306    h2->m[j]=0;
    307307    }
    308     // W[1..idElems(I)]
     308    // W[1..IDELEMS(I)]
    309309    if (flag >0)
    310310    {
  • kernel/GBEngine/syz1.cc

    r382feb r34183a  
    19921992      while ((k<syzstr->length) && (rr[k]!=NULL))
    19931993      {
    1994         (*resolution)[k+1] = idSize(rr[k]);
     1994        (*resolution)[k+1] = idElem(rr[k]);
    19951995        k++;
    19961996      }
  • kernel/ideals.h

    r382feb r34183a  
    3838//int id_PosConstant(ideal id, const ring r)
    3939#define idPosConstant(I) id_PosConstant(I,currRing)
    40 
    41 /// Count the effective size of an ideal
    42 /// (without the trailing allocated zero-elements)
    43 /// deprecated! (use IDELEMS)
    44 static inline int idSize(const ideal id)
    45 {
    46   int j = IDELEMS(id) - 1;
    47   poly* mm = id->m;
    48   while ((j >= 0) && (mm[j] == NULL)) j--;
    49   return (j + 1);
    50 }
    51 
    5240
    5341//BOOLEAN id_IsConstant(ideal id, const ring r);
  • libpolys/polys/simpleideals.cc

    r382feb r34183a  
    210210  assume (F != NULL);
    211211
    212   int i=0,j=IDELEMS(F)-1;
    213 
    214   while(j>=0)
     212  int i=0;
     213
     214  for(int j=IDELEMS(F)-1;j>=0;j--)
    215215  {
    216216    if ((F->m)[j]!=NULL) i++;
    217     j--;
    218217  }
    219218  return i;
Note: See TracChangeset for help on using the changeset viewer.