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)
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2)
Definition: is-approx.hpp:20
void print(const Tensor &tensor)
Definition: tensor.cpp:35


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 2 2023 02:10:26