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
21f4ebf8
Verified
Commit
21f4ebf8
authored
Jan 29, 2020
by
Justin Carpentier
Browse files
test: add test for Eigen::LDLT
parent
775a1b70
Changes
2
Hide whitespace changes
Inline
Side-by-side
unittest/CMakeLists.txt
View file @
21f4ebf8
...
...
@@ -57,3 +57,6 @@ SET_TESTS_PROPERTIES("py-self-adjoint-eigen-solver" PROPERTIES DEPENDS ${PYWRAP}
ADD_PYTHON_UNIT_TEST
(
"py-LLT"
"unittest/python/test_LLT.py"
"python/eigenpy"
)
SET_TESTS_PROPERTIES
(
"py-LLT"
PROPERTIES DEPENDS
${
PYWRAP
}
)
ADD_PYTHON_UNIT_TEST
(
"py-LDLT"
"unittest/python/test_LDLT.py"
"python/eigenpy"
)
SET_TESTS_PROPERTIES
(
"py-LDLT"
PROPERTIES DEPENDS
${
PYWRAP
}
)
unittest/python/test_LDLT.py
0 → 100644
View file @
21f4ebf8
import
eigenpy
eigenpy
.
switchToNumpyArray
()
import
numpy
as
np
import
numpy.linalg
as
la
dim
=
100
A
=
np
.
random
.
rand
(
dim
,
dim
)
A
=
(
A
+
A
.
T
)
*
0.5
+
np
.
diag
(
10.
+
np
.
random
.
rand
(
dim
))
ldlt
=
eigenpy
.
LDLT
(
A
)
L
=
ldlt
.
matrixL
()
D
=
ldlt
.
vectorD
()
P
=
ldlt
.
transpositionsP
()
assert
eigenpy
.
is_approx
(
np
.
transpose
(
P
).
dot
(
L
.
dot
(
np
.
diag
(
D
).
dot
(
np
.
transpose
(
L
).
dot
(
P
)))),
A
)
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