Exemplo n.º 1
0
 public void BechmarkStructDouble()
 {
     for (int i = 0; i < SIZE - 1; i++)
     {
         PointStructDouble.PointDistance(pointStructDoubleArray[i], pointStructDoubleArray[i + 1]);
     }
 }
Exemplo n.º 2
0
        public static double PointDistance(PointStructDouble pointOne, PointStructDouble pointTwo)
        {
            double x = pointOne.X - pointTwo.X;
            double y = pointOne.Y - pointTwo.Y;

            return(Math.Sqrt((x * x) + (y * y)));
        }
Exemplo n.º 3
0
        public BenchmarkClass()
        {
            Random rnd = new Random();

            for (int i = 0; i < SIZE; i++)
            {
                int x = rnd.Next(1, 100);
                int y = rnd.Next(1, 100);
                pointClassFloatArray[i]   = new PointClassFloat(x, y);
                pointStructFloatArray[i]  = new PointStructFloat(x, y);
                pointStructDoubleArray[i] = new PointStructDouble(x, y);
            }
        }