def test_concatenate_int32_overflow(self): """ test for indptr overflow when concatenating matrices """ check_free_memory(30000) n = 33000 A = csr_matrix(np.ones((n, n), dtype=bool)) B = A.copy() C = construct._compressed_sparse_stack((A, B), 0) assert_(np.all(np.equal(np.diff(C.indptr), n))) assert_equal(C.indices.dtype, np.int64) assert_equal(C.indptr.dtype, np.int64)
def test_concatenate_int32_overflow(self): """ test for indptr overflow when concatenating matrices """ check_free_memory(30000) n = 33000 A = csr_matrix(np.ones((n, n), dtype=bool)) B = A.copy() C = construct._compressed_sparse_stack((A,B), 0) assert_(np.all(np.equal(np.diff(C.indptr), n))) assert_equal(C.indices.dtype, np.int64) assert_equal(C.indptr.dtype, np.int64)