Changeset 5079887 in git


Ignore:
Timestamp:
Aug 8, 2012, 5:08:59 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
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
Location:
factory
Files:
2 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)
  • factory/facFqFactorize.cc

    r464b18 r5079887  
    26632663  A /= hh;
    26642664
    2665   if (size (A)/getNumVars (A) < 500 &&
    2666       LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
    2667                                 factors))
    2668   {
    2669     int check= factors.length();
    2670     factors= recoverFactors (A, factors);
     2665  CFList bufFactors= CFList();
     2666  if (LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
     2667                                 factors))
     2668  {
     2669    int check= biFactors.length();
     2670    int * index= new int [factors.length()];
     2671    CFList oldFactors= factors;
     2672    factors= recoverFactors (A, factors, index);
    26712673
    26722674    if (check == factors.length())
     
    26772679      if (v.level() != 1)
    26782680      {
    2679         for (CFListIterator iter= factors; iter.hasItem(); iter++)
     2681        for (iter= factors; iter.hasItem(); iter++)
    26802682          iter.getItem()= swapvar (iter.getItem(), v, y);
    26812683      }
     2684
    26822685      appendSwapDecompress (factors, contentAFactors, N, swapLevel,
    26832686                            swapLevel2, x);
    26842687      normalize (factors);
     2688      delete [] index;
    26852689      delete [] Aeval2;
    26862690      return factors;
    26872691    }
     2692    else if (factors.length() > 0)
     2693    {
     2694      int oneCount= 0;
     2695      CFList l;
     2696      for (int i= 0; i < check; i++)
     2697      {
     2698        if (index[i] == 1)
     2699        {
     2700          iter=biFactors;
     2701          for (int j=1; j <= i-oneCount; j++)
     2702            iter++;
     2703          iter.remove (1);
     2704          for (int j= 0; j < A.level() -2; j++)
     2705          {
     2706            l= leadingCoeffs2[j];
     2707            iter= l;
     2708            for (int k=1; k <= i-oneCount; k++)
     2709              iter++;
     2710            iter.remove (1);
     2711            leadingCoeffs2[j]=l;
     2712          }
     2713          oneCount++;
     2714        }
     2715      }
     2716      bufFactors= factors;
     2717      factors= CFList();
     2718    }
    26882719    else
    26892720      factors= CFList();
    2690     //TODO handle this case
     2721    delete [] index;
    26912722  }
    26922723
     
    27292760    if (check != factors.length())
    27302761      noOneToOne= true;
     2762    else
     2763      factors= Union (factors, bufFactors);
    27312764
    27322765    if (extension && !noOneToOne)
Note: See TracChangeset for help on using the changeset viewer.