mirror of
https://github.com/google/benchmark.git
synced 2025-01-27 20:30:15 +08:00
fix issue 235 (#236)
This commit is contained in:
parent
2d088a9f2d
commit
3fdd76bd14
@ -35,9 +35,9 @@ BigOFunc* FittingCurve(BigO complexity) {
|
||||
case oNCubed:
|
||||
return [](int n) -> double { return n * n * n; };
|
||||
case oLogN:
|
||||
return [](int n) { return log2(n); };
|
||||
return [](int n) { return std::log2(n); };
|
||||
case oNLogN:
|
||||
return [](int n) { return n * log2(n); };
|
||||
return [](int n) { return n * std::log2(n); };
|
||||
case o1:
|
||||
default:
|
||||
return [](int) { return 1.0; };
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
namespace {
|
||||
|
||||
@ -220,7 +221,7 @@ static void BM_Complexity_O_N_log_N(benchmark::State& state) {
|
||||
state.SetComplexityN(state.range_x());
|
||||
}
|
||||
BENCHMARK(BM_Complexity_O_N_log_N) -> RangeMultiplier(2) -> Range(1<<10, 1<<16) -> Complexity(benchmark::oNLogN);
|
||||
BENCHMARK(BM_Complexity_O_N_log_N) -> RangeMultiplier(2) -> Range(1<<10, 1<<16) -> Complexity([](int n) {return n * log2(n); });
|
||||
BENCHMARK(BM_Complexity_O_N_log_N) -> RangeMultiplier(2) -> Range(1<<10, 1<<16) -> Complexity([](int n) {return n * std::log2(n); });
|
||||
BENCHMARK(BM_Complexity_O_N_log_N) -> RangeMultiplier(2) -> Range(1<<10, 1<<16) -> Complexity();
|
||||
|
||||
const char* big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO";
|
||||
|
Loading…
Reference in New Issue
Block a user