Example #1
0
        public override void UntimedPrepare()
        {
            if (preparation == null)
            {
                preparation = new Preparation(count);
            }

            tree = makeTree(count);
        }
Example #2
0
        private static void UnloadTree(IRankMap <int, int> tree, int?count, int[] indices)
        {
            int i = 0;

            while ((count.HasValue && (i < count.Value)) || (!count.HasValue && (tree.Count != 0)))
            {
                int rank = indices[i];
                int key  = tree.GetKeyByRank(rank);
                tree.Remove(key);
                i++;
            }
        }
Example #3
0
 private static void LoadTree(IRankMap <int, int> tree, int count, int[] keys)
 {
     for (int i = 0; i < count; i++)
     {
         int key = keys[i];
         tree.TryAdd(key, key);
     }
     if (tree.Count < .999 * count)
     {
         throw new InvalidOperationException("too many collisions - choose a better seed");
     }
 }
Example #4
0
 public AllocTestRankMap(IRankMap <int, float> actual)
 {
     this.actual = actual;
 }