diff --git a/docs/fftw3.html b/docs/fftw3.html
index 7b25756..082479b 100644
--- a/docs/fftw3.html
+++ b/docs/fftw3.html
@@ -969,7 +969,7 @@
-fftw_plan, fftw_r2r_kind, fftshift, ifftshift, circshift, J, get2DCoord, get3DCoord, K, get2DCoord, get3DCoord, I
+fftw_plan, fftw_r2r_kind, ifftshift, fftshift, circshift
@@ -979,7 +979,7 @@
- Made with Nim. Generated: 2021-02-03 11:06:17 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:49 UTC
diff --git a/docs/fftw3/fftshift.html b/docs/fftw3/fftshift.html
index 90c8107..75235d3 100644
--- a/docs/fftw3/fftshift.html
+++ b/docs/fftw3/fftshift.html
@@ -98,45 +98,16 @@ fftw3/fftshift
circshift,Tensor[T],seq[int]
-
-
-
-
-
-
@@ -152,57 +123,6 @@ fftw3/fftshift
-
-proc get2DCoord(index: int; Nx, Ny: int): array[2, int] {...}{.inline, raises: [],
- tags: [].}
--
-
-
-
-
-
-proc get3DCoord(index: int; Nx, Ny, Nz: int): array[3, int] {...}{.inline,
- raises: [], tags: [].}
--
-
-
-
-
-
-proc get2DCoord[T](index: int; t: Tensor[T]): array[2, int] {...}{.inline.}
--
-
-
-
-
-
-proc get3DCoord[T](index: int; t: Tensor[T]): array[3, int] {...}{.inline.}
--
-
-
-
-
-
-proc I(coord: openArray[int]): int {...}{.inline, raises: [], tags: [].}
--
-
-
-
-
-
-proc J(coord: openArray[int]): int {...}{.inline, raises: [], tags: [].}
--
-
-
-
-
-
-proc K(coord: openArray[int]): int {...}{.inline, raises: [], tags: [].}
--
-
-
-
-
proc circshift[T](t: Tensor[T]; shift: seq[int]): Tensor[T]
-
@@ -244,7 +164,7 @@
- Made with Nim. Generated: 2021-02-03 11:06:15 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:47 UTC
diff --git a/docs/fftw3/fftshift.idx b/docs/fftw3/fftshift.idx
index bfacdd0..14f74fc 100644
--- a/docs/fftw3/fftshift.idx
+++ b/docs/fftw3/fftshift.idx
@@ -1,10 +1,3 @@
-get2DCoord fftw3/fftshift.html#get2DCoord,int,int,int fftshift: get2DCoord(index: int; Nx, Ny: int): array[2, int]
-get3DCoord fftw3/fftshift.html#get3DCoord,int,int,int,int fftshift: get3DCoord(index: int; Nx, Ny, Nz: int): array[3, int]
-get2DCoord fftw3/fftshift.html#get2DCoord,int,Tensor[T] fftshift: get2DCoord[T](index: int; t: Tensor[T]): array[2, int]
-get3DCoord fftw3/fftshift.html#get3DCoord,int,Tensor[T] fftshift: get3DCoord[T](index: int; t: Tensor[T]): array[3, int]
-I fftw3/fftshift.html#I,openArray[int] fftshift: I(coord: openArray[int]): int
-J fftw3/fftshift.html#J,openArray[int] fftshift: J(coord: openArray[int]): int
-K fftw3/fftshift.html#K,openArray[int] fftshift: K(coord: openArray[int]): int
circshift fftw3/fftshift.html#circshift,Tensor[T],seq[int] fftshift: circshift[T](t: Tensor[T]; shift: seq[int]): Tensor[T]
fftshift fftw3/fftshift.html#fftshift,Tensor[T] fftshift: fftshift[T](t: Tensor[T]): Tensor[T]
ifftshift fftw3/fftshift.html#ifftshift,Tensor[T] fftshift: ifftshift[T](t: Tensor[T]): Tensor[T]
diff --git a/docs/fftw3/guru.html b/docs/fftw3/guru.html
index 15c460d..f0dbc1c 100644
--- a/docs/fftw3/guru.html
+++ b/docs/fftw3/guru.html
@@ -440,7 +440,7 @@
- Made with Nim. Generated: 2021-02-03 11:06:13 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:44 UTC
diff --git a/docs/fftw3/libutils.html b/docs/fftw3/libutils.html
index 8c7de51..0b5371a 100644
--- a/docs/fftw3/libutils.html
+++ b/docs/fftw3/libutils.html
@@ -433,7 +433,7 @@
- Made with Nim. Generated: 2021-02-03 11:06:13 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:44 UTC
diff --git a/docs/fftw3/wisdom.html b/docs/fftw3/wisdom.html
index 821d965..495deae 100644
--- a/docs/fftw3/wisdom.html
+++ b/docs/fftw3/wisdom.html
@@ -259,7 +259,7 @@
- Made with Nim. Generated: 2021-02-03 11:06:13 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:44 UTC
diff --git a/docs/theindex.html b/docs/theindex.html
index 007aec9..25bf7e3 100644
--- a/docs/theindex.html
+++ b/docs/theindex.html
@@ -676,34 +676,10 @@ Index
libutils: fftw_write_char_func
-get2DCoord:
-get3DCoord:
-I:
ifftshift:
-J:
-K:
ptrdiff_t:
- libutils: ptrdiff_t
@@ -717,7 +693,7 @@ Index
- Made with Nim. Generated: 2021-02-03 11:06:17 UTC
+ Made with Nim. Generated: 2021-02-03 11:12:49 UTC
diff --git a/src/fftw3/fftshift.nim b/src/fftw3/fftshift.nim
index 6dcec40..83b031c 100644
--- a/src/fftw3/fftshift.nim
+++ b/src/fftw3/fftshift.nim
@@ -1,15 +1,14 @@
import arraymancer
import arraymancer/tensor/private/p_accessors
-
import sequtils
-proc get2DCoord*(index: int, Nx, Ny: int): array[2, int] {.inline.} =
+proc get2DCoord(index: int, Nx, Ny: int): array[2, int] {.inline.} =
var index = index
result[0] = index div Ny
index = index - result[0]*Ny
result[1] = index
-proc get3DCoord*(index: int, Nx, Ny, Nz: int): array[3, int] {.inline.} =
+proc get3DCoord(index: int, Nx, Ny, Nz: int): array[3, int] {.inline.} =
var index = index
result[0] = index div (Nz*Ny)
index = index - result[0]*Nz*Ny
@@ -17,26 +16,26 @@ proc get3DCoord*(index: int, Nx, Ny, Nz: int): array[3, int] {.inline.} =
index = index - result[1]*Nz
result[2] = index
-proc get2DCoord*[T](index: int, t: Tensor[T]): array[2, int] {.inline.} =
+proc get2DCoord[T](index: int, t: Tensor[T]): array[2, int] {.inline.} =
doAssert t.rank == 2
let Nx = t.shape[0]
let Ny = t.shape[1]
result = get2DCoord(index, Nx, Ny)
-proc get3DCoord*[T](index: int, t: Tensor[T]): array[3, int] {.inline.} =
+proc get3DCoord[T](index: int, t: Tensor[T]): array[3, int] {.inline.} =
doAssert t.rank == 3
let Nx = t.shape[0]
let Ny = t.shape[1]
let Nz = t.shape[2]
result = get3DCoord(index, Nx, Ny, Nz)
-proc I*(coord: openArray[int]): int {.inline.} =
+proc I(coord: openArray[int]): int {.inline.} =
return coord[0]
-proc J*(coord: openArray[int]): int {.inline.} =
+proc J(coord: openArray[int]): int {.inline.} =
return coord[1]
-proc K*(coord: openArray[int]): int {.inline.} =
+proc K(coord: openArray[int]): int {.inline.} =
return coord[2]
# FFT Shift
@@ -55,14 +54,6 @@ proc circshift_impl[T](t: Tensor[T], xshift: int, yshift: int, zshift: int): Ten
kk = (coord.K + xshift) mod X
result[ii, jj, kk] = t[coord.I, coord.J, coord.K]
- # for i in 0||(X-1):
- # var ii = (i + xshift) mod X
- # for j in 0||(Y-1):
- # var jj = (j + yshift) mod Y
- # for k in 0||(Z-1):
- # var kk = (k + zshift) mod Z
- # result[ii, jj, kk] = t[i, j, k]
-
proc circshift_impl[T](t: Tensor[T], xshift: int, yshift: int): Tensor[T] =
assert(t.rank == 2)
let
@@ -76,12 +67,6 @@ proc circshift_impl[T](t: Tensor[T], xshift: int, yshift: int): Tensor[T] =
jj = (coord.J + xshift) mod X
result[ii, jj] = t[coord.I, coord.J]
- # for i in 0||(X-1):
- # var ii = (i + xshift) mod X
- # for j in 0||(Y-1):
- # var jj = (j + yshift) mod Y
- # result[ii, jj] = t[i, j]
-
proc circshift_impl[T](t: Tensor[T], xshift: int): Tensor[T] =
assert(t.rank == 1)
var X = t.shape[0]