Changeset dd5534 in git for kernel/ideals.cc


Ignore:
Timestamp:
Mar 15, 2011, 3:45:13 PM (12 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
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
File:
1 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      }
Note: See TracChangeset for help on using the changeset viewer.