def test_ihfftn(self): x = random((30, 20, 10)) expect = fft.ifftn(x)[:, :, :6] assert_array_almost_equal(expect, fft.ihfftn(x)) assert_array_almost_equal(expect, fft.ihfftn(x, norm="backward")) assert_array_almost_equal(expect * np.sqrt(30 * 20 * 10), fft.ihfftn(x, norm="ortho")) assert_array_almost_equal(expect * (30 * 20 * 10), fft.ihfftn(x, norm="forward"))
def test_ihfftn(self): x = random((30, 20, 10)) assert_array_almost_equal(fft.ifftn(x)[:, :, :6], fft.ihfftn(x)) assert_array_almost_equal(fft.ihfftn(x) * np.sqrt(30 * 20 * 10), fft.ihfftn(x, norm="ortho"))
def test_hfftn(self): x = random((30, 20, 10)) assert_array_almost_equal(x, fft.hfftn(fft.ihfftn(x))) assert_array_almost_equal( x, fft.hfftn(fft.ihfftn(x, norm="ortho"), norm="ortho"))
def test_hfftn(self): x = random((30, 20, 10)) assert_array_almost_equal(x, fft.hfftn(fft.ihfftn(x))) for norm in ["backward", "ortho", "forward"]: assert_array_almost_equal( x, fft.hfftn(fft.ihfftn(x, norm=norm), norm=norm))