We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running
import xgi edges = [[0,1], [0,2], [1,2,3]] H = xgi.Hypergraph(edges)
yields
xgi.degree(H, order=3).shape ## --> (0,)
but it should be (4,), the number of nodes.
(4,)
This then yields an error when running xgi.laplacian(H, order=3), because it conflicts with the (correct) dimension of the adjacency matrix:
xgi.laplacian(H, order=3)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [16], in <cell line: 1>() ----> 1 xgi.laplacian(H, order=3).shape File ~/Dropbox (ISI Foundation)/WORK/SCIENCE/xgi/xgi/linalg/matrix.py:274, in laplacian(H, order, rescale_per_node, index) 270 return (np.array([]), {}) if index else np.array([]) 272 K = degree(H, order=order, index=False) --> 274 L = order * np.diag(np.ravel(K)) - A # ravel needed to convert sparse matrix 275 L = np.asarray(L) 277 if rescale_per_node: ValueError: operands could not be broadcast together with shapes (0,0) (4,4)
The text was updated successfully, but these errors were encountered:
fix: #74 wrong dimension for degree when no neighbours
9e4f0b5
fix: #74 wrong dimension for degree when no neighbours (#75)
66a0703
Successfully merging a pull request may close this issue.
Running
yields
but it should be
(4,)
, the number of nodes.This then yields an error when running
xgi.laplacian(H, order=3)
, because it conflicts with the (correct) dimension of the adjacency matrix:The text was updated successfully, but these errors were encountered: