Changeset dd5534 in git for kernel


Ignore:
Timestamp:
Mar 15, 2011, 3:45:13 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
91b031a4e88cb480f4ba993bf5904694c62d9b34
Parents:
c4dab43d69dd36ed09ba07d4e771236f8a7bcc39
Message:
fixed dim of ideal and sum of ideals over rings (with Anne)

git-svn-id: file:///usr/local/Singular/svn/trunk@13973 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    rc4dab4 rdd5534  
    9494#endif
    9595
     96/* index of generator with leading term in ground ring (if any);
     97   otherwise -1 */
     98int idPosConstant(ideal id)
     99{
     100  int k;
     101  for (k = IDELEMS(id)-1; k>=0; k--)
     102  {
     103    if (p_LmIsConstantComp(id->m[k], currRing) == TRUE)
     104      return k;
     105  }
     106  return -1;
     107}
     108
    96109/*2
    97110* initialise the maximal ideal (at 0)
     
    223236
    224237/*2
    225 * ideal id = (id[i]), c any number
     238* ideal id = (id[i]), c any unit
    226239* if id[i] = c*id[j] then id[j] is deleted for j > i
    227240*/
     
    236249      for (j=k; j>i; j--)
    237250      {
    238         if ((id->m[j]!=NULL)
    239         && (pComparePolys(id->m[i], id->m[j])))
     251        if (id->m[j]!=NULL)
    240252        {
    241           pDelete(&id->m[j]);
     253#ifdef HAVE_RINGS
     254          if (rField_is_Ring(currRing))
     255          {
     256            /* if id[j] = c*id[i] then delete id[j].
     257               In the below cases of a ground field, we
     258               check whether id[i] = c*id[j] and, if so,
     259               delete id[j] for historical reasons (so
     260               that previous output does not change) */
     261            if (pComparePolys(id->m[j], id->m[i])) pDelete(&id->m[j]);
     262          }
     263          else
     264          {
     265            if (pComparePolys(id->m[i], id->m[j])) pDelete(&id->m[j]);
     266          }
     267#else
     268          if (pComparePolys(id->m[i], id->m[j])) pDelete(&id->m[j]);
     269#endif         
    242270        }
    243271      }
  • kernel/ideals.h

    rc4dab4 rdd5534  
    6262  /*- initialise the maximal ideal (at 0) -*/
    6363void idSkipZeroes (ideal ide);
     64/* index of generator with leading term in ground ring (if any);
     65   otherwise -1 */
     66int idPosConstant (ideal id);
    6467  /*gives an ideal the minimal possible size*/
    6568void idNorm(ideal id);
  • kernel/pInline1.h

    rc4dab4 rdd5534  
    587587{
    588588  if (p == NULL) return FALSE;
     589#ifdef HAVE_RINGS
     590  if (rField_is_Ring(currRing))
     591    return (p_LmIsConstant(p, r) && nIsUnit(pGetCoeff(p)));
     592#endif
    589593  return p_LmIsConstant(p, r);
    590594}
  • kernel/polys1.cc

    rc4dab4 rdd5534  
    17171717  if (pLength(p1) != pLength(p2))
    17181718    return FALSE;
     1719#ifdef HAVE_RINGS
     1720  if (rField_is_Ring(currRing))
     1721  {
     1722    if ((pLength(p1) == 1) && (nEqual(pGetCoeff(p1), pGetCoeff(p2))))
     1723      return TRUE;
     1724    if (!nIsUnit(pGetCoeff(p2))) return FALSE;
     1725  }
     1726#endif
    17191727  n=nDiv(pGetCoeff(p1),pGetCoeff(p2));
    17201728  while ((p1 != NULL) /*&& (p2 != NULL)*/)
Note: See TracChangeset for help on using the changeset viewer.