Main Page
Namespaces
Classes
Files
File List
File Members
unittest
python
test_eigen_solver.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
es = eigenpy.EigenSolver(A)
11
12
V = es.eigenvectors()
13
D = es.eigenvalues()
14
15
assert
eigenpy.is_approx
(A.dot(V).real,V.dot(np.diag(D)).real)
16
assert
eigenpy.is_approx
(A.dot(V).imag,V.dot(np.diag(D)).imag)
eigenpy::is_approx
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