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
340fe557
Commit
340fe557
authored
May 25, 2016
by
Ismael
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indent
parent
290ac9ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
complexity.cc
src/complexity.cc
+13
-13
No files found.
src/complexity.cc
View file @
340fe557
...
@@ -25,19 +25,19 @@ namespace benchmark {
...
@@ -25,19 +25,19 @@ namespace benchmark {
// Internal function to calculate the different scalability forms
// Internal function to calculate the different scalability forms
std
::
function
<
double
(
int
)
>
FittingCurve
(
BigO
complexity
)
{
std
::
function
<
double
(
int
)
>
FittingCurve
(
BigO
complexity
)
{
switch
(
complexity
)
{
switch
(
complexity
)
{
case
oN
:
case
oN
:
return
[](
int
n
)
{
return
n
;
};
return
[](
int
n
)
{
return
n
;
};
case
oNSquared
:
case
oNSquared
:
return
[](
int
n
)
{
return
n
*
n
;
};
return
[](
int
n
)
{
return
n
*
n
;
};
case
oNCubed
:
case
oNCubed
:
return
[](
int
n
)
{
return
n
*
n
*
n
;
};
return
[](
int
n
)
{
return
n
*
n
*
n
;
};
case
oLogN
:
case
oLogN
:
return
[](
int
n
)
{
return
log2
(
n
);
};
return
[](
int
n
)
{
return
log2
(
n
);
};
case
oNLogN
:
case
oNLogN
:
return
[](
int
n
)
{
return
n
*
log2
(
n
);
};
return
[](
int
n
)
{
return
n
*
log2
(
n
);
};
case
o1
:
case
o1
:
default
:
default
:
return
[](
int
)
{
return
1
;
};
return
[](
int
)
{
return
1
;
};
}
}
}
}
...
...
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