File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11#
2- # Copyright (c) 2016-2018 CNRS
2+ # Copyright (c) 2016-2018 CNRS INRIA
33#
44# This file is part of eigenpy
55# eigenpy is free software: you can redistribute it
@@ -46,3 +46,4 @@ ENDIF()
4646
4747ADD_PYTHON_UNIT_TEST("py-matrix" "unittest/python/test_matrix.py" "unittest" )
4848ADD_PYTHON_UNIT_TEST("py-geometry" "unittest/python/test_geometry.py" "unittest" )
49+ ADD_PYTHON_UNIT_TEST("py-switch" "unittest/python/test_switch.py" "unittest" )
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+ quat = eigenpy .Quaternion ()
7+ # By default, we convert as numpy.matrix
8+ coeffs_vector = quat .coeffs ()
9+ print (type (coeffs_vector ))
10+
11+ assert isinstance (coeffs_vector ,np .matrixlib .defmatrix .matrix )
12+
13+ # Switch to numpy.array
14+ eigenpy .switchToNumpyArray ()
15+ coeffs_array = quat .coeffs ()
16+ print (type (coeffs_array ))
17+
18+ assert isinstance (coeffs_vector ,np .ndarray )
You can’t perform that action at this time.
0 commit comments