Example #1
0
        public Storage(int maxdimension) {
            double[] min = new double[maxdimension];
            double[] max = new double[maxdimension];

            for (int i = 0; i < maxdimension; ++i)
            {
                min[i] = 0;
                max[i] = 1;
            }

            root = new StorageLevel(0,maxdimension, min, max);
        }
Example #2
0
 private void SortPoint(StoragePoint p)
 {
     if (p.coord[dimension] < limit)
     {
         if (smaller == null) {
             double[] amin = (double[])min.Clone();
             double[] amax = (double[])max.Clone();
             amax[dimension] = limit;
             smaller = new StorageLevel((dimension + 1) % maxdimension, maxdimension, amin, amax);
         }
         smaller.AddPoint(p);
     }
     else
     {
         if (greater == null)
         {
             double[] amin = (double[])min.Clone();
             double[] amax = (double[])max.Clone();
             amin[dimension] = limit;
             greater = new StorageLevel((dimension + 1) % maxdimension, maxdimension, amin, amax);
         }
         greater.AddPoint(p);
     }
 }