Changeset 0851b0 in git for factory/facAlgExt.cc


Ignore:
Timestamp:
Oct 12, 2012, 5:31:21 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
cb4f0c3c5277d6de4d18c968650b4169ff1d1b46
Parents:
2a95b234ef67ebbc98057baefb8dd2ed43af3762
git-author:
Martin Lee <martinlee84@web.de>2012-10-12 17:31:21+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-10-24 12:26:22+02:00
Message:
chg: added more timing infos to main factorization functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facAlgExt.cc

    r2a95b2 r0851b0  
    2929#include "fac_sqrfree.h"
    3030
     31TIMING_DEFINE_PRINT(fac_alg_resultant)
     32TIMING_DEFINE_PRINT(fac_alg_norm)
     33TIMING_DEFINE_PRINT(fac_alg_factor_norm)
     34TIMING_DEFINE_PRINT(fac_alg_gcd)
     35TIMING_DEFINE_PRINT(fac_alg_sqrf)
     36TIMING_DEFINE_PRINT(fac_alg_factor_sqrf)
     37
    3138// squarefree part of F
    3239CanonicalForm
     
    5360  int degmipo= degree (mipo);
    5461  CanonicalForm norm;
     62  TIMING_START (fac_alg_resultant);
    5563  if (degg >= 8 || degmipo >= 8)
    5664    norm= resultantZ (g, mipo, x);
    5765  else
    5866    norm= resultant (g, mipo, x);
     67  TIMING_END_AND_PRINT (fac_alg_resultant, "time to compute resultant0: ");
    5968
    6069  i= 0;
     
    7281        g= F (y - i*alpha, y);
    7382        g *= bCommonDen (g);
     83        TIMING_START (fac_alg_resultant);
    7484        if (degg >= 8 || degmipo >= 8)
    7585          norm= resultantZ (g (x, alpha), mipo, x);
    7686        else
    7787          norm= resultant (g (x, alpha), mipo, x);
     88        TIMING_END_AND_PRINT (fac_alg_resultant,"time to compute resultant1: ");
    7889      }
    7990      else
     
    8192        g= F (y + i*alpha, y);
    8293        g *= bCommonDen (g);
     94        TIMING_START (fac_alg_resultant);
    8395        if (degg >= 8 || degmipo >= 8)
    8496          norm= resultantZ (g (x, alpha), mipo, x);
    8597        else
    8698          norm= resultant (g (x, alpha), mipo, x);
     99        TIMING_END_AND_PRINT (fac_alg_resultant,"time to compute resultant2: ");
    87100      }
    88101      if (degree (gcd (deriv (norm, y), norm)) <= 0)
     
    108121  CanonicalForm f= F*bCommonDen (F);
    109122  int shift;
     123  TIMING_START (fac_alg_norm);
    110124  CanonicalForm norm= sqrfNorm (f, alpha, shift);
     125  TIMING_END_AND_PRINT (fac_alg_norm, "time to compute sqrf norm: ");
    111126  ASSERT (degree (norm, alpha) <= 0, "wrong norm computed");
     127  TIMING_START (fac_alg_factor_norm);
    112128  CFFList normFactors= factorize (norm);
     129  TIMING_END_AND_PRINT (fac_alg_factor_norm, "time to factor norm: ");
    113130  CFList factors;
    114131  if (normFactors.length() <= 2)
     
    125142  {
    126143    ASSERT (i.getItem().exp() == 1, "norm not squarefree");
     144    TIMING_START (fac_alg_gcd);
    127145    if (shift == 0)
    128146      factor= gcd (buf, i.getItem().factor());
     
    130148      factor= gcd (buf, i.getItem().factor() (f.mvar() + shift*alpha, f.mvar()));
    131149    buf /= factor;
     150    TIMING_END_AND_PRINT (fac_alg_gcd, "time to recover factors: ");
    132151    factors.append (factor);
    133152  }
     
    149168  bool save_rat=!isOn (SW_RATIONAL);
    150169  On (SW_RATIONAL);
     170  TIMING_START (fac_alg_sqrf);
    151171  CFFList sqrf= sqrFreeZ (F);
     172  TIMING_END_AND_PRINT (fac_alg_sqrf, "time for sqrf factors in Q(a)[x]: ");
    152173  CFList factorsSqrf;
    153174  CFFList factors;
     
    158179  {
    159180    if (i.getItem().factor().inCoeffDomain()) continue;
     181    TIMING_START (fac_alg_factor_sqrf);
    160182    factorsSqrf= AlgExtSqrfFactorize (i.getItem().factor(), alpha);
     183    TIMING_END_AND_PRINT (fac_alg_factor_sqrf,
     184                          "time to factor sqrf factors in Q(a)[x]: ");
    161185    for (j= factorsSqrf; j.hasItem(); j++)
    162186    {
Note: See TracChangeset for help on using the changeset viewer.