Changeset f377d6 in git for factory


Ignore:
Timestamp:
Jul 19, 2013, 5:23:05 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3e0c11d34cd0300998b687c191f99d28fea7f47c
Parents:
91ce59878acf5e8669fdebcfb3b4036d3963a6f5
git-author:
Martin Lee <martinlee84@web.de>2013-07-19 17:23:05+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-07-22 15:49:54+02:00
Message:
chg: leave Lucks sparse lifting earlier if input is too dense
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/facSparseHensel.cc

    r91ce59 rf377d6  
    2727                          int level, const CFList& leadingCoeffs, CFList& result)
    2828{
     29  int threshold= 450;
     30  CFArray termsF= getBiTerms (F, threshold);
     31  if (termsF.size() > threshold)
     32    return 0;
     33  sort (termsF, level);
     34
    2935  CFArray* monoms= new CFArray [factors.length()];
    3036  int i= 0;
     
    6773
    6874  delete [] monomsLead;
    69 
    70   CFArray termsF= getBiTerms (F);
    71   if (termsF.size() > 450)
    72   {
    73     delete [] monoms;
    74     return 0;
    75   }
    76   sort (termsF, level);
    7775
    7876  CFList tmp;
  • factory/facSparseHensel.h

    r91ce59 rf377d6  
    200200/// helper function for getBiTerms
    201201inline CFArray
    202 getBiTerms_helper (const CanonicalForm& F, const CFMap& M)
     202getBiTerms_helper (const CanonicalForm& F, const CFMap& M, int threshold)
    203203{
    204204  CFArray buf= CFArray (size (F));
     
    215215      buf[k]= M (i.coeff())*power (one,i.exp());
    216216      k++;
     217      if (k > threshold)
     218        break;
    217219      continue;
    218220    }
    219221    j= i.coeff();
    220     for (;j.hasTerms(); j++, k++)
     222    for (;j.hasTerms() && k <= threshold; j++, k++)
    221223      buf[k]= power (one,i.exp())*power (two,j.exp())*M (j.coeff());
     224    if (k > threshold)
     225      break;
    222226  }
    223227  CFArray result= CFArray (k);
    224   for (int i= 0; i < k; i++)
     228  for (int i= 0; i < k && k <= threshold; i++)
    225229    result[i]= buf[i];
    226230  return result;
     
    230234/// Variable (2)
    231235inline CFArray
    232 getBiTerms (const CanonicalForm& F)
     236getBiTerms (const CanonicalForm& F, int threshold)
    233237{
    234238  if (F.inCoeffDomain())
     
    255259  G= swapvar (G, Variable (2), Variable (F.level() - 1));
    256260
    257   CFArray result= getBiTerms_helper (G, M);
     261  CFArray result= getBiTerms_helper (G, M, threshold);
    258262  return result;
    259263}
Note: See TracChangeset for help on using the changeset viewer.