From 0503e9d6ef88f43c9840897037a145f7a2b8f3f1 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 26 Aug 2019 00:16:45 -0700 Subject: [PATCH] Fix shift_with_mirror() for C-ordered arrays --- meanas/fdfd/operators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meanas/fdfd/operators.py b/meanas/fdfd/operators.py index e156d2e..13b2691 100644 --- a/meanas/fdfd/operators.py +++ b/meanas/fdfd/operators.py @@ -341,9 +341,7 @@ def shift_with_mirror(axis: int, shape: List[int], shift_distance: int=1) -> spa n = numpy.prod(shape) i_ind = numpy.arange(n) - j_ind = ijk[0] + ijk[1] * shape[0] - if len(shape) == 3: - j_ind += ijk[2] * shape[0] * shape[1] + j_ind = numpy.ravel_multi_index(ijk, shape, order='C') vij = (numpy.ones(n), (i_ind, j_ind.ravel(order='C')))