public PriorityQueue2(int capacity = 512) { priorityMath = TypeMath <TPriority> .GetMath(); maxPriority = priorityMath.Max; Initialize(capacity); }
public KdTree(int dimensions) { this.dimensions = dimensions; this.typeMath = TypeMath <TKey> .GetMath(); Count = 0; }
public PriorityQueue(int capacity, ITypeMath <TPriority> priorityMath = null) { if (capacity <= 0) { throw new ArgumentException("Capacity must be greater than zero"); } this.capacity = capacity; queue = new ItemPriority <TItem, TPriority> [capacity]; if (priorityMath != null) { this.priorityMath = priorityMath; } else { this.priorityMath = TypeMath <TPriority> .GetMath(); } }
public static HyperRect <T> Infinite(int dimensions, ITypeMath <T> math = null) { if (math == null) { math = TypeMath <T> .GetMath(); } var rect = new HyperRect <T>(); rect.MinPoint = new T[dimensions]; rect.MaxPoint = new T[dimensions]; for (var dimension = 0; dimension < dimensions; dimension++) { rect.MinPoint[dimension] = math.NegativeInfinity; rect.MaxPoint[dimension] = math.PositiveInfinity; } return(rect); }
static DoubleMath() { // Make sure we register ourselves! TypeMath <double> .Register(new DoubleMath()); }