示例#1
0
 def test_trapz_complex128(self):
     x = np.asarray(np.random.rand(10)+1j*np.random.rand(10), np.complex128)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     assert np.allclose(np.trapz(x), z)
示例#2
0
 def test_trapz_float64(self):
     x = np.asarray(np.random.rand(10), np.float64)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     assert np.allclose(np.trapz(x), z)
示例#3
0
 def test_trapz_complex64(self):
     x = np.asarray(np.random.rand(10)+1j*np.random.rand(10), np.complex64)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     np.testing.assert_allclose(np.trapz(x), z)
示例#4
0
 def test_trapz_float32(self):
     x = np.asarray(np.random.rand(10), np.float32)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     np.testing.assert_allclose(np.trapz(x), z)
示例#5
0
 def test_trapz_complex64(self):
     x = np.asarray(
         np.random.rand(10) + 1j * np.random.rand(10), np.complex64)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     np.testing.assert_allclose(np.trapz(x), z)
示例#6
0
 def test_trapz_float32(self):
     x = np.asarray(np.random.rand(10), np.float32)
     x_gpu = gpuarray.to_gpu(x)
     z = integrate.trapz(x_gpu)
     np.testing.assert_allclose(np.trapz(x), z)