Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
eigenpy
Commits
0b3366f3
Verified
Commit
0b3366f3
authored
6 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
bench: add benchmark of switch between np.array and np.matrix
parent
28d585b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/bench-switch.py
+46
-0
46 additions, 0 deletions
benchmarks/bench-switch.py
with
46 additions
and
0 deletions
benchmarks/bench-switch.py
0 → 100644
+
46
−
0
View file @
0b3366f3
from
__future__
import
print_function
import
eigenpy
import
numpy
as
np
import
time
import
timeit
from
IPython
import
get_ipython
ipython
=
get_ipython
()
quat
=
eigenpy
.
Quaternion
()
a
=
[
0.
,
0.
,
0.
]
cmd1
=
"
timeit np.array(a)
"
print
(
"
\n
"
)
print
(
cmd1
)
ipython
.
magic
(
cmd1
)
print
(
"
\n
"
)
cmd2
=
"
timeit np.matrix(a)
"
print
(
cmd2
)
ipython
.
magic
(
cmd2
)
print
(
"
\n
"
)
eigenpy
.
switchToNumpyMatrix
()
print
(
"
----------------------
"
)
print
(
"
switch to numpy matrix
"
)
print
(
"
----------------------
"
)
print
(
"
\n
"
)
cmd3
=
"
timeit quat.coeffs()
"
print
(
cmd3
)
ipython
.
magic
(
cmd3
)
print
(
"
\n
"
)
eigenpy
.
switchToNumpyArray
()
print
(
"
---------------------
"
)
print
(
"
switch to numpy array
"
)
print
(
"
---------------------
"
)
print
(
"
\n
"
)
cmd4
=
"
timeit quat.coeffs()
"
print
(
cmd4
)
ipython
.
magic
(
cmd4
)
print
(
"
\n
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment