コード例 #1
0
        public static Point[] HilbertSorter(Point[] array)
        {
            Boundary boundary = GetBoundary(array, 0.0005);

            var sfc = SpaceFillingCurves.Hilbert(Moves.North, Moves.East);

            //IRI.Msh.DataStructure.SortAlgorithm.QuickSort<Point>(array, (p1, p2) => sfc.ComparePoints(p1, p2, boundary));
            //return array;

            //Array.Sort(array, new Comparison<Point>((p1, p2) => sfc.ComparePoints(p1, p2, boundary)));
            //return array;

            //return IRI.Msh.DataStructure.SortAlgorithm.Heapsort<Point>(array, (p1, p2) => sfc.ComparePoints(p1, p2, boundary));
            //return IRI.Msh.DataStructure.SortAlgorithm.MergeSort<Point>(array, (p1, p2) => sfc.ComparePoints(p1, p2, boundary));


            IRI.Msh.DataStructure.SortAlgorithm.BubbleSort <Point>(array, (p1, p2) => sfc.ComparePoints(p1, p2, boundary));
            return(array);
        }
コード例 #2
0
 public static int HilbertComparer(Point first, Point second, Boundary mbb)
 {
     return(SpaceFillingCurves.Hilbert(Moves.North, Moves.East).ComparePoints(first, second, mbb));
 }