Changeset 1130ffc in git for factory/fac_ezgcd.cc


Ignore:
Timestamp:
Oct 25, 2012, 2:25:59 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
139f6f800b915490dfaa914ef7676d29a3236b92186df6b3fe891f605e0e3e7324333e7713165436
Parents:
becbea965e6c5de8e8ab195c7f480cabc295ac0cd91423947d67c2ab2eaf1aae4a61f9f2988e9510
Message:
Merge pull request #198 from mmklee/factory_clean_sw

Factory clean sw
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/fac_ezgcd.cc

    rbecbea r1130ffc  
    1515#include "config.h"
    1616
     17#include "timing.h"
    1718#include "cf_assert.h"
    1819#include "debug.h"
     
    3031
    3132#ifdef HAVE_NTL
     33
     34TIMING_DEFINE_PRINT(ez_eval)
     35TIMING_DEFINE_PRINT(ez_compress)
     36TIMING_DEFINE_PRINT(ez_hensel_lift)
     37TIMING_DEFINE_PRINT(ez_content)
     38TIMING_DEFINE_PRINT(ez_termination)
     39
    3240static
    3341int compress4EZGCD (const CanonicalForm& F, const CanonicalForm& G, CFMap & M,
     
    432440    Off (SW_RATIONAL);
    433441
     442  TIMING_START (ez_compress)
    434443  CFMap M,N;
    435444  int smallestDegLev;
     
    444453  F= M (F);
    445454  G= M (G);
     455  TIMING_END_AND_PRINT (ez_compress, "time for compression in EZ: ")
    446456
    447457  DEBINCLEVEL( cerr, "ezgcd" );
    448458  DEBOUTLN( cerr, "FF = " << FF );
    449459  DEBOUTLN( cerr, "GG = " << GG );
     460  TIMING_START (ez_content)
    450461  f = content( F, x ); g = content( G, x ); d = gcd( f, g );
    451462  d /= icontent (d);
     
    453464  DEBOUTLN( cerr, "g = " << g );
    454465  F /= f; G /= g;
     466  TIMING_END_AND_PRINT (ez_content, "time to extract content in EZ: ")
    455467  if ( F.isUnivariate() && G.isUnivariate() )
    456468  {
     
    500512    DEBOUTLN( cerr, "F = " << F );
    501513    DEBOUTLN( cerr, "G = " << G );
     514    TIMING_START (ez_eval)
    502515    if (!findeval( F, G, Fb, Gb, Db, b, delta, degF, degG, maxeval, count,
    503516                   o, 25, l))
     
    512525      return N (d*result);
    513526    }
     527    TIMING_END_AND_PRINT (ez_eval, "time to find eval point in EZ1: ")
    514528    DEBOUTLN( cerr, "found evaluation b = " << b );
    515529    DEBOUTLN( cerr, "F(b) = " << Fb );
     
    530544    {
    531545      bt = b;
     546      TIMING_START (ez_eval)
    532547      if (!findeval( F, G, Fbt, Gbt, Dbt, bt, delta, degF, degG, maxeval, count,
    533548                     o, 25,l ))
     
    542557        return N (d*result);
    543558      }
     559      TIMING_END_AND_PRINT (ez_eval, "time to find eval point in EZ2: ")
    544560      int dd=degree( Dbt );
    545561      if ( dd /*degree( Dbt )*/ == 0 )
     
    636652      DEBOUTLN( cerr, "(hensel) DD   = " << DD );
    637653      DEBOUTLN( cerr, "(hensel) lcDD = " << lcDD );
     654      TIMING_START (ez_hensel_lift)
    638655      gcdfound= Hensel (B*lcD, DD, b, lcDD);
     656      TIMING_END_AND_PRINT (ez_hensel_lift, "time to hensel lift in EZ: ")
    639657      DEBOUTLN( cerr, "(hensel finished) DD   = " << DD );
    640658
     
    653671      if (gcdfound)
    654672      {
     673        TIMING_START (ez_termination)
    655674        contcand= content (DD[2], Variable (1));
    656675        cand = DD[2] / contcand;
     
    659678        else
    660679          gcdfound = fdivides( cand, F ) && cand*(DD[1]/(lcD/contcand)) == G;
     680        TIMING_END_AND_PRINT (ez_termination,
     681                              "time for termination test in EZ: ")
    661682      }
    662683      /// ---> A8 (gcdfound)
Note: See TracChangeset for help on using the changeset viewer.