def test_matrix_init_without_type(): mx = Matrix.sparse(INT8) # get a raw Matrix pointer and wrap it without knowing its type new_mx = ffi.new("GrB_Matrix*") _check(lib.GrB_Matrix_dup(new_mx, mx._matrix[0])) mx2 = Matrix(new_mx) assert mx.type == mx2.type
def test_vector_init_without_type(): vec = Vector.sparse(INT8) # get a raw Vector pointer and wrap it without knowing its type new_vec = ffi.new('GrB_Vector*') _check(lib.GrB_Vector_dup(new_vec, vec.vector[0])) vec2 = Vector(new_vec) assert vec.type == vec2.type