Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CSVData string = "" /* 27402628-byte string literal not displayed */
View Source
var DataPoints []City
points from embedded csv
Functions ¶
func MathEqualWithinAbsRel ¶
func ParseEmbeddedCSV ¶
func ParseEmbeddedCSV() error
This function will parse the embedded csv file into the go binary. If the csv file is lost this go program will still work
Types ¶
type KDTree ¶
type KDTree struct {
Root *KDTreeNode
}
func (*KDTree) FindNearestNeighbor ¶
func (tree *KDTree) FindNearestNeighbor(target City) *KDTreeNode
FindNearestNeighbor is a method of KDTree to find the nearest neighbor of a target city
func (*KDTree) NearestNeighbor ¶
func (tree *KDTree) NearestNeighbor(root *KDTreeNode, target City, depth int, best *KDTreeNode, bestDist *float64) *KDTreeNode
Nearest neighbor search in the KD-Tree
type KDTreeNode ¶
type KDTreeNode struct { City City Left, Right *KDTreeNode Depth int }
func BuildKDTree ¶
func BuildKDTree(cities []City, depth int) *KDTreeNode
KD-Tree construction function
Click to show internal directories.
Click to hide internal directories.