コード例 #1
0
def test_rand_float_matrix(A):
    assume(np.isfinite(A).all())
    M = Matrix(A)
    P = M @ M.pinv()
    Q = M.pinv() @ M
    assert P.is_sim(P @ P)
    assert Q.is_sim(Q @ Q)
コード例 #2
0
def test_rand_int_matrix(A):
    M = Matrix(A)
    P = M @ M.pinv()
    Q = M.pinv() @ M
    assert P.is_sim(P @ P)
    assert Q.is_sim(Q @ Q)