unittest
python
test_self_adjoint_eigen_solver.py
Go to the documentation of this file.
1
import
numpy
as
np
2
3
import
eigenpy
4
5
dim = 100
6
rng = np.random.default_rng()
7
8
A = rng.random((dim, dim))
9
A = (A + A.T) * 0.5
10
11
es = eigenpy.SelfAdjointEigenSolver(A)
12
13
V = es.eigenvectors()
14
D = es.eigenvalues()
15
16
assert
eigenpy.is_approx
(A.dot(V), V.dot(np.diag(D)), 1e-6)
eigenpy::is_approx
EIGEN_DONT_INLINE bool is_approx(const Eigen::SparseMatrixBase< MatrixType1 > &mat1, const Eigen::SparseMatrixBase< MatrixType2 > &mat2)
Definition:
is-approx.hpp:36
eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45