File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import print_function
2+
3+ import eigenpy
4+ import numpy as np
5+
6+ import time
7+ import timeit
8+
9+ from IPython import get_ipython
10+ ipython = get_ipython ()
11+
12+ quat = eigenpy .Quaternion ()
13+ a = [0. , 0. , 0. ]
14+
15+ cmd1 = "timeit np.array(a)"
16+ print ("\n " )
17+ print (cmd1 )
18+ ipython .magic (cmd1 )
19+ print ("\n " )
20+
21+ cmd2 = "timeit np.matrix(a)"
22+ print (cmd2 )
23+ ipython .magic (cmd2 )
24+ print ("\n " )
25+
26+ eigenpy .switchToNumpyMatrix ()
27+ print ("----------------------" )
28+ print ("switch to numpy matrix" )
29+ print ("----------------------" )
30+ print ("\n " )
31+
32+ cmd3 = "timeit quat.coeffs()"
33+ print (cmd3 )
34+ ipython .magic (cmd3 )
35+ print ("\n " )
36+
37+ eigenpy .switchToNumpyArray ()
38+ print ("---------------------" )
39+ print ("switch to numpy array" )
40+ print ("---------------------" )
41+ print ("\n " )
42+
43+ cmd4 = "timeit quat.coeffs()"
44+ print (cmd4 )
45+ ipython .magic (cmd4 )
46+ print ("\n " )
You can’t perform that action at this time.
0 commit comments