class Kd::Tree(T)

Overview

A generic KD-tree implementation where T is the type of the points.

Defined in:

kd_tree.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(points : Array(T)) #

Constructor for the KD-tree. Takes an array of points of type T and builds the tree.


Instance Method Detail

def nearest(target : T, n : Int32 = 1) : Array(T) #

Method to find the nearest 'n' points to a given target point. Returns an array of these points.


def root : Node(T) | Nil #