Skip to content
Snippets Groups Projects
Verified Commit 070d223d authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: add test for the dimensions checking

parent 291929c9
No related branches found
No related tags found
No related merge requests found
......@@ -36,3 +36,4 @@ ENDIF()
ADD_PYTHON_UNIT_TEST("py-matrix" "unittest/python/test_matrix.py" "unittest")
ADD_PYTHON_UNIT_TEST("py-geometry" "unittest/python/test_geometry.py" "unittest")
ADD_PYTHON_UNIT_TEST("py-switch" "unittest/python/test_switch.py" "python/eigenpy")
ADD_PYTHON_UNIT_TEST("py-dimensions" "unittest/python/test_dimensions.py" "python/eigenpy")
from __future__ import print_function
import eigenpy
import numpy as np
quat = eigenpy.Quaternion()
# By default, we convert as numpy.matrix
coeffs_vector = quat.coeffs()
assert len(coeffs_vector.shape) == 2
# Switch to numpy.array
eigenpy.switchToNumpyArray()
coeffs_vector = quat.coeffs()
assert len(coeffs_vector.shape) == 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment