Implementation of distance calculation from an arbitrary point to the given destination.
TravelingCosts
Type Parameters
| Name | Description |
|---|---|
TItem | Type of the points. |
TDistance | Type of the diatnce. |
01 Syntax
Microsoft.VisualBasic.Data.GraphTheory.KNearNeighbors.HNSW.TravelingCosts`2
02 Methods
03 Fields
| Name | Overloads | Summary |
|---|---|---|
| DistanceComparer | 1 | Default distance comaprer. |
| distance | 1 | The distance funciton. |
| destination | 1 | The destination point. |
| cache | 1 | Cached values. |
04 Members
#ctor(
Func(Of `0, `0, `1), `0)Initializes a new instance of the TravelingCosts class.
Parameters
| Name | Type | Description |
|---|---|---|
distance | Func(Of `0, `0, `1) | The distance function. |
destination | `0 | The destination point. |
From(
`0)Calculates distance from the departure to the destination.
Parameters
| Name | Type | Description |
|---|---|---|
departure | `0 | The point of departure. |
Returns
The distance from the departure to the destination.
Compare(
`0, `0)Compares 2 points by the distance from the destination.
Parameters
| Name | Type | Description |
|---|---|---|
x | `0 | Left point. |
y | `0 | Right point. |
Returns
-1 if x is closer to the destination than y; 0 if x and y are equally far from the destination; 1 if x is farther from the destination than y.
DistanceComparer
Default distance comaprer.
distance
The distance funciton.
destination
The destination point.
cache
Cached values.