Changeset fcd296 in git


Ignore:
Timestamp:
Aug 15, 2012, 2:31:04 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
Children:
8d2c116a855f5479558e951ec926b7e92a2c0ac0
Parents:
8797746f0462992c4a00f27f0837b923a3f847de
git-author:
Martin Lee <martinlee84@web.de>2012-08-15 14:31:04+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-09-04 18:01:17+02:00
Message:
chg: if heuristics fail try again without heuristic
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFactorize.cc

    r8797746 rfcd296  
    903903
    904904  CanonicalForm LCmultiplier= leadingCoeffs.getFirst();
     905  bool LCmultiplierIsConst= LCmultiplier.inCoeffDomain();
    905906  leadingCoeffs.removeFirst();
    906907
     
    921922
    922923  CFListIterator iter2;
     924  CFList bufLeadingCoeffs2= leadingCoeffs2[A.level()-3];
     925  bufBiFactors= biFactors;
     926  bufA= A;
    923927  CFList bufFactors= CFList();
     928  bool LCheuristic= false;
    924929  if (LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
    925930                                factors))
     
    973978    else if (!LCmultiplier.inCoeffDomain() && factors.length() == 0)
    974979    {
     980      LCheuristic= true;
    975981      factors= oldFactors;
    976982      CanonicalForm cont;
     
    10711077                break;
    10721078              }
    1073               else //factor is consists of just leading coeff
     1079              else //factor consists of just leading coeff
    10741080              {
    10751081                CanonicalForm vars=getVars (iter.getItem());
     
    10841090                  factor= LC (getItem (oldAeval[i], index),1);
    10851091                  if ((factor.inCoeffDomain() && degree (vars,xx) > 0) ||
    1086                       (degree (factor,xx) > 0 && degree (vars,xx) < 0)) //scan for bivariate factors with leading coeff that does not contain variables which occur in LCmultiplier
     1092                      (degree (factor,xx) > 0 && degree (vars,xx) <= 0)) //scan for bivariate factors with leading coeff that does not contain variables which occur in LCmultiplier
    10871093                  {
    10881094                    oneVariableNotInCommon= true;
     
    11691175  }
    11701176
     1177tryAgainWithoutHeu:
    11711178  //shifting to zero
    11721179  A= shift2Zero (A, Aeval, evaluation);
     
    12541261  if (noOneToOne)
    12551262  {
     1263    if (!LCmultiplierIsConst && LCheuristic)
     1264    {
     1265      A= bufA;
     1266      biFactors= bufBiFactors;
     1267      leadingCoeffs2[A.level()-3]= bufLeadingCoeffs2;
     1268      delete [] liftBounds;
     1269      LCheuristic= false;
     1270      goto tryAgainWithoutHeu;
     1271      //something probably went wrong in the heuristic
     1272    }
     1273
    12561274    A= shift2Zero (oldA, Aeval, evaluation);
    12571275    biFactors= oldBiFactors;
Note: See TracChangeset for help on using the changeset viewer.