From: Alexei Sheplyakov Date: Mon, 16 Feb 2009 14:23:16 +0000 (+0200) Subject: Univariate GCD timing: use sr_gcd when appropriate. X-Git-Tag: release_1-5-0 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=cbba7a5eb9d33003c081a8017dec7da3aa990571;p=ginac.git Univariate GCD timing: use sr_gcd when appropriate. 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. --- diff --git a/check/time_uvar_gcd.cpp b/check/time_uvar_gcd.cpp index c65c515b..fe758974 100644 --- a/check/time_uvar_gcd.cpp +++ b/check/time_uvar_gcd.cpp @@ -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_) : - 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()