Go to the documentation of this file.
12 #define ADD_COMPLEXITY_CASES(...) \
13 int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
18 {
"%rms_name", rms_test_name},
19 {
"%bigo_str",
"[ ]* %float " + big_o},
21 {
"%rms",
"[ ]*[0-9]+ %"}});
24 {{
"^%bigo_name %bigo_str %bigo_str[ ]*$"},
26 {
"^%rms_name %rms %rms[ ]*$",
MR_Next}});
28 {
"\"cpu_coefficient\": [0-9]+,$",
MR_Next},
29 {
"\"real_coefficient\": [0-9]{1,5},$",
MR_Next},
30 {
"\"big_o\": \"%bigo\",$",
MR_Next},
31 {
"\"time_unit\": \"ns\"$",
MR_Next},
33 {
"\"name\": \"%rms_name\",$"},
36 AddCases(
TC_CSVOut, {{
"^\"%bigo_name\",,%float,%float,%bigo,,,,,$"},
37 {
"^\"%bigo_name\"",
MR_Not},
38 {
"^\"%rms_name\",,%float,%float,,,,,,$",
MR_Next}});
50 for (
int i = 0;
i < 1024; ++
i) {
87 for (
int i = 0;
i <
size; ++
i) {
88 v.push_back(std::rand() %
size);
95 const int item_not_in_vector =
104 ->Range(1 << 10, 1 << 16)
108 ->Range(1 << 10, 1 << 16)
109 ->Complexity([](
int n) ->
double {
return n; });
112 ->Range(1 << 10, 1 << 16)
133 std::sort(
v.begin(),
v.end());
139 ->Range(1 << 10, 1 << 16)
143 ->Range(1 << 10, 1 << 16)
144 ->Complexity([](
int n) {
return n * log2(
n); });
147 ->Range(1 << 10, 1 << 16)
const char * lambda_big_o_1
const char * big_o_n_lg_n_test_name
const char * big_o_n_test_name
BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const &value)
GLsizei const GLchar *const * string
const char * enum_auto_big_o_n_lg_n
const char * big_o_1_test_name
int AddCases(TestCaseID ID, std::initializer_list< TestCase > il)
const char * auto_big_o_1
const char * rms_o_n_lg_n_test_name
const char * lambda_big_o_n_lg_n
void BM_Complexity_O1(benchmark::State &state)
static void BM_Complexity_O_N_log_N(benchmark::State &state)
const char * rms_o_1_test_name
BENCHMARK(BM_Complexity_O1) -> Range(1, 1<< 18) ->Complexity(benchmark::o1)
void RunOutputTests(int argc, char *argv[])
#define ADD_COMPLEXITY_CASES(...)
const char * lambda_big_o_n
BENCHMARK_ALWAYS_INLINE int range(std::size_t pos=0) const
void BM_Complexity_O_N(benchmark::State &state)
std::vector< int > ConstructRandomVector(int size)
const char * enum_big_o_1
int SetSubstitutions(std::initializer_list< std::pair< std::string, std::string >> il)
const char * rms_o_n_test_name
BENCHMARK_ALWAYS_INLINE void SetComplexityN(int complexity_n)
int main(int argc, char *argv[])
const char * enum_auto_big_o_n
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:48