Skip to content

Commit 046a51b

Browse files
at least two indexes
1 parent d4e854f commit 046a51b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/gather.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ julia> gather(src, [1, 2], [2, 4])
108108
11
109109
```
110110
"""
111-
function gather(src::AbstractArray{Tsrc, Nsrc},
112-
IJK::AbstractVector{<:Integer}...) where {Nsrc, Tsrc}
111+
function gather(src::AbstractArray{Tsrc, Nsrc},
112+
I::AbstractVector{<:Integer},
113+
J::AbstractVector{<:Integer},
114+
Ks::AbstractVector{<:Integer}...) where {Nsrc, Tsrc}
113115

114-
return gather(src, to_cartesian_index(IJK))
116+
return gather(src, to_cartesian_index(I, J, Ks...))
115117
end
116118

117-
to_cartesian_index(IJK) = CartesianIndex.(IJK...)
119+
to_cartesian_index(IJK...) = CartesianIndex.(IJK...)
118120

119-
@non_differentiable to_cartesian_index(idx::AbstractVector{<:Integer}...)
121+
@non_differentiable to_cartesian_index(::Any...)

0 commit comments

Comments
 (0)