In #166 the HyperRectangle struct was changed to use the same vector type as the input data for the mins and maxes, and to use StaticArrays.setindex for "mutation". Since this function is not implemented for all working input types (for example Tensors.Vec) there was an MethodError thrown. This patch adds NearestNeighbors.setindex which dispatches to StaticArrays.setindex for <: StaticArray.StaticArray and for other types casts to SVector and then back to the original type after mutating.
Thanks, I thought about just making the HyperRectangle contain SVectors but then I would have to add another parameter to the tree type which felt bad.
In #166 the
HyperRectangle
struct was changed to use the same vector type as the input data for the mins and maxes, and to useStaticArrays.setindex
for "mutation". Since this function is not implemented for all working input types (for exampleTensors.Vec
) there was anMethodError
thrown. This patch addsNearestNeighbors.setindex
which dispatches toStaticArrays.setindex
for<: StaticArray.StaticArray
and for other types casts toSVector
and then back to the original type after mutating.