Skip to content

Commit

Permalink
Automatically set lmin, lmax for RingGraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Hale committed Jul 11, 2024
1 parent 72368ad commit a1f1c61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="sgw_tools",
version="2.5.4",
version="2.5.5",
author="Mark Hale",
license="MIT",
description="Spectral graph wavelet tools",
Expand Down
2 changes: 2 additions & 0 deletions sgw_tools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def compute_fourier_basis(self, recompute=False, spectrum_only=False):
if not N&1: # bipartite
self._e[-1] = 2
self._e[0] = 0
self._lmin = self._e[1]
self._lmax = self._e[-1]

if not spectrum_only:
# eigenvectors are identical for normalized/adjacency and combinatorial Laplacians
Expand Down
1 change: 1 addition & 0 deletions tests/test_biggraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def _test_ring(self, n=20, lap_type='combinatorial'):
expected_evals = scipy.linalg.eigh(graph.L.toarray(), eigvals_only=True)
expected_evals[0] = 0
np.testing.assert_allclose(graph.e, expected_evals)
self.assertEqual(graph.lmax, np.max(graph.e))
# check eigenvectors
L = graph.L
U = graph.U
Expand Down

0 comments on commit a1f1c61

Please sign in to comment.