def test_similar_output_to_naive_mat_3(self):
mat = scipy.io.loadmat('bcspwr01.mat')
# I love the UFSMC (https://www.cise.ufl.edu/research/sparse/matrices/)
# but wow they really buried the matrix in this .mat
A = mat['Problem'][0][0][1].todense()
G = nx.from_numpy_matrix(A)
G3 = graphpca.reduce_graph_efficiently(G, 3)
G3n = graphpca.reduce_graph_naively(G, 3)
self.assertTrue(np.allclose(G3, G3n, rtol=1e-04, atol=1e-06),
'Regular result:\n{}\nNaive result:\n{}\n'.format(G3, G3n))
评论列表
文章目录