test_LLT.py
Go to the documentation of this file.
1 import eigenpy
2 
3 import numpy as np
4 
5 dim = 100
6 A = np.random.rand(dim, dim)
7 
8 A = (A + A.T) * 0.5 + np.diag(10.0 + np.random.rand(dim))
9 
10 llt = eigenpy.LLT(A)
11 
12 L = llt.matrixL()
13 assert eigenpy.is_approx(L.dot(np.transpose(L)), A)
14 
15 X = np.random.rand(dim, 20)
16 B = A.dot(X)
17 X_est = llt.solve(B)
18 assert eigenpy.is_approx(X, X_est)
19 assert eigenpy.is_approx(A.dot(X_est), B)
eigenpy::is_approx
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2)
Definition: is-approx.hpp:20


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Tue Jan 23 2024 03:15:01