Skip to content

Commit 87b1924

Browse files
author
ioannisPApapadopoulos
committed
type-inference
1 parent 16b6f43 commit 87b1924

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/arrays.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function *(P::NDimsPlan, f::AbstractArray)
7171
g = copy(f)
7272
t = 1:ndims(g)
7373
for d in dims
74-
perm = ntuple(k -> k == 1 ? t[d] : k == d ? t[1] : t[k], length(t))
74+
perm = ntuple(k -> k == 1 ? t[d] : k == d ? t[1] : t[k], ndims(g))
7575
gp = permutedims(g, perm)
7676
g = permutedims(F*gp, inv_perm(perm))
7777
end
@@ -84,7 +84,7 @@ function \(P::NDimsPlan, f::AbstractArray)
8484
g = copy(f)
8585
t = 1:ndims(g)
8686
for d in dims
87-
perm = ntuple(k -> k == 1 ? t[d] : k == d ? t[1] : t[k], length(t))
87+
perm = ntuple(k -> k == 1 ? t[d] : k == d ? t[1] : t[k], ndims(g))
8888
gp = permutedims(g, perm)
8989
g = permutedims(F\gp, inv_perm(perm))
9090
end

test/arraystests.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import FastTransforms: ArrayPlan, NDimsPlan
3131
c = randn(20,10,20)
3232
@test_throws ErrorException("Different size in dims axes not yet implemented in N-dimensional transform.") NDimsPlan(ArrayPlan(plan_cheb2leg(c), c), (1,2))
3333

34+
c = randn(5,20)
35+
F = plan_cheb2leg(c)
36+
FT = ArrayPlan(F, c)
37+
P = NDimsPlan(FT, (1,))
38+
@test F*c FT*c P*c
39+
3440
c = randn(20,20,5);
3541
F = plan_cheb2leg(c)
3642
FT = ArrayPlan(F, c)
@@ -40,7 +46,6 @@ import FastTransforms: ArrayPlan, NDimsPlan
4046
@test size(P,1) == size(c,1)
4147
@test size(P,1,2) == (size(c,1), size(c,2))
4248

43-
4449
f = similar(c);
4550
for k in axes(f,3)
4651
f[:,:,k] = (F*(F*c[:,:,k])')'

0 commit comments

Comments
 (0)