benchmarks
bench-switch.py
Go to the documentation of this file.
1
from
__future__
import
print_function
2
3
import
eigenpy
4
import
numpy
as
np
5
6
import
time
# noqa
7
import
timeit
# noqa
8
9
from
IPython
import
get_ipython
10
11
ipython = get_ipython()
12
13
quat = eigenpy.Quaternion()
14
a = [0.0, 0.0, 0.0]
15
16
cmd1 =
"timeit np.array(a)"
17
print
(
"\n"
)
18
print
(cmd1)
19
ipython.magic(cmd1)
20
print
(
"\n"
)
21
22
cmd2 =
"timeit np.matrix(a)"
23
print
(cmd2)
24
ipython.magic(cmd2)
25
print
(
"\n"
)
26
27
cmd4 =
"timeit quat.coeffs()"
28
print
(cmd4)
29
ipython.magic(cmd4)
30
print
(
"\n"
)
31
32
cmd5 =
"timeit np.asmatrix(quat.coeffs())"
33
print
(cmd5)
34
ipython.magic(cmd5)
35
print
(
"\n"
)
36
37
a_matrix = np.matrix(a)
38
cmd6 =
"timeit np.asarray(a_matrix)"
39
print
(cmd6)
40
ipython.magic(cmd6)
41
print
(
"\n"
)
print
void print(const Tensor &tensor)
Definition:
tensor.cpp:35
eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 2 2023 02:10:26