Class DirectedPathComparer<TWeight>
- Namespace
- AlgorithmsSW.EdgeWeightedDigraph
- Assembly
- AlgorithmsSW.dll
Compares two DirectedPath<TWeight>s by their Distance.
public class DirectedPathComparer<TWeight> : IComparer<DirectedPath<TWeight>> where TWeight : INumber<TWeight>
Type Parameters
TWeight
The type of the weight.
- Inheritance
-
DirectedPathComparer<TWeight>
- Implements
-
IComparer<DirectedPath<TWeight>>
- Inherited Members
- Extension Methods
Constructors
DirectedPathComparer(IComparer<TWeight>)
Compares two DirectedPath<TWeight>s by their Distance.
public DirectedPathComparer(IComparer<TWeight> weightComparer)
Parameters
weightComparer
IComparer<TWeight>The comparer to compare the distances with.
Methods
Compare(DirectedPath<TWeight>?, DirectedPath<TWeight>?)
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
public int Compare(DirectedPath<TWeight>? x, DirectedPath<TWeight>? y)
Parameters
x
DirectedPath<TWeight>The first object to compare.
y
DirectedPath<TWeight>The second object to compare.
Returns
- int
A signed integer that indicates the relative values of
x
andy
, as shown in the following table.Value Meaning Less than zero x
is less thany
.Zero x
equalsy
.Greater than zero x
is greater thany
.