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
functioncompute_bbox(data::AbstractVector{V}) where {V <:AbstractVector}
mins =mapreduce(identity, (a, b) ->min.(a, b), data; init=fill(Inf,V))
maxes =mapreduce(identity, (a, b) ->max.(a, b), data; init=fill(-Inf,V))
returnHyperRectangle(mins, maxes)
end
results in Vector not V. IIUC it should be sth like
functioncompute_bbox(data::AbstractVector{V}) where {V <:AbstractVector}
mins =mapreduce(identity, (a, b) ->V(min.(a, b)), data; init=fill(Inf,V))
maxes =mapreduce(identity, (a, b) ->V(max.(a, b)), data; init=fill(-Inf,V))
returnHyperRectangle(mins, maxes)
end
*Not sure about performance tho, it's just a quick simple fix *
However, even after preserving the type V here setindex is used in many places which is only defined for <:StaticArray IIRC.
If this is an actual issue not just me misusing the interface I believe we can either solve it by checking for immutability like:
or maybe have setindex dispatched for Vector?
also, IIUC neither setindex nor setindex! is defined for Tensor. So if the goal was to retain V maybe we need to dispatch setindex for Vec.
For now the simplest workaround I use locally is
functioncompute_bbox(data::AbstractVector{V}) where {V <:AbstractVector}
mins =mapreduce(identity, (a, b) ->min.(a, b), data; init=fill(Inf,V))
maxes =mapreduce(identity, (a, b) ->max.(a, b), data; init=fill(-Inf,V))
returnHyperRectangle(SVector{length(mins)}(mins), SVector{length(maxes)}(maxes))
end
Thanks!
The text was updated successfully, but these errors were encountered:
Last release broke something in
PointEvalHandler
in Ferrite.jl, I noticed that from CI in termi-official/Thunderbolt.jl#153MWE:
It seems like broadcasting in
NearestNeighbors.jl/src/hyperrectangles.jl
Lines 6 to 10 in a20c107
results in
Vector
notV
. IIUC it should be sth like*Not sure about performance tho, it's just a quick simple fix *
However, even after preserving the type
V
heresetindex
is used in many places which is only defined for<:StaticArray
IIRC.If this is an actual issue not just me misusing the interface I believe we can either solve it by checking for immutability like:
or maybe have
setindex
dispatched forVector
?also, IIUC neither
setindex
norsetindex!
is defined forTensor
. So if the goal was to retainV
maybe we need to dispatchsetindex
forVec
.For now the simplest workaround I use locally is
Thanks!
The text was updated successfully, but these errors were encountered: