test_eigen_solver.py
Go to the documentation of this file.
1 import numpy as np
2 import eigenpy
3 
4 dim = 100
5 A = np.random.rand(dim, dim)
6 
7 es = eigenpy.EigenSolver(A)
8 
9 V = es.eigenvectors()
10 D = es.eigenvalues()
11 
12 assert eigenpy.is_approx(A.dot(V).real, V.dot(np.diag(D)).real)
13 assert eigenpy.is_approx(A.dot(V).imag, V.dot(np.diag(D)).imag)
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