File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,6 @@ SET_TESTS_PROPERTIES("py-self-adjoint-eigen-solver" PROPERTIES DEPENDS ${PYWRAP}
5757
5858ADD_PYTHON_UNIT_TEST("py-LLT" "unittest/python/test_LLT.py" "python/eigenpy" )
5959SET_TESTS_PROPERTIES ("py-LLT" PROPERTIES DEPENDS ${PYWRAP} )
60+
61+ ADD_PYTHON_UNIT_TEST("py-LDLT" "unittest/python/test_LDLT.py" "python/eigenpy" )
62+ SET_TESTS_PROPERTIES ("py-LDLT" PROPERTIES DEPENDS ${PYWRAP} )
Original file line number Diff line number Diff line change 1+ import eigenpy
2+ eigenpy .switchToNumpyArray ()
3+
4+ import numpy as np
5+ import numpy .linalg as la
6+
7+ dim = 100
8+ A = np .random .rand (dim ,dim )
9+
10+ A = (A + A .T )* 0.5 + np .diag (10. + np .random .rand (dim ))
11+
12+ ldlt = eigenpy .LDLT (A )
13+
14+ L = ldlt .matrixL ()
15+ D = ldlt .vectorD ()
16+ P = ldlt .transpositionsP ()
17+
18+ assert eigenpy .is_approx (np .transpose (P ).dot (L .dot (np .diag (D ).dot (np .transpose (L ).dot (P )))),A )
You can’t perform that action at this time.
0 commit comments