コード例 #1
0
        //------------------------------------------------------------------------
        //Implements the service methods calling the
        public void HeapHull()
        {
            int nb = NbPoints - NbPointThrown;

            Point[] rawPoints = new Point[nb];
            System.Array.Copy(SamplePoints, NbPointThrown, rawPoints, 0, nb);

            double elapsedTime = 0;

            // ELapsed time come from c function: "double omp_get_wtime( );" which return a double that represent the amount of seconds.
            int indexHull = NativeConvexHullApi.heaphull2WithElapsedTime(rawPoints, nb, ref elapsedTime);

            TimeSpan = TimeSpanHelper.MoreAccurateTimeSpanFromSeconds(elapsedTime);

            //copy the data to the Hull Array
            NbPointsHull = nb - indexHull;
            HullPoints   = new Point[NbPointsHull];
            System.Array.Copy(rawPoints, indexHull, HullPoints, 0, NbPointsHull);
        }
コード例 #2
0
        //-----------------------------------------------------------------------
        public void ChanHull()
        {
            int nb = NbPoints - NbPointThrown;
            //Point[] rawPoints = new Point[nb];
            //System.Array.Copy(SamplePoints, NbPointThrown, rawPoints, 0, nb);

            double elapsedTime = 0;

            if (SamplePoints == null || SamplePoints.Length == 0)
            {
                NbPointsHull = 0;
                HullPoints   = new Point[0];
                return;
            }

            int indexHull = NativeConvexHullApi.chanhullWithElapsedTime(SamplePoints, nb, ref elapsedTime);

            TimeSpan = TimeSpanHelper.MoreAccurateTimeSpanFromSeconds(elapsedTime);

            //copy the data to the Hull Array
            NbPointsHull = nb - indexHull;
            HullPoints   = new Point[NbPointsHull];
            System.Array.Copy(SamplePoints, indexHull, HullPoints, 0, NbPointsHull);
        }
コード例 #3
0
 //-----------------------------------------------------------------------
 public void GenerateVline()
 {
     NativeConvexHullApi.generate_vline_points(SamplePoints, NbPoints);
 }
コード例 #4
0
 //-----------------------------------------------------------------------
 public void GenerateSquarePoints()
 {
     NativeConvexHullApi.generate_square_points(SamplePoints, NbPoints);
 }
コード例 #5
0
 //-----------------------------------------------------------------------
 public void GenerateCirclPoints()
 {
     NativeConvexHullApi.generate_circle_points(SamplePoints, NbPoints);
 }
コード例 #6
0
 //-----------------------------------------------------------------------
 public void GenerateDiskPoints()
 {
     NativeConvexHullApi.generate_disk_points(SamplePoints, NbPoints);
 }
コード例 #7
0
 //-----------------------------------------------------------------------
 public void ThrowAway()
 {
     NbPointThrown = NativeConvexHullApi.throwaway_heuristic(SamplePoints, NbPoints);
 }