Re: sort_heap complexity guarantee

2014-10-22 Thread Paolo Carlini
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 l

Re: sort_heap complexity guarantee

2014-10-22 Thread Jonathan Wakely
On 22/10/14 23:05 +0200, François Dumont wrote: Then I think we need this patch which also fix other issues. 2014-10-22 François Dumont * testsuite/25_algorithms/make_heap/complexity.cc: Add missing test variable. * testsuite/25_algorithms/sort_heap/complexity.cc: Likewise and use

Re: sort_heap complexity guarantee

2014-10-22 Thread François Dumont
Then I think we need this patch which also fix other issues. 2014-10-22 François Dumont * testsuite/25_algorithms/make_heap/complexity.cc: Add missing test variable. * testsuite/25_algorithms/sort_heap/complexity.cc: Likewise and use log2. * testsuite/25_algorithms/pop_hea

Re: sort_heap complexity guarantee

2014-10-18 Thread Marc Glisse
On Mon, 6 Oct 2014, François Dumont wrote: * testsuite/25_algorithms/push_heap/complexity.cc: New. This test is randomly failing in about 1% to 2% of cases. -- Marc Glisse

Re: sort_heap complexity guarantee

2014-10-08 Thread Jonathan Wakely
On 06/10/14 23:00 +0200, François Dumont wrote: Good point, with n calls to pop_heap it means that limit must be 2*log(1) + 2*log(2) +... + 2*log(n) which is 2*log(n!) and which is also necessarily < 2*n*log(n). I guess Standard comittee has forgotten the factor 2 in the limit so this is what

Re: sort_heap complexity guarantee

2014-10-07 Thread Daniel Krügler
2014-10-07 23:11 GMT+02:00 François Dumont : > On 06/10/2014 23:05, Daniel Krügler wrote: >> François, could you please submit a corresponding LWG issue by sending >> an email using the recipe described here: >> >> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#submit_issue >> >> ? >>

Re: sort_heap complexity guarantee

2014-10-07 Thread François Dumont
On 06/10/2014 23:05, Daniel Krügler wrote: 2014-10-06 23:00 GMT+02:00 François Dumont : On 05/10/2014 22:54, Marc Glisse wrote: On Sun, 5 Oct 2014, François Dumont wrote: I took a look at PR 61217 regarding pop_heap complexity guarantee. Looks like we have no test to check complexity of o

Re: sort_heap complexity guarantee

2014-10-06 Thread Daniel Krügler
2014-10-06 23:00 GMT+02:00 François Dumont : > On 05/10/2014 22:54, Marc Glisse wrote: >> >> On Sun, 5 Oct 2014, François Dumont wrote: >> >>>I took a look at PR 61217 regarding pop_heap complexity guarantee. >>> Looks like we have no test to check complexity of our algos so I start >>> writing

Re: sort_heap complexity guarantee

2014-10-06 Thread François Dumont
On 05/10/2014 22:54, Marc Glisse wrote: On Sun, 5 Oct 2014, François Dumont wrote: I took a look at PR 61217 regarding pop_heap complexity guarantee. Looks like we have no test to check complexity of our algos so I start writing some starting with the heap operations. I found no issue with