Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels