Interface IDistanceCalculator<T>
A concrete implementation of this interface is required when calling NearestNeigbour() for k-d tree.
Namespace: Advanced.Algorithms.DataStructures
Assembly: Advanced.Algorithms.dll
Syntax
public interface IDistanceCalculator<T>
where T : IComparable
Type Parameters
Name | Description |
---|---|
T |
Methods
| Improve this Doc View SourceCompare(T, T, T[], T[])
Compare distance between point A to B and the distance between point Start to End.
Declaration
int Compare(T a, T b, T[] start, T[] end)
Parameters
Type | Name | Description |
---|---|---|
T | a | |
T | b | |
T[] | start | |
T[] | end |
Returns
Type | Description |
---|---|
Int32 | similar result as IComparabl.e |
Compare(T[], T[], T[])
Compare the distance between point A to point and point B to point.
Declaration
int Compare(T[] a, T[] b, T[] point)
Parameters
Type | Name | Description |
---|---|---|
T[] | a | |
T[] | b | |
T[] | point |
Returns
Type | Description |
---|---|
Int32 | similar result as IComparable. |