/// <summary> /// Initializes a new instance of the <see cref="BinaryQueue{TVertex,TDistance}"/> class. /// </summary> /// <param name="distanceFunc">Function that compute the distance for a given vertex.</param> /// <param name="distanceComparison">Comparer of distances.</param> public BinaryQueue( [NotNull] Func <TVertex, TDistance> distanceFunc, [NotNull] Comparison <TDistance> distanceComparison) { if (distanceFunc is null) { throw new ArgumentNullException(nameof(distanceFunc)); } if (distanceComparison is null) { throw new ArgumentNullException(nameof(distanceComparison)); } _distanceFunc = distanceFunc; _heap = new BinaryHeap <TDistance, TVertex>(distanceComparison); }
void IDisposable.Dispose() { _owner = null; _items = null; }