unittest
python
test_MINRES.py
Go to the documentation of this file.
1
import
eigenpy
2
import
numpy
as
np
3
4
dim = 100
5
A = np.eye(dim)
6
7
minres = eigenpy.MINRES(A)
8
9
X = np.random.rand(dim, 20)
10
B = A.dot(X)
11
X_est = minres.solve(B)
12
print
(
"A.dot(X_est):"
, A.dot(X_est))
13
print
(
"B:"
, B)
14
assert
eigenpy.is_approx
(A.dot(X_est), B, 1e-6)
eigenpy::is_approx
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2)
Definition:
is-approx.hpp:20
print
void print(const Tensor &tensor)
Definition:
tensor.cpp:35
eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Tue Jan 23 2024 03:15:01