Verified Commit c775c555 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: test LLT

parent da1e7b30
......@@ -54,3 +54,6 @@ SET_TESTS_PROPERTIES("py-eigen-solver" PROPERTIES DEPENDS ${PYWRAP})
ADD_PYTHON_UNIT_TEST("py-self-adjoint-eigen-solver" "unittest/python/test_self_adjoint_eigen_solver.py" "python/eigenpy")
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})
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))
llt = eigenpy.LLT(A)
L = llt.matrixL()
assert eigenpy.is_approx(L.dot(np.transpose(L)),A)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment