Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
28d585b2
Verified
Commit
28d585b2
authored
Oct 18, 2018
by
Justin Carpentier
Browse files
test: add test on switch between np.array and np.matrix
parent
d6539ff6
Changes
2
Hide whitespace changes
Inline
Side-by-side
unittest/CMakeLists.txt
View file @
28d585b2
#
# 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/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"
"unittest"
)
unittest/python/test_switch.py
0 → 100644
View file @
28d585b2
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
()
print
(
type
(
coeffs_vector
))
assert
isinstance
(
coeffs_vector
,
np
.
matrixlib
.
defmatrix
.
matrix
)
# Switch to numpy.array
eigenpy
.
switchToNumpyArray
()
coeffs_array
=
quat
.
coeffs
()
print
(
type
(
coeffs_array
))
assert
isinstance
(
coeffs_vector
,
np
.
ndarray
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment