Skip to content

Commit 7906d11

Browse files
TST: Use fft() to compute the expected result of an rfft() test.
1 parent 63a4f61 commit 7906d11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numpy/fft/tests/test_pocketfft.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@ def test_rfft(self):
259259

260260
def test_rfft_even(self):
261261
x = np.arange(8)
262-
y = np.fft.rfft(x, 4)
263-
assert_allclose(y, [6.0, -2.0+2.0j, -2.0], rtol=1e-14)
262+
n = 4
263+
y = np.fft.rfft(x, n)
264+
assert_allclose(y, np.fft.fft(x[:n])[:n//2 + 1], rtol=1e-14)
264265

265266
def test_rfft_odd(self):
266267
x = np.array([1, 0, 2, 3, -3])

0 commit comments

Comments
 (0)