test_MINRES.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 A = np.eye(dim)
8 
9 minres = eigenpy.MINRES(A)
10 
11 X = rng.random((dim, 20))
12 B = A.dot(X)
13 X_est = minres.solve(B)
14 print("A.dot(X_est):", A.dot(X_est))
15 print("B:", B)
16 assert eigenpy.is_approx(A.dot(X_est), B, 1e-6)
print
void print(const Eigen::SparseMatrix< Scalar, Options > &mat)
Definition: sparse_matrix.cpp:50
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