matfree.test_util
matfree.test_util
Test utilities.
matfree.test_util.assert_allclose(a, b)
Assert that two arrays are close.
This function uses a different default tolerance to jax.numpy.allclose. Instead of fixing values, the tolerance depends on the floating-point precision of the input variables.
Source code in matfree/test_util.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
matfree.test_util.assert_columns_orthonormal(Q)
Assert that the columns in a matrix are orthonormal.
Source code in matfree/test_util.py
55 56 57 58 59 |
|
matfree.test_util.asymmetric_matrix_from_singular_values(vals, /, nrows, ncols)
Generate an asymmetric matrix with specific singular values.
Source code in matfree/test_util.py
25 26 27 28 29 30 |
|
matfree.test_util.symmetric_matrix_from_eigenvalues(eigvals)
Generate a symmetric matrix with prescribed eigenvalues.
Source code in matfree/test_util.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
matfree.test_util.to_dense_bidiag(d, e, /, offset=1)
Materialize a bidiagonal matrix.
Source code in matfree/test_util.py
33 34 35 36 37 |
|
matfree.test_util.to_dense_tridiag_sym(d, e)
Materialize a symmetric tridiagonal matrix.
Source code in matfree/test_util.py
40 41 42 43 44 45 |
|
matfree.test_util.tree_random_like(key, pytree, *, generate_func=prng.normal)
Fill a tree with random values.
Source code in matfree/test_util.py
48 49 50 51 52 |
|