You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/GridInterpolations.jl
+24-15
Original file line number
Diff line number
Diff line change
@@ -164,14 +164,21 @@ function interpolants(grid::RectangleGrid, x::AbstractVector)
164
164
weight =MVector{num_points, eltype(x)}(undef)
165
165
weight2 =MVector{num_points, eltype(x)}(undef)
166
166
167
-
# Note: these values are set explicitly because we have not verified that the logic below is independent of the initial values. See discussion in PR #47. These can be removed if it can be proved that the logic is independent of the initial values.
168
-
index .=1
169
-
index2 .=1
170
-
weight .=zero(eltype(weight))
171
-
weight2 .=zero(eltype(weight2))
167
+
# # Note: these values are set explicitly because we have not verified that the logic below is independent of the initial values. See discussion in PR #47. These can be removed if it can be proved that the logic is independent of the initial values.
168
+
for i in1:num_points
169
+
@inbounds index[i] =1
170
+
@inbounds index2[i] =1
171
+
@inbounds weight[i] =zero(eltype(x))
172
+
@inbounds weight2[i] =zero(eltype(x))
173
+
end
174
+
175
+
# index = @MVector ones(Int, num_points)
176
+
# index2 = @MVector ones(Int, num_points)
177
+
# weight = @MVector zeros(eltype(x), num_points)
178
+
# weight2 = @MVector zeros(eltype(x), num_points)
172
179
173
-
weight[1] =one(eltype(weight))
174
-
weight2[1] =one(eltype(weight2))
180
+
@inboundsweight[1] =one(eltype(weight))
181
+
@inboundsweight2[1] =one(eltype(weight2))
175
182
176
183
l =1
177
184
subblock_size =1
@@ -288,16 +295,18 @@ function interpolants(grid::SimplexGrid, x::AbstractVector)
288
295
# get weight
289
296
for i =1:(length(x_p)+1)
290
297
if i ==1
291
-
weight[i] =1- x_p[i]
298
+
@inboundsweight[i] =1- x_p[i]
292
299
elseif i ==length(x_p) +1
293
-
weight[i] = x_p[i-1]
300
+
@inboundsweight[i] = x_p[i-1]
294
301
else
295
-
weight[i] = x_p[i-1] - x_p[i]
302
+
@inboundsweight[i] = x_p[i-1] - x_p[i]
296
303
end
297
304
end
298
305
299
306
# get indices
300
-
fill!(index, 0)
307
+
for i in1:length(index)
308
+
@inbounds index[i] =0
309
+
end
301
310
i_index =0
302
311
for i =1:(length(x_p)+1)
303
312
siz =1
@@ -310,17 +319,17 @@ function interpolants(grid::SimplexGrid, x::AbstractVector)
0 commit comments