Exemplo n.º 1
0
 def test_hermitian_float64(self):
     # M < N
     a = np.array([[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12]], np.float64)
     a_gpu = gpuarray.to_gpu(a)
     at_gpu = linalg.hermitian(a_gpu)
     assert np.all(a.T == at_gpu.get())
     # M > N
     b = a.T.copy()
     b_gpu = gpuarray.to_gpu(b)
     bt_gpu = linalg.hermitian(b_gpu)
     assert np.all(b.T == bt_gpu.get())
Exemplo n.º 2
0
 def test_hermitian_complex128(self):
     # M < N
     a = np.array([[1j, 2j, 3j, 4j, 5j, 6j], [7j, 8j, 9j, 10j, 11j, 12j]],
                  np.complex128)
     a_gpu = gpuarray.to_gpu(a)
     at_gpu = linalg.hermitian(a_gpu)
     assert np.all(np.conj(a.T) == at_gpu.get())
     # M > N
     b = a.T.copy()
     b_gpu = gpuarray.to_gpu(b)
     bt_gpu = linalg.hermitian(b_gpu)
     assert np.all(np.conj(b.T) == bt_gpu.get())
Exemplo n.º 3
0
 def test_hermitian_complex128(self):
     # M < N
     a = np.array([[1j, 2j, 3j, 4j, 5j, 6j],
                   [7j, 8j, 9j, 10j, 11j, 12j]],
                  np.complex128)
     a_gpu = gpuarray.to_gpu(a)
     at_gpu = linalg.hermitian(a_gpu)
     assert np.all(np.conj(a.T) == at_gpu.get())
     # M > N
     b = a.T.copy()
     b_gpu = gpuarray.to_gpu(b)
     bt_gpu = linalg.hermitian(b_gpu)
     assert np.all(np.conj(b.T) == bt_gpu.get())
Exemplo n.º 4
0
 def test_hermitian_float64(self):
     # M < N
     a = np.array([[1, 2, 3, 4, 5, 6],
                   [7, 8, 9, 10, 11, 12]],
                  np.float64)
     a_gpu = gpuarray.to_gpu(a)
     at_gpu = linalg.hermitian(a_gpu)
     assert np.all(a.T == at_gpu.get())
     # M > N
     b = a.T.copy()
     b_gpu = gpuarray.to_gpu(b)
     bt_gpu = linalg.hermitian(b_gpu)
     assert np.all(b.T == bt_gpu.get())