fix issue 235 (#236)

This commit is contained in:
Ismael 2016-06-03 18:33:17 +02:00 committed by Dominic Hamon
parent 2d088a9f2d
commit 3fdd76bd14
2 changed files with 4 additions and 3 deletions

View File

@ -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; };

View File

@ -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";