]> www.ginac.de Git - ginac.git/commitdiff
Univariate GCD timing: use sr_gcd when appropriate. release_1-5-0
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Mon, 16 Feb 2009 14:23:16 +0000 (16:23 +0200)
committerJens Vollinga <jensv@balin.nikhef.nl>
Tue, 17 Feb 2009 13:43:36 +0000 (14:43 +0100)
The benchmark consists of two parts:
1) timing of different GCD calculation methods (i.e. subresultant PRS,
   heuristic, chinese remaindering).
2) timing of different implementations of the same method. The purpose
   is to find out how (in)efficient GiNaC::ex is as a representation
   of (univariate) polynomials (as a side note, the result is a bit
   depressing -- using coefficient vector instead of GiNaC:ex makes
   GCD calculation 50x -- 1000x faster).

Now GiNaC uses modular (chinese remaindering) GCD by default, so part 2)
got broken, i.e. instead of (intended) timings

a) (heuristic, GiNaC::ex) versus (heuristic, coefficient vector)
b) (PRS, GiNaC::ex) versus (PRS, coefficient vector)

one gets

a') (heuristic, GiNaC::ex) versus (heuristic, coefficient vector)
b') (chinese remaindering, GiNaC::ex) versus (PRS, coefficient vector)

Set the gcd_options::use_sr_gcd to restore the meaning of the benchmark.

Note: this patch does not affect the library proper.

check/time_uvar_gcd.cpp

index c65c515b45f72f92e50694896da1153b3a1922b2..fe7589746a8d0ffa1835d85c82e38161dc842514 100644 (file)
@@ -1780,7 +1780,8 @@ struct ex_sr_gcd_test
        const upoly& g_check;
        unsigned options;
        ex_sr_gcd_test(const ex& a_, const ex& b_, const upoly& g_) :
        const upoly& g_check;
        unsigned options;
        ex_sr_gcd_test(const ex& a_, const ex& b_, const upoly& g_) :
-               a(a_), b(b_), g(0), g_check(g_), options(gcd_options::no_heur_gcd)
+               a(a_), b(b_), g(0), g_check(g_), options(gcd_options::no_heur_gcd |
+                                                        gcd_options::use_sr_gcd)
        { }
 
        inline void run()
        { }
 
        inline void run()