Macros | Functions | Variables
complexity_test.cc File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <vector>
#include "benchmark/benchmark.h"
#include "output_test.h"
Include dependency graph for complexity_test.cc:

Go to the source code of this file.

Macros

#define ADD_COMPLEXITY_CASES(...)   int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
 

Functions

 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, auto_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, enum_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, lambda_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name, enum_auto_big_o_n_lg_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name, lambda_big_o_n_lg_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_test_name, rms_o_n_test_name, enum_auto_big_o_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_test_name, rms_o_n_test_name, lambda_big_o_n)
 
 BENCHMARK (BM_Complexity_O1) -> Range(1, 1<< 18) ->Complexity(benchmark::o1)
 
void BM_Complexity_O1 (benchmark::State &state)
 
void BM_Complexity_O_N (benchmark::State &state)
 
static void BM_Complexity_O_N_log_N (benchmark::State &state)
 
std::vector< int > ConstructRandomVector (int size)
 
int main (int argc, char *argv[])
 
 RangeMultiplier (2) -> Range(1<< 10, 1<< 16) ->Complexity(benchmark::oN)
 

Variables

const char * auto_big_o_1 = "(\\([0-9]+\\))|(lgN)"
 
const char * big_o_1_test_name = "BM_Complexity_O1_BigO"
 
const char * big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO"
 
const char * big_o_n_test_name = "BM_Complexity_O_N_BigO"
 
const char * enum_auto_big_o_n = "N"
 
const char * enum_auto_big_o_n_lg_n = "NlgN"
 
const char * enum_big_o_1 = "\\([0-9]+\\)"
 
const char * lambda_big_o_1 = "f\\(N\\)"
 
const char * lambda_big_o_n = "f\\(N\\)"
 
const char * lambda_big_o_n_lg_n = "f\\(N\\)"
 
const char * rms_o_1_test_name = "BM_Complexity_O1_RMS"
 
const char * rms_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_RMS"
 
const char * rms_o_n_test_name = "BM_Complexity_O_N_RMS"
 

Macro Definition Documentation

◆ ADD_COMPLEXITY_CASES

#define ADD_COMPLEXITY_CASES (   ...)    int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)

Definition at line 12 of file complexity_test.cc.

Function Documentation

◆ ADD_COMPLEXITY_CASES() [1/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
auto_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [2/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
enum_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [3/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
lambda_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [4/7]

◆ ADD_COMPLEXITY_CASES() [5/7]

ADD_COMPLEXITY_CASES ( big_o_n_lg_n_test_name  ,
rms_o_n_lg_n_test_name  ,
lambda_big_o_n_lg_n   
)

◆ ADD_COMPLEXITY_CASES() [6/7]

ADD_COMPLEXITY_CASES ( big_o_n_test_name  ,
rms_o_n_test_name  ,
enum_auto_big_o_n   
)

◆ ADD_COMPLEXITY_CASES() [7/7]

ADD_COMPLEXITY_CASES ( big_o_n_test_name  ,
rms_o_n_test_name  ,
lambda_big_o_n   
)

◆ BENCHMARK()

BENCHMARK ( BM_Complexity_O1  ) -> Range(1, 1 << 18)->Complexity(benchmark::o1)

Definition at line 58 of file complexity_test.cc.

◆ BM_Complexity_O1()

void BM_Complexity_O1 ( benchmark::State state)

Definition at line 48 of file complexity_test.cc.

◆ BM_Complexity_O_N()

void BM_Complexity_O_N ( benchmark::State state)

Definition at line 93 of file complexity_test.cc.

◆ BM_Complexity_O_N_log_N()

static void BM_Complexity_O_N_log_N ( benchmark::State state)
static

Definition at line 130 of file complexity_test.cc.

◆ ConstructRandomVector()

std::vector<int> ConstructRandomVector ( int  size)

Definition at line 84 of file complexity_test.cc.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 167 of file complexity_test.cc.

◆ RangeMultiplier()

RangeMultiplier ( ) -> Range(1<< 10, 1<< 16) ->Complexity(benchmark::oN)

Definition at line 107 of file complexity_test.cc.

Variable Documentation

◆ auto_big_o_1

const char* auto_big_o_1 = "(\\([0-9]+\\))|(lgN)"

Definition at line 68 of file complexity_test.cc.

◆ big_o_1_test_name

const char* big_o_1_test_name = "BM_Complexity_O1_BigO"

Definition at line 62 of file complexity_test.cc.

◆ big_o_n_lg_n_test_name

const char* big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO"

Definition at line 150 of file complexity_test.cc.

◆ big_o_n_test_name

const char* big_o_n_test_name = "BM_Complexity_O_N_BigO"

Definition at line 115 of file complexity_test.cc.

◆ enum_auto_big_o_n

const char* enum_auto_big_o_n = "N"

Definition at line 117 of file complexity_test.cc.

◆ enum_auto_big_o_n_lg_n

const char* enum_auto_big_o_n_lg_n = "NlgN"

Definition at line 152 of file complexity_test.cc.

◆ enum_big_o_1

const char* enum_big_o_1 = "\\([0-9]+\\)"

Definition at line 64 of file complexity_test.cc.

◆ lambda_big_o_1

const char* lambda_big_o_1 = "f\\(N\\)"

Definition at line 69 of file complexity_test.cc.

◆ lambda_big_o_n

const char* lambda_big_o_n = "f\\(N\\)"

Definition at line 118 of file complexity_test.cc.

◆ lambda_big_o_n_lg_n

const char* lambda_big_o_n_lg_n = "f\\(N\\)"

Definition at line 153 of file complexity_test.cc.

◆ rms_o_1_test_name

const char* rms_o_1_test_name = "BM_Complexity_O1_RMS"

Definition at line 63 of file complexity_test.cc.

◆ rms_o_n_lg_n_test_name

const char* rms_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_RMS"

Definition at line 151 of file complexity_test.cc.

◆ rms_o_n_test_name

const char* rms_o_n_test_name = "BM_Complexity_O_N_RMS"

Definition at line 116 of file complexity_test.cc.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:02