Verified Commit 28d585b2 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: add test on switch between np.array and np.matrix

parent d6539ff6
# Copyright (c) 2016-2018 CNRS
# Copyright (c) 2016-2018 CNRS INRIA
# This file is part of eigenpy
# eigenpy is free software: you can redistribute it
......@@ -46,3 +46,4 @@ ENDIF()
ADD_PYTHON_UNIT_TEST("py-matrix" "unittest/python/" "unittest")
ADD_PYTHON_UNIT_TEST("py-geometry" "unittest/python/" "unittest")
ADD_PYTHON_UNIT_TEST("py-switch" "unittest/python/" "unittest")
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 isinstance(coeffs_vector,np.matrixlib.defmatrix.matrix)
# Switch to numpy.array
coeffs_array = quat.coeffs()
assert isinstance(coeffs_vector,np.ndarray)
Supports Markdown
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