test_self_adjoint_eigen_solver.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 A = (A + A.T) * 0.5
8 
9 es = eigenpy.SelfAdjointEigenSolver(A)
10 
11 V = es.eigenvectors()
12 D = es.eigenvalues()
13 
14 assert eigenpy.is_approx(A.dot(V), V.dot(np.diag(D)), 1e-6)
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 Fri Jun 2 2023 02:10:26