Git Product home page Git Product logo

Comments (4)

mrhooray avatar mrhooray commented on May 19, 2024

So we already have nearest by count and within by radius, and the suggestion seems to be a combination of them.
Any thoughts how we can combine them with a flexible interface instead of adding another method?

Currently not actively working on this - if you're interested, a PR would be great!

from kdtree-rs.

exepulveda avatar exepulveda commented on May 19, 2024

If it is possible to modify the function signature (adding the new parameter) the modified function should be:

pub fn nearest<F>(
        &self,
        point: &[A],
        num: usize,
        radius: A,
        distance: &F,
    )

Not sure if a good idea to change the API. That was the reason to propose a new method instead. A simple solution could be implementing a new nearest_with_radius and the old nearest calls to nearest_with_radius to avoid code duplication:

pub fn nearest<F>(
        &self,
        point: &[A],
        num: usize,
        radius: A,
        distance: &F,
    ) -> Result<Vec<(A, &T)>, ErrorKind> {
   nearest_with_radius(self,point,num, A::infinity(), distance)
}

I can make PR but I want to discuss first with you the proposed solution.

from kdtree-rs.

mrhooray avatar mrhooray commented on May 19, 2024

Thanks @exepulveda I'm supportive of merging them into one interface - it'd be a breaking change & we will just follow semantic versioning bumping to 0.7

from kdtree-rs.

mrhooray avatar mrhooray commented on May 19, 2024

Closing stale issue. Please re-open as needed.

from kdtree-rs.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.