Changeset ab4286 in git for libpolys


Ignore:
Timestamp:
Dec 6, 2018, 3:57:34 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
199f11deee800eb0c6a0cf7fbef6ed1fcbe0b7c96cb81baf02a1e7d45e2bcae574b11d92864162f3
Parents:
757eac36df59510348bf034d6ebdc03389e843f8
Message:
fix: heuristic for det
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/sparsmat.cc

    r757eac rab4286  
    309309
    310310  if (d>100)
    311     return sw;
     311    return TRUE;
    312312  if (!rField_is_Q(r))
    313     return sw;
     313    return TRUE;
    314314  s = t = 0;
    315   if (sw)
    316   {
    317     for(i=IDELEMS(I)-1;i>=0;i--)
    318     {
    319       p=I->m[i];
    320       if (p!=NULL)
    321       {
    322         if(!p_IsConstant(p,r))
    323           return sw;
    324         s++;
    325         t+=n_Size(pGetCoeff(p),r->cf);
    326       }
    327     }
    328   }
    329   else
    330   {
    331     for(i=IDELEMS(I)-1;i>=0;i--)
    332     {
    333       p=I->m[i];
    334       if (!p_IsConstantPoly(p,r))
    335         return sw;
    336       while (p!=NULL)
    337       {
    338         s++;
    339         t+=n_Size(pGetCoeff(p),r->cf);
    340         pIter(p);
    341       }
     315  // now: field is Q, n<=100
     316  for(i=IDELEMS(I)-1;i>=0;i--)
     317  {
     318    p=I->m[i];
     319    if (p!=NULL)
     320    {
     321      if(!p_IsConstant(p,r))
     322        return TRUE;
     323      s++;
     324      t+=n_Size(pGetCoeff(p),r->cf);
    342325    }
    343326  }
    344327  s*=15;
    345328  if (t>s)
    346     return !sw;
     329    return FALSE;// few large constanst entries
    347330  else
    348     return sw;
     331    return TRUE; //many small entries
    349332}
    350333
Note: See TracChangeset for help on using the changeset viewer.