inducer / pymetis

A Python wrapper around Metis, a graph partitioning package
http://mathema.tician.de/software/pymetis
Other
164 stars 32 forks source link

Fixed nested_dissection method #8

Closed cathywu closed 8 years ago

cathywu commented 8 years ago

small fix, nested_dissection doesn't actually use the computed adjncy…; resolves #7

cathywu commented 8 years ago

Testing done:

import scipy.sparse
import numpy as np
import pymetis

F = scipy.sparse.rand(100, 100, density=0.005)
M = F.transpose() * F
adjacency_list = [M.getrow(i).indices for i in range(M.shape[0])]
node_nd = pymetis.nested_dissection(adjacency=adjacency_list)
perm, iperm = np.array(node_nd[0]), np.array(node_nd[1])

assert np.all(perm[iperm] == np.array(range(perm.size)))

The above gives no errors.

inducer commented 8 years ago

Thanks!

inducer commented 8 years ago

I've also added the test you provided. Thanks for that as well.