Skip to content

Commit f259f05

Browse files
committed
lanczos approximation not ready for use
1 parent 5daf47e commit f259f05

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

pygsp/filters/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
from math import log
43
from copy import deepcopy
54

65
import numpy as np
@@ -258,6 +257,7 @@ def synthesis(self, c, order=30, method=None, **kwargs):
258257
cheb_coeffs[i], c[i * N + tmpN])
259258

260259
elif method == 'lanczos':
260+
raise NotImplementedError
261261
s = np.zeros((N, np.shape(c)[1]))
262262
tmpN = np.arange(N, dtype=int)
263263

pygsp/tests/test_filters.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,30 @@ def setUpClass(cls):
2424
def tearDownClass(cls):
2525
pass
2626

27+
def _generate_coefficients(self, N, Nf, vertex_delta=83):
28+
S = np.zeros((N*Nf, Nf))
29+
S[vertex_delta] = 1
30+
for i in range(Nf):
31+
S[vertex_delta + i * self._G.N, i] = 1
32+
return S
33+
2734
def _test_synthesis(self, f):
2835
Nf = len(f.g)
2936
if 1 < Nf < 10:
30-
31-
vertex_delta = 83
32-
S = np.zeros((self._G.N * Nf, Nf))
33-
S[vertex_delta] = 1
34-
for i in range(Nf):
35-
S[vertex_delta + i * self._G.N, i] = 1
36-
37+
S = self._generate_coefficients(f.G.N, Nf)
3738
f.synthesis(S, method='cheby')
3839
f.synthesis(S, method='exact')
40+
self.assertRaises(NotImplementedError, f.synthesis, S,
41+
method='lanczos')
3942

4043
def _test_methods(self, f):
4144
self.assertIs(f.G, self._G)
4245

4346
f.analysis(self._signal, method='exact')
4447
f.analysis(self._signal, method='cheby')
48+
# TODO np.testing.assert_allclose(c_exact, c_cheby)
49+
self.assertRaises(NotImplementedError, f.analysis,
50+
self._signal, method='lanczos')
4551

4652
self._test_synthesis(f)
4753
f.evaluate(np.ones(10))

0 commit comments

Comments
 (0)