Exemplo n.º 1
0
 public void BechmarkStructShortFloat()
 {
     for (int i = 0; i < SIZE - 1; i++)
     {
         PointStructFloat.PointDistanceShort(pointStructFloatArray[i], pointStructFloatArray[i + 1]);
     }
 }
Exemplo n.º 2
0
        public static float PointDistanceShort(PointStructFloat pointOne, PointStructFloat pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return((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);
            }
        }