Skip to content
GitLab
Menu
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
4e7cbeb3
Verified
Commit
4e7cbeb3
authored
Jan 29, 2020
by
Justin Carpentier
Browse files
test: add test of EigenSolver
parent
339241f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
unittest/CMakeLists.txt
View file @
4e7cbeb3
...
...
@@ -48,3 +48,6 @@ SET_TESTS_PROPERTIES("py-dimensions" PROPERTIES DEPENDS ${PYWRAP})
ADD_PYTHON_UNIT_TEST
(
"py-version"
"unittest/python/test_version.py"
"python/eigenpy"
)
SET_TESTS_PROPERTIES
(
"py-version"
PROPERTIES DEPENDS
${
PYWRAP
}
)
ADD_PYTHON_UNIT_TEST
(
"py-eigen-solver"
"unittest/python/test_eigen_solver.py"
"python/eigenpy"
)
SET_TESTS_PROPERTIES
(
"py-eigen-solver"
PROPERTIES DEPENDS
${
PYWRAP
}
)
unittest/python/test_eigen_solver.py
0 → 100644
View file @
4e7cbeb3
import
eigenpy
eigenpy
.
switchToNumpyArray
()
import
numpy
as
np
import
numpy.linalg
as
la
dim
=
100
A
=
np
.
random
.
rand
(
dim
,
dim
)
es
=
eigenpy
.
EigenSolver
(
A
)
V
=
es
.
eigenvectors
()
D
=
es
.
eigenvalues
()
assert
eigenpy
.
is_approx
(
A
.
dot
(
V
).
real
,
V
.
dot
(
np
.
diag
(
D
)).
real
)
assert
eigenpy
.
is_approx
(
A
.
dot
(
V
).
imag
,
V
.
dot
(
np
.
diag
(
D
)).
imag
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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