Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
ac3ec2de
Commit
ac3ec2de
authored
May 26, 2016
by
Ismael
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved complexity.h into src and BigO enum into benchmark_api
parent
d82f0c31
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
21 deletions
+22
-21
benchmark_api.h
include/benchmark/benchmark_api.h
+14
-1
complexity.cc
src/complexity.cc
+1
-1
complexity.h
src/complexity.h
+5
-17
console_reporter.cc
src/console_reporter.cc
+1
-1
reporter.cc
src/reporter.cc
+1
-1
No files found.
include/benchmark/benchmark_api.h
View file @
ac3ec2de
...
@@ -154,7 +154,6 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
...
@@ -154,7 +154,6 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
#include <stdint.h>
#include <stdint.h>
#include "macros.h"
#include "macros.h"
#include "complexity.h"
namespace
benchmark
{
namespace
benchmark
{
class
BenchmarkReporter
;
class
BenchmarkReporter
;
...
@@ -239,6 +238,20 @@ enum TimeUnit {
...
@@ -239,6 +238,20 @@ enum TimeUnit {
kMillisecond
kMillisecond
};
};
// BigO is passed to a benchmark in order to specify the asymptotic computational
// complexity for the benchmark. In case oAuto is selected, complexity will be
// calculated automatically to the best fit.
enum
BigO
{
oNone
,
o1
,
oN
,
oNSquared
,
oNCubed
,
oLogN
,
oNLogN
,
oAuto
};
// State is passed to a running Benchmark and contains state for the
// State is passed to a running Benchmark and contains state for the
// benchmark to use.
// benchmark to use.
class
State
{
class
State
{
...
...
src/complexity.cc
View file @
ac3ec2de
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
// Source project : https://github.com/ismaelJimenez/cpp.leastsq
// Source project : https://github.com/ismaelJimenez/cpp.leastsq
// Adapted to be used with google benchmark
// Adapted to be used with google benchmark
#include "
benchmark/
complexity.h"
#include "complexity.h"
#include "check.h"
#include "check.h"
#include <math.h>
#include <math.h>
#include <functional>
#include <functional>
...
...
include/benchmark
/complexity.h
→
src
/complexity.h
View file @
ac3ec2de
...
@@ -21,21 +21,9 @@
...
@@ -21,21 +21,9 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
namespace
benchmark
{
#include "benchmark/benchmark_api.h"
// BigO is passed to a benchmark in order to specify the asymptotic computational
namespace
benchmark
{
// complexity for the benchmark. In case oAuto is selected, complexity will be
// calculated automatically to the best fit.
enum
BigO
{
oNone
,
o1
,
oN
,
oNSquared
,
oNCubed
,
oLogN
,
oNLogN
,
oAuto
};
// This data structure will contain the result returned by MinimalLeastSq
// This data structure will contain the result returned by MinimalLeastSq
// - coef : Estimated coeficient for the high-order term as
// - coef : Estimated coeficient for the high-order term as
...
@@ -54,17 +42,17 @@ struct LeastSq {
...
@@ -54,17 +42,17 @@ struct LeastSq {
double
coef
;
double
coef
;
double
rms
;
double
rms
;
BigO
complexity
;
benchmark
::
BigO
complexity
;
};
};
// Function to return an string for the calculated complexity
// Function to return an string for the calculated complexity
std
::
string
GetBigOString
(
BigO
complexity
);
std
::
string
GetBigOString
(
benchmark
::
BigO
complexity
);
// Find the coefficient for the high-order term in the running time, by
// Find the coefficient for the high-order term in the running time, by
// minimizing the sum of squares of relative error.
// minimizing the sum of squares of relative error.
LeastSq
MinimalLeastSq
(
const
std
::
vector
<
int
>&
n
,
LeastSq
MinimalLeastSq
(
const
std
::
vector
<
int
>&
n
,
const
std
::
vector
<
double
>&
time
,
const
std
::
vector
<
double
>&
time
,
const
BigO
complexity
=
oAuto
);
const
benchmark
::
BigO
complexity
=
oAuto
);
}
// end namespace benchmark
}
// end namespace benchmark
#endif // COMPLEXITY_H_
#endif // COMPLEXITY_H_
src/console_reporter.cc
View file @
ac3ec2de
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
// limitations under the License.
// limitations under the License.
#include "benchmark/reporter.h"
#include "benchmark/reporter.h"
#include "
benchmark/
complexity.h"
#include "complexity.h"
#include <cstdint>
#include <cstdint>
#include <cstdio>
#include <cstdio>
...
...
src/reporter.cc
View file @
ac3ec2de
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
// limitations under the License.
// limitations under the License.
#include "benchmark/reporter.h"
#include "benchmark/reporter.h"
#include "
benchmark/
complexity.h"
#include "complexity.h"
#include <cstdlib>
#include <cstdlib>
#include <vector>
#include <vector>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment