test_input_A.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:PyPardisoProject 作者: haasad 项目源码 文件源码
def test_input_A_dtypes():
    A, b = create_test_A_b_rand(10,0.5)
    for d in [np.float16, np.float32, np.int16, np.int32, np.int64, np.complex64, 
              np.complex128, np.complex128, np.uint16, np.uint32, np.uint64]:
        with pytest.raises(TypeError):
            ps.solve(A.astype(d), b)


#def test_input_A_empty_col():
#    A, b = create_test_A_b_rand(25, 0.1)
#    A = np.array(A.todense())
#    A[0,:] = 0
#    A[:,0] = 0
#    A[0, 1] = 1
#    Asp = sp.csr_matrix(A)
#    with pytest.warns(PyPardisoWarning):
#        x = ps.solve(A,b)
#        print(x)

# dosen't necessarily return inf value, can also be just really big
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号