@@ -102,55 +102,55 @@ function scatter end
102
102
103
103
for op in [+ , - ]
104
104
@eval function scatter (op:: typeof ($ op),
105
- src:: AbstractArray{T ,Nsrc} ,
106
- idx:: AbstractArray{<:IntOrIntTuple ,Nidx} ) where {T ,Nsrc,Nidx}
105
+ src:: AbstractArray{Tsrc ,Nsrc} ,
106
+ idx:: AbstractArray{Tidx ,Nidx} ) where {Tsrc,Tidx ,Nsrc,Nidx}
107
107
dims = Nsrc - Nidx
108
108
dstsize = (size (src)[1 : dims]. .. , maximum_dims (idx)... )
109
- dst = similar (src, T , dstsize)
110
- fill! (dst, Base. reduce_empty (+ , T ))
109
+ dst = similar (src, Tsrc , dstsize)
110
+ fill! (dst, Base. reduce_empty (+ , Tsrc ))
111
111
scatter! (op, dst, src, idx)
112
112
end
113
113
end
114
114
115
115
for op in [* , / ]
116
116
@eval function scatter (op:: typeof ($ op),
117
- src:: AbstractArray{T ,Nsrc} ,
118
- idx:: AbstractArray{<:IntOrIntTuple ,Nidx} ) where {T ,Nsrc,Nidx}
117
+ src:: AbstractArray{Tsrc ,Nsrc} ,
118
+ idx:: AbstractArray{Tidx ,Nidx} ) where {Tsrc,Tidx ,Nsrc,Nidx}
119
119
dims = Nsrc - Nidx
120
120
dstsize = (size (src)[1 : dims]. .. , maximum_dims (idx)... )
121
- dst = similar (src, T , dstsize)
122
- fill! (dst, Base. reduce_empty (* , T ))
121
+ dst = similar (src, Tsrc , dstsize)
122
+ fill! (dst, Base. reduce_empty (* , Tsrc ))
123
123
scatter! (op, dst, src, idx)
124
124
end
125
125
end
126
126
127
127
function scatter (op:: typeof (max),
128
- src:: AbstractArray{T ,Nsrc} ,
129
- idx:: AbstractArray{<:IntOrIntTuple ,Nidx} ) where {T ,Nsrc,Nidx}
128
+ src:: AbstractArray{Tsrc ,Nsrc} ,
129
+ idx:: AbstractArray{Tidx ,Nidx} ) where {Tsrc,Tidx ,Nsrc,Nidx}
130
130
dims = Nsrc - Nidx
131
131
dstsize = (size (src)[1 : dims]. .. , maximum_dims (idx)... )
132
- dst = similar (src, T , dstsize)
133
- fill! (dst, typemin (T ))
132
+ dst = similar (src, Tsrc , dstsize)
133
+ fill! (dst, typemin (Tsrc ))
134
134
scatter! (op, dst, src, idx)
135
135
end
136
136
137
137
function scatter (op:: typeof (min),
138
- src:: AbstractArray{T ,Nsrc} ,
139
- idx:: AbstractArray{<:IntOrIntTuple ,Nidx} ) where {T ,Nsrc,Nidx}
138
+ src:: AbstractArray{Tsrc ,Nsrc} ,
139
+ idx:: AbstractArray{Tidx ,Nidx} ) where {Tsrc,Tidx ,Nsrc,Nidx}
140
140
dims = Nsrc - Nidx
141
141
dstsize = (size (src)[1 : dims]. .. , maximum_dims (idx)... )
142
- dst = similar (src, T , dstsize)
143
- fill! (dst, typemax (T ))
142
+ dst = similar (src, Tsrc , dstsize)
143
+ fill! (dst, typemax (Tsrc ))
144
144
scatter! (op, dst, src, idx)
145
145
end
146
146
147
147
function scatter (op:: typeof (mean),
148
- src:: AbstractArray{T ,Nsrc} ,
149
- idx:: AbstractArray{<:IntOrIntTuple ,Nidx} ) where {T ,Nsrc,Nidx}
150
- FT = float (T )
148
+ src:: AbstractArray{Tsrc ,Nsrc} ,
149
+ idx:: AbstractArray{Tidx ,Nidx} ) where {Tsrc,Tidx ,Nsrc,Nidx}
150
+ FT = float (Tsrc )
151
151
dims = Nsrc - Nidx
152
152
dstsize = (size (src)[1 : dims]. .. , maximum_dims (idx)... )
153
- dst = similar (src, T , dstsize)
153
+ dst = similar (src, Tsrc , dstsize)
154
154
fill! (dst, Base. reduce_empty (+ , FT))
155
155
scatter! (op, dst, src, idx)
156
156
end
0 commit comments