private static void LoadTree(IRangeMap <int> tree, int count, ref ParkAndMiller random) { for (int i = 0; i < count; i++) { int start = random.Next() % Math.Max(1, tree.GetExtent()); tree.NearestLessOrEqual(start, out start); int xLength = random.Next() % 100 + 1; tree.Insert(start, xLength, random.Next()); } }
private static void UnloadTree(IRangeMap <int> tree, int?count, ref ParkAndMiller random) { int i = 0; while ((count.HasValue && (i < count.Value)) || (!count.HasValue && (tree.Count != 0))) { int start = random.Next() % tree.GetExtent(); tree.NearestLessOrEqual(start, out start); tree.Delete(start); i++; } }
public AllocTestRangeMap(IRangeMap <float> actual) { this.actual = actual; }
public override void UntimedPrepare() { tree = makeTree(count); }