From e31e0edac9a85f62f8620baf49d5554a0d442b9d Mon Sep 17 00:00:00 2001 From: Guillermo Valle Date: Thu, 18 Jan 2024 19:09:37 +0000 Subject: [PATCH] non-copying operation to improve speed for large matrices (useful for 3D simulation) (#269) --- kwave/utils/matlab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kwave/utils/matlab.py b/kwave/utils/matlab.py index 2e040157..c23d4e67 100644 --- a/kwave/utils/matlab.py +++ b/kwave/utils/matlab.py @@ -47,7 +47,7 @@ def matlab_assign(matrix: np.ndarray, indices: Union[int, np.ndarray], """ original_shape = matrix.shape - matrix = matrix.flatten(order='F') + matrix = np.ravel(matrix, order='F') matrix[indices] = values return matrix.reshape(original_shape, order='F')