Skip to content

Commit

Permalink
Update xgi/linalg/laplacian_matrix.py
Browse files Browse the repository at this point in the history
Implement suggestion - Edge weight matrix

Co-authored-by: Maxime Lucas <[email protected]>
  • Loading branch information
kaiser-dan and maximelucas authored Jan 28, 2025
1 parent 4881074 commit 5de2a16
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions xgi/linalg/laplacian_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,8 @@ def normalized_hypergraph_laplacian(H, weights=None, sparse=True, index=False):
else:
Dv_invsqrt = np.diag(np.power(Dv, -0.5))

De_inv = np.diag(list(
map(
lambda x: 1/x,
np.sum(H_, axis=0)
)
))
De = np.sum(H_, axis=0)
De_inv = np.diag(1 / De)

if weights is not None:
W = np.diag(weights)
Expand Down

0 comments on commit 5de2a16

Please sign in to comment.