Changeset 63d199 in git


Ignore:
Timestamp:
Jul 6, 2015, 1:30:39 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
3d2cb9e83ceb74b520ab757ffac6abe4eed415f9
Parents:
ddc1937b20b15407322fe606d93ad53240f5b367
Message:
cleanup p_GetShortExpVector
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/monomials/p_polys.cc

    rddc193 r63d199  
    45314531{
    45324532  assume(p != NULL);
    4533   if (p == NULL) return 0;
    45344533  unsigned long ev = 0; // short exponent vector
    45354534  unsigned int n = BIT_SIZEOF_LONG / r->N; // number of bits per exp
    45364535  unsigned int m1; // highest bit which is filled with (n+1)
    4537   unsigned int i = 0, j=1;
     4536  int i=0,j=1;
    45384537
    45394538  if (n == 0)
     
    45464545    else
    45474546    {
    4548       for (; j<=(unsigned long) r->N; j++)
     4547      for (; j<=r->N; j++)
    45494548      {
    45504549        if (p_GetExp(p,j,r) > 0) i++;
     
    45524551      }
    45534552      if (i>0)
    4554         ev = ~((unsigned long)0) >> ((unsigned long) (BIT_SIZEOF_LONG - i));
     4553        ev = ~(0UL) >> (BIT_SIZEOF_LONG - i);
    45554554      return ev;
    45564555    }
     
    45804579
    45814580
     4581///  p_GetShortExpVector of p * pp
    45824582unsigned long p_GetShortExpVector(const poly p, const poly pp, const ring r)
    45834583{
    45844584  assume(p != NULL);
    45854585  assume(pp != NULL);
    4586   if (p == NULL || pp == NULL) return 0;
    45874586
    45884587  unsigned long ev = 0; // short exponent vector
    45894588  unsigned int n = BIT_SIZEOF_LONG / r->N; // number of bits per exp
    45904589  unsigned int m1; // highest bit which is filled with (n+1)
    4591   unsigned int i = 0, j=1;
     4590  int j=1;
     4591  unsigned long i = 0L;
    45924592
    45934593  if (n == 0)
     
    46004600    else
    46014601    {
    4602       for (; j<=(unsigned long) r->N; j++)
     4602      for (; j<=r->N; j++)
    46034603      {
    46044604        if (p_GetExp(p,j,r) > 0 || p_GetExp(pp,j,r) > 0) i++;
     
    46064606      }
    46074607      if (i>0)
    4608         ev = ~((unsigned long)0) >> ((unsigned long) (BIT_SIZEOF_LONG - i));
     4608        ev = ~(0UL) >> (BIT_SIZEOF_LONG - i);
    46094609      return ev;
    46104610    }
Note: See TracChangeset for help on using the changeset viewer.