Bersaelor / KDTree

Swift implementation of a k-dimensional binary space partitioning tree.
MIT License
153 stars 26 forks source link

added proposal for dimensionOverride #54

Closed AlexDM0 closed 2 years ago

AlexDM0 commented 4 years ago

Pull request based on issue #53

This will allow a user to sidestep the dimensions provided in the datapoint type definitions. This is used if the data dimension is not known at compile time, and there is a requirement for multiple trees. (In the case of 1 tree, we can set the dimensions of the type before starting the tree).

I have added it as an optional argument everywhere to keep the existing API the same. All tests pass.

It is not the prettiest, and it is up to the user to ENSURE that they provide this argument everywhere when they use this feature.

Bersaelor commented 4 years ago

@AlexDM0 you might have to merge the latest master branch into your branch, so the tests can run properly.

AlexDM0 commented 4 years ago

Seems to work after the merge :)

Bersaelor commented 2 years ago

Sorry @AlexDM0 was too busy with a lot of other things and completely forgot about this.

AlexDM0 commented 2 years ago

No problem! Will you close the corresponding issue or shall I? Cheers