Author: sebor
Date: Sat Feb 4 17:03:33 2006
New Revision: 374954
URL: http://svn.apache.org/viewcvs?rev=374954&view=rev
Log:
2006-02-04 Anton Pevtsov <[EMAIL PROTECTED]>
* 25.nth.element.cpp (test_nth_element): Updated the upper bound value
to a more strict one.
Modified:
incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp
Modified: incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp?rev=374954&r1=374953&r2=374954&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp Sat Feb 4
17:03:33 2006
@@ -155,11 +155,11 @@
}
// check the complexity, 25.3.2, p2
- // it should be linear, so use 2 * N * log N as upper bound
+ // it should be linear, i.e. <= K * N, there K << N
+ // after tests on random sequences use K == 8 as upper bound
std::size_t n_ops =
ppred ? Predicate::funcalls_ : T::n_total_op_lt_ - last_n_op_lt;
- std::size_t exp_ops = nsrc * 2 * (::ilog2 (nsrc) + 1) < nsrc ?
- nsrc : 2 * nsrc * (::ilog2 (nsrc) + 1);
+ std::size_t exp_ops = 8 * nsrc;
success = n_ops <= exp_ops;