Changeset e7a487 in git


Ignore:
Timestamp:
Feb 22, 2012, 6:41:12 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '52dcfddee5ec87d404d5e0fb44f2d627608208f1')
Children:
a3aa3f3540f7d9604a809fe2b268a4115e7aef9a
Parents:
9b8b090bca59f6bb48b468a6a1b63a90e53e6299ff3a4f4a8e655885eb376e551f47339a6de25bf0
Message:
Merge pull request #70 from mmklee/factory_configure_options_sw

repair factory configure options: enable-timing, enable-debugoutput, enable-assertions (version for SW + improvements: enable-assertions ->  disable-assertions)
Location:
factory
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd_smallp.cc

    r9b8b09 re7a487  
    14741474{
    14751475  int r= M.size();
    1476   ASSERT (c == r, "number of columns and rows not equal");
    14771476  ASSERT (A.size() == r, "vector does not have right size");
    14781477  if (r == 1)
     
    19711970
    19721971  Variable x= Variable (1);
    1973   ASSERT (degree (A, y) == 0, "expected degree (F, 1) == 0");
    1974   ASSERT (degree (B, y) == 0, "expected degree (G, 1) == 0");
     1972  ASSERT (degree (A, x) == 0, "expected degree (F, 1) == 0");
     1973  ASSERT (degree (B, x) == 0, "expected degree (G, 1) == 0");
    19751974
    19761975  //univariate case
     
    22292228
    22302229  Variable x= Variable (1);
    2231   ASSERT (degree (A, y) == 0, "expected degree (F, 1) == 0");
    2232   ASSERT (degree (B, y) == 0, "expected degree (G, 1) == 0");
     2230  ASSERT (degree (A, x) == 0, "expected degree (F, 1) == 0");
     2231  ASSERT (degree (B, x) == 0, "expected degree (G, 1) == 0");
    22332232
    22342233  //univariate case
  • factory/cf_gcd_smallp.h

    r9b8b09 re7a487  
    2525// #include "config.h"
    2626#include "cf_assert.h"
     27
     28#include "cf_factory.h"
    2729
    2830CanonicalForm GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
  • factory/configure.ac

    r9b8b09 re7a487  
    7676AC_ARG_ENABLE(
    7777  assertions,
    78   [AS_HELP_STRING([--enable-assertions],[build Factory with assertions activated])],
     78  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
    7979  ,
    80   enable_assertions=no)
     80  enable_assertions=yes)
    8181
    8282AC_ARG_ENABLE(
  • factory/debug.h

    r9b8b09 re7a487  
    1313
    1414#ifdef DEBUGOUTPUT
     15#include <iostream>
    1516#ifdef HAVE_IOSTREAM
    1617#include <iostream>
     
    2223extern char * deb_level_msg;
    2324#define DEBINCLEVEL(stream, msg) \
    24 (stream << deb_level_msg << "entering << " << msg << " >>" << endl, deb_inc_level())
     25(std::stream << deb_level_msg << "entering << " << msg << " >>" << std::endl, deb_inc_level())
    2526#define DEBDECLEVEL(stream, msg) \
    26 (deb_dec_level(), stream << deb_level_msg << "leaving << " << msg << " >>" << endl)
     27(deb_dec_level(), std::stream << deb_level_msg << "leaving << " << msg << " >>" << std::endl)
    2728#define DEBOUTSL(stream) \
    28 (stream << deb_level_msg, stream.flush())
     29(std::stream << deb_level_msg, std::stream.flush())
    2930#define DEBOUT(stream, objects) \
    30 (stream << objects, stream.flush())
     31(std::stream << objects, std::stream.flush())
    3132#define DEBOUTENDL(stream) \
    32 (stream << endl)
     33(std::stream << std::endl)
    3334#define DEBOUTLN(stream, objects) \
    34 (stream << deb_level_msg << objects << endl)
     35(std::stream << deb_level_msg << objects << std::endl)
    3536#else /* DEBUGOUTPUT */
    36 #define DEBINCLEVEL(stream, msg) ((void) 0)
    37 #define DEBDECLEVEL(stream, msg) ((void) 0)
    38 #define DEBOUTSL(stream) ((void) 0)
    39 #define DEBOUT(stream, objects) ((void) 0)
    40 #define DEBOUTENDL(stream) ((void) 0)
    41 #define DEBOUTLN(stream, objects) ((void) 0)
     37#define DEBINCLEVEL(stream, msg)
     38#define DEBDECLEVEL(stream, msg)
     39#define DEBOUTSL(stream)
     40#define DEBOUT(stream, objects)
     41#define DEBOUTENDL(stream)
     42#define DEBOUTLN(stream, objects)
    4243#endif /* DEBUGOUTPUT */
  • factory/facAlgExt.cc

    r9b8b09 re7a487  
    168168
    169169  factors.insert (CFFactor (Lc(F), 1));
    170   ASSERT (degree (buf) <= 0, "bug in AlgExtFactorize");
    171170  if (save_rat) Off(SW_RATIONAL);
    172171  return factors;
  • factory/facBivar.cc

    r9b8b09 re7a487  
    2424
    2525#ifdef HAVE_NTL
    26 TIMING_DEFINE_PRINT(fac_uni_factorizer)
    27 TIMING_DEFINE_PRINT(fac_hensel_lift)
    28 TIMING_DEFINE_PRINT(fac_factor_recombination)
     26TIMING_DEFINE_PRINT(uni_factorize)
     27TIMING_DEFINE_PRINT(hensel_lift12)
    2928
    3029CFList conv (const CFFList& L)
     
    224223
    225224    // univariate factorization
    226     TIMING_START (fac_uni_factorizer);
     225    TIMING_START (uni_factorize);
    227226
    228227    if (extension)
     
    230229    else
    231230      bufUniFactors= conv (factorize (bufAeval, true));
    232     TIMING_END_AND_PRINT (fac_uni_factorizer,
     231    TIMING_END_AND_PRINT (uni_factorize,
    233232                          "time for univariate factorization: ");
    234233    DEBOUTLN (cerr, "Lc (bufAeval)*prod (bufUniFactors)== bufAeval " <<
    235               prod (bufUniFactors)*Lc (bufAeval) == bufAeval);
    236 
    237     TIMING_START (fac_uni_factorizer);
     234              (prod (bufUniFactors)*Lc (bufAeval) == bufAeval));
     235
     236    TIMING_START (uni_factorize);
    238237    if (extension)
    239238      bufUniFactors2= conv (factorize (bufAeval2, v));
    240239    else
    241240      bufUniFactors2= conv (factorize (bufAeval2, true));
    242     TIMING_END_AND_PRINT (fac_uni_factorizer,
     241    TIMING_END_AND_PRINT (uni_factorize,
    243242                          "time for univariate factorization in y: ");
    244243    DEBOUTLN (cerr, "Lc (Aeval2)*prod (uniFactors2)== Aeval2 " <<
    245               prod (bufUniFactors2)*Lc (bufAeval2) == bufAeval2);
     244              (prod (bufUniFactors2)*Lc (bufAeval2) == bufAeval2));
    246245
    247246    if (bufUniFactors.getFirst().inCoeffDomain())
     
    369368  bool earlySuccess= false;
    370369  CFList earlyFactors;
    371   TIMING_START (fac_hensel_lift);
     370  TIMING_START (hensel_lift12);
    372371  uniFactors= henselLiftAndEarly
    373372             (A, earlySuccess, earlyFactors, degs, liftBound,
    374373              uniFactors, dummy, evaluation);
    375   TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
     374  TIMING_END_AND_PRINT (hensel_lift12, "time for hensel lifting: ");
    376375  DEBOUTLN (cerr, "lifted factors= " << uniFactors);
    377376
  • factory/facFactorize.cc

    r9b8b09 re7a487  
    3030#include "cf_reval.h"
    3131#include "facSparseHensel.h"
     32
     33TIMING_DEFINE_PRINT(bi_factorize)
     34TIMING_DEFINE_PRINT(hensel_lift)
     35TIMING_DEFINE_PRINT(factor_recombination)
    3236
    3337#ifdef HAVE_NTL
     
    691695    bufLift= degree (A, y) + 1 + degree (LC(A, x), y);
    692696
    693     TIMING_START (fac_bi_factorizer);
     697    TIMING_START (bi_factorize);
    694698    bufBiFactors= ratBiSqrfFactorize (bufAeval.getFirst(), v);
    695     TIMING_END_AND_PRINT (fac_bi_factorizer,
     699    TIMING_END_AND_PRINT (bi_factorize,
    696700                          "time for bivariate factorization: ");
    697701    bufBiFactors.removeFirst();
     
    969973    CFList earlyFactors;
    970974    ExtensionInfo info= ExtensionInfo (false);
    971     TIMING_START (fac_hensel_lift);
    972     CFList liftedFactors= henselLiftAndEarly
    973                           (A, MOD, liftBounds, earlySuccess, earlyFactors,
    974                            Aeval, biFactors, evaluation, info);
    975     TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
    976 
    977     TIMING_START (fac_factor_recombination);
     975    CFList liftedFactors;
     976    TIMING_START (hensel_lift);
     977    liftedFactors= henselLiftAndEarly
     978                   (A, MOD, liftBounds, earlySuccess, earlyFactors,
     979                    Aeval, biFactors, evaluation, info);
     980    TIMING_END_AND_PRINT (hensel_lift, "time for hensel lifting: ");
     981
     982    TIMING_START (factor_recombination);
    978983    factors= factorRecombination (A, liftedFactors, MOD);
    979     TIMING_END_AND_PRINT (fac_factor_recombination,
     984    TIMING_END_AND_PRINT (factor_recombination,
    980985                          "time for factor recombination: ");
    981986
  • factory/facFqBivar.cc

    r9b8b09 re7a487  
    4040
    4141TIMING_DEFINE_PRINT(fac_uni_factorizer)
    42 TIMING_DEFINE_PRINT(fac_hensel_lift)
    43 TIMING_DEFINE_PRINT(fac_factor_recombination)
     42TIMING_DEFINE_PRINT(fac_hensel_lift12)
    4443
    4544CanonicalForm prodMod0 (const CFList& L, const CanonicalForm& M)
     
    464463    return result;
    465464  }
    466   DEBOUTLN (cerr, "LC (F, 1)*prodMod (factors, M) == F " <<
    467             (LC (F, 1)*prodMod (factors, M) == F));
     465  DEBOUTLN (cerr, "LC (F, 1)*prodMod (factors, N) == F " <<
     466            (LC (F, 1)*prodMod (factors, N) == F));
    468467  CFList T, S;
    469468
     
    55885587                          "time for univariate factorization: ");
    55895588    DEBOUTLN (cerr, "Lc (bufAeval)*prod (bufUniFactors)== bufAeval " <<
    5590               prod (bufUniFactors)*Lc (bufAeval) == bufAeval);
     5589              (prod (bufUniFactors)*Lc (bufAeval) == bufAeval));
    55915590
    55925591    if (!derivXZero && !fail2)
     
    55975596                            "time for univariate factorization in y: ");
    55985597      DEBOUTLN (cerr, "Lc (Aeval2)*prod (uniFactors2)== Aeval2 " <<
    5599                 prod (bufUniFactors2)*Lc (bufAeval2) == bufAeval2);
     5598                (prod (bufUniFactors2)*Lc (bufAeval2) == bufAeval2));
    56005599    }
    56015600
     
    57545753    bool earlySuccess= false;
    57555754    CFList earlyFactors;
    5756     TIMING_START (fac_hensel_lift);
     5755    TIMING_START (fac_hensel_lift12);
    57575756    uniFactors= henselLiftAndEarly
    57585757               (A, earlySuccess, earlyFactors, degs, liftBound,
    57595758                uniFactors, info, evaluation);
    5760     TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
     5759    TIMING_END_AND_PRINT (fac_hensel_lift12, "time for hensel lifting: ");
    57615760    DEBOUTLN (cerr, "lifted factors= " << uniFactors);
    57625761
     
    57775776  else if (degree (A) > 4 && beta.level() == 1 && (2*minBound)/degMipo < 32)
    57785777  {
    5779     TIMING_START (fac_hensel_lift);
     5778    TIMING_START (fac_hensel_lift12);
    57805779    if (extension)
    57815780    {
     
    57955794      factors= Union (lll, factors);
    57965795    }
    5797     TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
     5796    TIMING_END_AND_PRINT (fac_hensel_lift12, "time for hensel lifting: ");
    57985797    DEBOUTLN (cerr, "lifted factors= " << uniFactors);
    57995798  }
     
    58025801    bool earlySuccess= false;
    58035802    CFList earlyFactors;
    5804     TIMING_START (fac_hensel_lift);
     5803    TIMING_START (fac_hensel_lift12);
    58055804    uniFactors= henselLiftAndEarly
    58065805               (A, earlySuccess, earlyFactors, degs, liftBound,
    58075806                uniFactors, info, evaluation);
    5808     TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
     5807    TIMING_END_AND_PRINT (fac_hensel_lift12, "time for hensel lifting: ");
    58095808    DEBOUTLN (cerr, "lifted factors= " << uniFactors);
    58105809
  • factory/facFqFactorize.cc

    r9b8b09 re7a487  
    27052705    CFList MOD;
    27062706    bool earlySuccess;
    2707     CFList earlyFactors;
     2707    CFList earlyFactors, liftedFactors;
    27082708    TIMING_START (fac_hensel_lift);
    2709     CFList liftedFactors= henselLiftAndEarly
    2710                           (A, MOD, liftBounds, earlySuccess, earlyFactors,
    2711                            Aeval, biFactors, evaluation, info);
     2709    liftedFactors= henselLiftAndEarly
     2710                   (A, MOD, liftBounds, earlySuccess, earlyFactors,
     2711                    Aeval, biFactors, evaluation, info);
    27122712    TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
    27132713
  • factory/fac_berlekamp.cc

    r9b8b09 re7a487  
    2222    for ( int i = 0; i < n; i++ ) {
    2323        for ( int j = 0; j < n; j++ )
    24             cerr << Q[i][j] << "  ";
    25         cerr << endl;
    26     }
    27     cerr << endl;
     24            std::cerr << Q[i][j] << "  ";
     25        std::cerr << std::endl;
     26    }
     27    std::cerr << std::endl;
    2828}
    2929#endif /* DEBUGOUTPUT */
     
    3434    for ( int i = 0; i < n; i++ ) {
    3535        for ( int j = 0; j < n; j++ ) {
    36             gf_print( cerr, Q[i][j] );
    37             cerr << "  ";
    38         }
    39         cerr << endl;
    40     }
    41     cerr << endl;
     36            gf_print( std::cerr, Q[i][j] );
     37            std::cerr << "  ";
     38        }
     39        std::cerr << std::endl;
     40    }
     41    std::cerr << std::endl;
    4242}
    4343#endif /* DEBUGOUTPUT */
  • factory/fac_multihensel.cc

    r9b8b09 re7a487  
    166166        A[i] = remainder( pk( a[i] * C0 ), P0[i], pk );
    167167    DEBOUTLN( cerr, "the first approximation of the correction coefficients is " << A );
    168 #ifdef DEBUGOUTPUT
     168/*#ifdef DEBUGOUTPUT
    169169    if ( check_dummy( A, P, Q ) - C != 0 )
    170170    {
     
    174174        DEBOUTLN( cerr, "              Q " << Q );
    175175    }
    176 #endif
     176#endif*/
    177177    for ( m = 0; m <= h && ( m == 0 || Dm != 0 ); m++ )
    178178    {
     
    216216        DEBOUTLN( cerr, "the correction coefficients at step " << m );
    217217        DEBOUTLN( cerr, "are now " << A );
    218 #ifdef DEBUGOUTPUT
     218/*#ifdef DEBUGOUTPUT
    219219    if ( check_dummy( A, P, Q ) - C != 0 ) {
    220220        DEBOUTLN( cerr, "there is an error detected, the correction coefficients do not" );
     
    223223        DEBOUTLN( cerr, "              Q " << Q );
    224224    }
    225 #endif
     225#endif*/
    226226    }
    227227    DEBDECLEVEL( cerr, "findCorrCoeffs" );
  • factory/fac_univar.cc

    r9b8b09 re7a487  
    3232#ifdef DEBUGOUTPUT
    3333#define DEBOUTHPRINT(stream, msg, hg) \
    34 {stream << deb_level_msg << msg, stream.flush(); hprint( hg ); stream << endl;}
     34{std::stream << deb_level_msg << msg, std::stream.flush(); hprint( hg ); std::stream << std::endl;}
    3535
    3636static void
     
    3838{
    3939    int n = a[0];
    40     cerr << "( " << n << ": ";
     40    std::cerr << "( " << n << ": ";
    4141    int i = 1;
    4242    while ( i < n ) {
    4343        if ( a[i] != 0 )
    44             cerr << i << " ";
     44            std::cerr << i << " ";
    4545        i++;
    4646    }
    47     cerr << ")";
     47    std::cerr << ")";
    4848}
    4949#else /* DEBUGOUTPUT */
  • factory/gfops.cc

    r9b8b09 re7a487  
    3131
    3232const int gf_primes_len = 42;
    33 //static unsigned short gf_primes [] =
    34 //{
    35 //      2,   3,   5,   7,  11,  13,  17,  19,
    36 //     23,  29,  31,  37,  41,  43,  47,  53,
    37 //     59,  61,  67,  71,  73,  79,  83,  89,
    38 //     97, 101, 103, 107, 109, 113, 127, 131,
    39 //    137, 139, 149, 151, 157, 163, 167, 173,
    40 //    179, 181, 191, 193, 197, 199, 223, 211,
    41 //    227, 229, 233, 239, 241, 251
    42 //};
     33#ifndef NOASSERT
     34static unsigned short gf_primes [] =
     35{
     36      2,   3,   5,   7,  11,  13,  17,  19,
     37     23,  29,  31,  37,  41,  43,  47,  53,
     38     59,  61,  67,  71,  73,  79,  83,  89,
     39     97, 101, 103, 107, 109, 113, 127, 131,
     40    137, 139, 149, 151, 157, 163, 167, 173,
     41    179, 181, 191, 193, 197, 199, 223, 211,
     42    227, 229, 233, 239, 241, 251
     43};
     44#endif
    4345
    4446int gf_q = 0;
     
    190192}
    191193
    192 //static bool gf_valid_combination ( int p, int n )
    193 //{
    194 //    int i = 0;
    195 //    while ( i < gf_primes_len && gf_primes[i] != p ) i++;
    196 //    if ( i == gf_primes_len )
    197 //        return false;
    198 //    else
    199 //    {
    200 //        i = n;
    201 //        int a = 1;
    202 //        while ( a < gf_maxtable && i > 0 )
    203 //        {
    204 //            a *= p;
    205 //            i--;
    206 //        }
    207 //        if ( i > 0 || a > gf_maxtable )
    208 //            return false;
    209 //        else
    210 //            return true;
    211 //    }
    212 //}
     194#ifndef NOASSERT
     195static bool gf_valid_combination ( int p, int n )
     196{
     197    int i = 0;
     198    while ( i < gf_primes_len && gf_primes[i] != p ) i++;
     199    if ( i == gf_primes_len )
     200        return false;
     201    else
     202    {
     203        i = n;
     204        int a = 1;
     205        while ( a < gf_maxtable && i > 0 )
     206        {
     207            a *= p;
     208            i--;
     209        }
     210        if ( i > 0 || a > gf_maxtable )
     211            return false;
     212        else
     213            return true;
     214    }
     215}
     216#endif
    213217
    214218void gf_setcharacteristic ( int p, int n, char name )
  • factory/libfac/charset/alg_factor.cc

    r9b8b09 re7a487  
    2828
    2929#include <libfac/factor/debug.h>
    30 #include "timing.h"
    31 TIMING_DEFINE_PRINT(newfactoras_time)
    3230
    3331static Varlist
  • factory/libfac/factor/timing.h

    r9b8b09 re7a487  
    1 ////////////////////////////////////////////////////////////
    2 // emacs edit mode for this file is -*- C++ -*-
    3 // $Id$
    4 ////////////////////////////////////////////////////////////
    5 // It is possible to include this file multiple times for different
    6 // settings of TIMING (but now this isn't used)
     1/* emacs edit mode for this file is -*- C++ -*- */
     2/* $Id$ */
     3
     4/* It should be possible to include this file multiple times for different */
     5/* settings of TIMING */
    76
    87#undef TIMING_START
    98#undef TIMING_END
     9#undef TIMING_END_AND_PRINT
    1010#undef TIMING_DEFINE_PRINT
    1111#undef TIMING_DEFINE_PRINTPROTO
     
    1414#ifdef TIMING
    1515#include <time.h>
     16#if ! defined(WINNT) || defined(__GNUC__)
    1617#include <sys/times.h>
    17 #ifdef HAVE_IOSTREAM
    18 #include <iostream>
    19 #define OSTREAM std::ostream
    20 #define ISTREAM std::istream
    21 #elif defined(HAVE_IOSTREAM_H)
    22 #include <iostream.h>
    23 #define OSTREAM ostream
    24 #define ISTREAM istream
     18#include <sys/param.h>
    2519#endif
     20#ifndef NOSTREAMIO
     21#ifdef HAVE_CSTDIO
     22#include <cstdio>
     23#else
     24#include <stdio.h>
     25#endif
     26#endif
     27
     28// need to be adjusted on your machine:
     29// the number of ticks per second: HZ
     30#if ! defined (HZ) && defined (CLOCKS_PER_SEC)
     31#define HZ CLOCKS_PER_SEC
     32#endif
     33#if ! defined (HZ)  && defined (CLK_TCK)
     34#define HZ CLK_TCK
     35#endif
     36#ifndef HZ
     37#ifdef sun
     38#define HZ 60.0
     39#else
     40#define HZ 100.0
     41#endif
     42#endif
     43
     44#if defined(WINNT) && ! defined(__GNUC__)
     45
     46#define TIMING_START(t) { clock_t timing_ ## t ## _start, timing_ ## t ## _end; \
     47  timing_ ## t ## _start = clock();
     48#define TIMING_END(t) timing_ ## t ## _end = clock(); \
     49timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start; }
     50#define TIMING_END_AND_PRINT(t, msg) times( &timing_ ## t ## _end ); \
     51  fprintf( stderr, "%s%.2f sec\n", msg, \
     52           float( timing_ ## t ## _end - timing_ ## t ## _start ) / HZ ); \
     53  timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start; }
     54#define TIMING_DEFINE_PRINT(t) clock_t timing_ ## t ## _time; \
     55void timing_print_ ## t ( char * msg ) { \
     56  fprintf( stderr, "%s%.2f sec\n", msg, float(timing_ ## t ## _time) / HZ ); \
     57} \
     58void timing_reset_ ## t () { \
     59  timing_ ## t ## _time = 0; \
     60}
     61
     62#else /* ! WINNT */
     63
    2664#define TIMING_START(t) { struct tms timing_ ## t ## _start, timing_ ## t ## _end; \
    2765  times( &timing_ ## t ## _start );
    2866#define TIMING_END(t) times( &timing_ ## t ## _end ); \
    2967  timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime; }
     68#define TIMING_END_AND_PRINT(t, msg) times( &timing_ ## t ## _end ); \
     69  fprintf( stderr, "%s%.2f sec\n", msg, \
     70           float( timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime ) / HZ ); \
     71  timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime; }
    3072#define TIMING_DEFINE_PRINT(t) long timing_ ## t ## _time; \
    31 void timing_print_ ## t ( char * msg ) { CERR.setf( ios::fixed, ios::floatfield); CERR.precision(2); \
    32   CERR << msg << float(timing_ ## t ## _time) / 60 << " sec" << "\n"; }
    33 #define TIMING_PRINT(t,msg) timing_print_ ## t ( msg );
    34 #define TIMING_DEFINE_PRINTPROTO(t) void timing_print_ ## t ( char * );
    35 #else
     73void timing_print_ ## t ( char * msg ) { \
     74  fprintf( stderr, "%s%.2f sec\n", msg, float(timing_ ## t ## _time) / HZ ); \
     75} \
     76void timing_reset_ ## t () { \
     77  timing_ ## t ## _time = 0; \
     78}
     79#endif /* ! WINNT */
     80
     81/* macros common to all platforms */
     82#define TIMING_DEFINE_PRINTPROTO(t) void timing_print_ ## t ( char * ); \
     83  void timing_reset_ ## t ();
     84#define TIMING_PRINT(t, msg) timing_print_ ## t ( msg );
     85#define TIMING_RESET(t) timing_reset_ ## t ();
     86
     87#else /* TIMING */
    3688#define TIMING_START(t)
    3789#define TIMING_END(t)
     90#define TIMING_END_AND_PRINT(t, msg)
    3891#define TIMING_DEFINE_PRINT(t)
    39 #define TIMING_PRINT(t,msg)
    4092#define TIMING_DEFINE_PRINTPROTO(t)
     93#define TIMING_PRINT(t, msg)
     94#define TIMING_RESET(t)
    4195#endif /* TIMING */
    42 
  • factory/variable.cc

    r9b8b09 re7a487  
    151151#endif /* NOSTREAMIO */
    152152
    153 //static bool legal_mipo( const CanonicalForm & mipo )
    154 //{
    155 //    ASSERT( mipo.inPolyDomain(), "not a legal extension" );
    156 //    bool ok = true;
    157 //    for ( CFIterator i = mipo; ok && i.hasTerms(); i++ )
    158 //        ok = i.coeff().inBaseDomain();
    159 //    return ok;
    160 //}
    161 
    162153static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alpha )
    163154{
     
    170161Variable rootOf( const CanonicalForm & mipo, char name )
    171162{
    172     ASSERT( legal_mipo( mipo ), "not a legal extension" );
     163    ASSERT (mipo.inPolyDomain() && mipo.isUnivariate(), "not a legal extension");
    173164
    174165    int l;
Note: See TracChangeset for help on using the changeset viewer.