test_LDLT.py
Go to the documentation of this file.
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)
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2)
Definition: is-approx.hpp:21


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Apr 17 2021 02:37:59