Changeset 48f1dd in git


Ignore:
Timestamp:
Sep 29, 2022, 10:42:46 AM (19 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
4d17337b8a161f7c63c26e2c3f4b0e0d4df645c8
Parents:
aec6fead7ad079baf52b503b680f55839809e605
Message:
opt: idElem, id_DelDiv
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/simpleideals.cc

    raec6fe r48f1dd  
    216216    IDELEMS(ide) = j;
    217217  }
    218 }
    219 
    220 /// count non-zero elements
    221 int idElem(const ideal F)
    222 {
    223   assume (F != NULL);
    224 
    225   int i=0;
    226 
    227   for(int j=IDELEMS(F)-1;j>=0;j--)
    228   {
    229     if ((F->m)[j]!=NULL) i++;
    230   }
    231   return i;
    232218}
    233219
     
    467453  {
    468454    /* the case of a coefficient field: */
    469     if (k>10)
     455    if (k>9)
    470456    {
    471457      id_DelDiv_SEV(id,k,r);
  • libpolys/polys/simpleideals.h

    raec6fe r48f1dd  
    6565
    6666/// number of non-zero polys in F
    67 int     idElem(const ideal F);
     67static inline int idElem(const ideal F)
     68{
     69  int i=0;
     70  for(int j=IDELEMS(F)-1;j>=0;j--)
     71  {
     72    if ((F->m)[j]!=NULL) i++;
     73  }
     74  return i;
     75}
     76
    6877#define id_Elem(F,R) idElem(F)
    6978
Note: See TracChangeset for help on using the changeset viewer.