GithubHelp home page GithubHelp logo

kdtree's People

Contributors

almaraubel avatar codeandcats avatar nathan-c avatar robthree avatar tinohager avatar ufcpp avatar youssef1313 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kdtree's Issues

Add TypeMath for basic types

I was surprized by lack of default DoubleMath implementation. Maybe it should be added and registered by default, and maybe we need some another generic way to define instances for all the standard number types without duplicating the code too much.

About How to split hyperrect.

I'm confused about split HyperRect.
Some articles point out that split HyperRect dimension should has max variance.
But you just choose X-aix at first and alerative at next depth.
Did it correct?

Allow for duplicate coordinates

Currently the tree will not allow you to add multiple data points with the same coordinates.
Though, I don't think there's any technical requirement for not allowing duplicate coordinates.

Inserted values are ignored if inserted with the same key

KdTree seems to always be ignoring the new values if there's an old value stored with the same key. Here's an example:

using System;
using KdTree;
using KdTree.Math;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var tree = new KdTree<float, int>(2, new FloatMath());
            var coords = new[] { 0.0f, 0.0f };
            tree.Add(coords, 100);
            tree.Add(coords, 200);

            var z = tree.FindValueAt(coords);
            Console.Write(z); // => 100, but I'd expect 200
        }
    }
}

It would be better to either replace the existing value or throw an exception. I think that the library should never silently ignore the user value.

Maybe the problem will be solved as part of #4.

Serialization when saving a large tree. Workaround is to use FsPickler

Saving a

    let t1 =  new KdTree<float, Alrm>(1, new DoubleMath());
    t1.SaveToFile(@"D:\alarms\alarmIndex.bin")

Gives the following error with about 7M entries:
System.Runtime.Serialization.SerializationException: The internal array cannot expand to greater than Int32.MaxValue elements.
at System.Runtime.Serialization.ObjectIDGenerator.Rehash()
at System.Runtime.Serialization.ObjectIDGenerator.GetId(Object obj, Boolean& firstTime)

However this worked for both saving and loading:

    let ser = MBrace.FsPickler.BinarySerializer()
    ser.Serialize(IO.File.Create @"D:\alarms\alarmIndex.bin", t1)
    let t2:KdTree<float, Alrm> = ser.Deserialize(IO.File.OpenRead @"D:\alarms\alarmIndex.bin")

Maybe you can switch to FsPickler internally for serialization

Item not found

Hi,
I have a dataset of 7600 items and I make a query to get the 40 nearest members but one of the expected results is missing. Is there any known bug? If you have time to have a look I can provide the dataset.

Sebastian

Feature: Support for range queries.

KD-Trees supports many different kinds of queries. One such example is to search for all elements within a given range in multiple dimensions.

If you are interested in adding this kind of query to the library then I would be happy to work on an implementation.

One use-case for this is when making virtualization in 2D canvases which I'm working on here: KristofferStrube/Blazor.SVGEditor#15

Change versioning scheme

Project uses a reverse date version scheme (year.month.date). This was a bad practice I had inherited from a company I worked at at the time.

The version scheme should be updated to Major.Minor.Patch so that it updates correctly in NPM.

Is there any way to traverse KdTree?

I found that root in KdTree's declaration is private and leftChild and rightChild is internal in KdTreeNode. It seems that there may be no way to traverse KdTree for now.

Add documentation

It would be very nice to provide some basic usage examples. While using the library (which is very good and solved my tasks) I was confused by multiple things:

  1. Add behavior (already reported in #4 and #5).
  2. Whether I need to call Balance() at all.
  3. That I should declare my own instance for TypeMath<T> and whether I need to Register it or pass to KdTree constructor or both.

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.