Exemple #1
0
def test_coo2csr_inplace_sort():
    "Cython structs : COO to CSR inplace (sorted)"
    for k in range(20):
        A = rand_dm(5,0.5).data
        B = A.tocoo()
        C = _test_coo2csr_inplace_struct(B, sorted = 1)
        assert_(not (A!=C).data.any())
Exemple #2
0
def test_coo2csr_inplace_sort():
    "Cython structs : COO to CSR inplace (sorted)"
    A = qutip.rand_dm(5, 0.5).data
    B = _test_coo2csr_inplace_struct(A.tocoo(), sorted=1)
    assert sparse_arrays_equal(A, B)