Changeset 5079887 in git for factory/facFactorize.cc


Ignore:
Timestamp:
Aug 8, 2012, 5:08:59 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
79592ac0413bc31f4675cd016eba92870cff9765
Parents:
464b18c0e995f211723d02ba1f0e3764e16f8c67
git-author:
Martin Lee <martinlee84@web.de>2012-08-08 17:08:59+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-09-04 18:01:17+02:00
Message:
chg: remove factors that were successfully recovered by LucksWang
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFactorize.cc

    r464b18 r5079887  
    906906  A /= hh;
    907907
    908   if (size (A)/getNumVars (A) < 500 &&
    909       LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
     908  CFList bufFactors= CFList();
     909  if (LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
    910910                                factors))
    911911  {
    912     int check= factors.length();
    913     factors= recoverFactors (A, factors);
     912    int check= biFactors.length();
     913    int * index= new int [factors.length()];
     914    CFList oldFactors= factors;
     915    factors= recoverFactors (A, factors, index);
    914916
    915917    if (check == factors.length())
    916918    {
    917 
    918919      if (w.level() != 1)
    919920      {
    920         for (CFListIterator iter= factors; iter.hasItem(); iter++)
     921        for (iter= factors; iter.hasItem(); iter++)
    921922          iter.getItem()= swapvar (iter.getItem(), w, y);
    922923      }
     
    924925      appendSwapDecompress (factors, contentAFactors, N, 0, 0, x);
    925926      normalize (factors);
     927      delete [] index;
    926928      delete [] Aeval2;
    927929      return factors;
    928930    }
     931    else if (factors.length() > 0)
     932    {
     933      int oneCount= 0;
     934      CFList l;
     935      for (int i= 0; i < check; i++)
     936      {
     937        if (index[i] == 1)
     938        {
     939          iter=biFactors;
     940          for (int j=1; j <= i-oneCount; j++)
     941            iter++;
     942          iter.remove (1);
     943          for (int j= 0; j < A.level() -2; j++)
     944          {
     945            l= leadingCoeffs2[j];
     946            iter= l;
     947            for (int k=1; k <= i-oneCount; k++)
     948              iter++;
     949            iter.remove (1);
     950            leadingCoeffs2[j]=l;
     951          }
     952          oneCount++;
     953        }
     954      }
     955      bufFactors= factors;
     956      factors= CFList();
     957    }
    929958    else
    930959      factors= CFList();
    931   }
    932 
     960    delete [] index;
     961  }
    933962
    934963  //shifting to zero
     
    10131042    if (check != factors.length())
    10141043      noOneToOne= true;
     1044    else
     1045      factors= Union (factors, bufFactors);
    10151046  }
    10161047  if (noOneToOne)
Note: See TracChangeset for help on using the changeset viewer.