Skip to content

Commit e31e0ed

Browse files
authored
non-copying operation to improve speed for large matrices (useful for 3D simulation) (#269)
1 parent 9f57fbb commit e31e0ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kwave/utils/matlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def matlab_assign(matrix: np.ndarray, indices: Union[int, np.ndarray],
4747
4848
"""
4949
original_shape = matrix.shape
50-
matrix = matrix.flatten(order='F')
50+
matrix = np.ravel(matrix, order='F')
5151
matrix[indices] = values
5252
return matrix.reshape(original_shape, order='F')
5353

0 commit comments

Comments
 (0)