1 from __future__
import print_function
9 from IPython
import get_ipython
10 ipython = get_ipython()
12 quat = eigenpy.Quaternion()
15 cmd1 =
"timeit np.array(a)" 21 cmd2 =
"timeit np.matrix(a)" 26 eigenpy.switchToNumpyMatrix()
27 print(
"----------------------")
28 print(
"switch to numpy matrix")
29 print(
"----------------------")
32 cmd3 =
"timeit quat.coeffs()" 37 eigenpy.switchToNumpyArray()
38 print(
"---------------------")
39 print(
"switch to numpy array")
40 print(
"---------------------")
43 cmd4 =
"timeit quat.coeffs()" 48 cmd5 =
"timeit np.asmatrix(quat.coeffs())" 53 a_matrix = np.matrix(a);
54 cmd6 =
"timeit np.asarray(a_matrix)"