This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: sort_heap complexity guarantee
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: FranÃois Dumont <frs dot dumont at gmail dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 23 Oct 2014 01:53:05 +0200
- Subject: Re: sort_heap complexity guarantee
- Authentication-results: sourceware.org; auth=none
- References: <5431A354 dot 2050404 at gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1410052245150 dot 5366 at stedding dot saclay dot inria dot fr> <543302DF dot 7080607 at gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1410180916210 dot 1567 at laptop-mg dot saclay dot inria dot fr> <54456EEC dot 9000707 at gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1410202237520 dot 19590 at stedding dot saclay dot inria dot fr> <54481C33 dot 3070400 at gmail dot com>
Hi,
On 10/22/2014 11:05 PM, FranÃois Dumont wrote:
+ VERIFY( counter_type::less_compare_count <= 2.0 * std::log2(nb_values) );
Nit: log2 isn't in C89, thus we shouldn't use it unconditionally, ie, if
the test isn't guarded by { dg-require-cmath "" }. Thus, either the
latter, or just express log_2 in terms of log / log10.
Paolo.