Changeset 7766a9 in git for factory/facAbsFact.cc


Ignore:
Timestamp:
Aug 14, 2013, 5:08:33 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
252584af9fd5177071832c030eb4a9417734422e
Parents:
09dbf32a73ab559fc399380625e62d872c92c45b
git-author:
Martin Lee <martinlee84@web.de>2013-08-14 17:08:33+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-08-30 13:48:30+02:00
Message:
chg: choose smaller evaluation point
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facAbsFact.cc

    r09dbf3 r7766a9  
    133133}
    134134
    135 CFList evalPoints4AbsFact (const CanonicalForm& F, CFList& eval, Evaluation& E)
     135CFList
     136evalPoints4AbsFact (const CanonicalForm& F, CFList& eval, Evaluation& E,
     137                    int& intervalSize)
    136138{
    137139  CFList result;
    138140  Variable x= Variable (1);
     141
     142  CanonicalForm LCF= LC (F, x);
     143  CFList LCFeval= CFList();
    139144
    140145  bool found= false;
     
    144149  CFFList uniFactors;
    145150  CFListIterator iter;
     151  int count= 0;
    146152  do
    147153  {
     154    count++;
     155    if (count==E.max() - E.min() + 1)
     156    {
     157      count= 1;
     158      intervalSize++;
     159      E= REvaluation (E.min(), E.max(), IntRandom (intervalSize));
     160      E.nextpoint();
     161    }
    148162    eval.insert (F);
     163    LCFeval.insert (LCF);
    149164    bool bad= false;
    150165    for (int i= E.max(); i >= E.min(); i--)
    151166    {
    152167      eval.insert (eval.getFirst()( E [i], i));
     168      LCFeval.insert (LCFeval.getFirst()( E [i], i));
    153169      result.append (E[i]);
    154170      if (!E[i].isZero())
     
    160176        result= CFList();
    161177        eval= CFList();
     178        LCFeval= CFList();
    162179        bad= true;
    163180        foundZero= false;
     
    167184      {
    168185        result= CFList();
     186        LCFeval= CFList();
    169187        eval= CFList();
    170188        bad= true;
    171189        break;
    172190      }
     191      if ((i != 2) && (degree (LCFeval.getFirst(), i-1) != degree (LCF, i-1)))
     192      {
     193        result= CFList();
     194        LCFeval= CFList();
     195        eval= CFList();
     196        bad= true;
     197        break;
     198      }
    173199    }
    174200
     
    183209      result= CFList();
    184210      eval= CFList();
     211      LCFeval= CFList();
    185212      E.nextpoint();
    186213      continue;
     
    193220      result= CFList();
    194221      eval= CFList();
     222      LCFeval= CFList();
    195223      E.nextpoint();
    196224      continue;
     
    203231      result= CFList();
    204232      eval= CFList();
     233      LCFeval= CFList();
    205234      E.nextpoint();
    206235      continue;
     
    213242      result= CFList();
    214243      eval= CFList();
     244      LCFeval= CFList();
    215245      E.nextpoint();
    216246      continue;
     
    316346  // several bivariate factorizations
    317347  TIMING_START (abs_fac_bifactor_total);
    318   REvaluation E (2, A.level(), IntRandom (25));
     348  int absValue= 2;
     349  REvaluation E (2, A.level(), IntRandom (absValue));
    319350  for (int i= 0; i < factorNums; i++)
    320351  {
     
    323354    bufAeval= CFList();
    324355    TIMING_START (abs_fac_evaluation);
    325     bufEvaluation= evalPoints4AbsFact (bufA, bufAeval, E);
     356    bufEvaluation= evalPoints4AbsFact (bufA, bufAeval, E, absValue);
    326357    TIMING_END_AND_PRINT (abs_fac_evaluation,
    327358                          "time to find evaluation point in abs fact: ");
Note: See TracChangeset for help on using the changeset viewer.