Commit a6c5e63f authored by Justin Carpentier's avatar Justin Carpentier

test/switch: test getNumpyType

parent b41630d3
......@@ -3,12 +3,14 @@ from __future__ import print_function
import eigenpy
import numpy as np
eigenpy.switchToNumpyMatrix()
quat = eigenpy.Quaternion()
# By default, we convert as numpy.matrix
coeffs_vector = quat.coeffs()
print(type(coeffs_vector))
assert isinstance(coeffs_vector,np.matrixlib.defmatrix.matrix)
assert eigenpy.getNumpyType() == np.matrix
# Switch to numpy.array
eigenpy.switchToNumpyArray()
......@@ -16,3 +18,4 @@ coeffs_array = quat.coeffs()
print(type(coeffs_array))
assert isinstance(coeffs_vector,np.ndarray)
assert eigenpy.getNumpyType() == np.ndarray
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment