//---------------------------------------// /// <summary> /// Create a new map segment. /// </summary> public FlowRig(double target, int maxItems = 100, IEqualityComparer <TValue> equalityComparer = null) { TargetKey = target; MaxItems = maxItems; _rig = new SortedRig <double, TValue>(SortedRig <double, TValue> .AverageDouble); Collection = equalityComparer == null ? new HashSet <TValue>() : new HashSet <TValue>(equalityComparer); }
/// <summary> /// Initialize a RangeRig with a preconstructed collection of Ranges. /// </summary> public RangeRig(SortedRig <TKey, Range> ranges) { Ranges = ranges; }
//-------------------------------------------// public Enumerator(SortedRig <TKey, TValue> rig) { _rig = rig; Index = 0; }
//-------------------------------------------// //-------------------------------------------// /// <summary> /// Initialize a new range map. Optionally with an initial capacity. /// </summary> public RangeRig(Func <TKey, TKey, TKey> getAverage, int capacity = 2) { // construct the sorted rig Ranges = new SortedRig <TKey, Range>(getAverage, capacity); }