90 lines
No EOL
2.1 KiB
C#
90 lines
No EOL
2.1 KiB
C#
// See https://aka.ms/new-console-template for more information
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Numerics;
|
|
using BasicGeometry;
|
|
|
|
public static class Program
|
|
{
|
|
private static VersorFP32[] AllocateVersors(int amount)
|
|
{
|
|
return new VersorFP32[amount];
|
|
}
|
|
|
|
private static VersorFP32[] MakeZeroVersors(int amount)
|
|
{
|
|
VersorFP32[] versors = AllocateVersors(amount);
|
|
|
|
for (int i = 0; i < amount; i++)
|
|
{
|
|
versors[i].Reset();
|
|
}
|
|
|
|
return versors;
|
|
}
|
|
|
|
private static VersorFP32[] MakeRandomVersors(int amount)
|
|
{
|
|
Random randomizer = new Random(Environment.TickCount);
|
|
|
|
VersorFP32[] versors = AllocateVersors(amount);
|
|
|
|
for (int i = 0; i < amount; i++)
|
|
{
|
|
versors[i] = new VersorFP32(
|
|
randomizer.NextSingle(),
|
|
randomizer.NextSingle(),
|
|
randomizer.NextSingle(),
|
|
randomizer.NextSingle()
|
|
);
|
|
}
|
|
|
|
return versors;
|
|
}
|
|
|
|
private static void PrintVersor(in VersorFP32 versor)
|
|
{
|
|
Console.WriteLine("({0}, {1}, {2}, {3})", versor.GetScalar(), versor.GetX1(), versor.GetX2(), versor.GetX3());
|
|
}
|
|
/*
|
|
public static int Main()
|
|
{
|
|
int amount = 1000000;
|
|
|
|
VersorFP32[] versors1 = MakeRandomVersors(amount);
|
|
VersorFP32[] versors2 = MakeRandomVersors(amount);
|
|
VersorFP32[] results = MakeZeroVersors(amount);
|
|
|
|
long start, end;
|
|
|
|
start = Environment.TickCount64;
|
|
|
|
for (int j = 0; j < 1000; j++)
|
|
{
|
|
for (int i = 0; i < amount; i++)
|
|
{
|
|
VersorFP32.Combine(versors1[i], versors2[i], out results[i]);
|
|
}
|
|
}
|
|
|
|
end = Environment.TickCount64;
|
|
|
|
Console.WriteLine("Time: {0}", end - start);
|
|
|
|
PrintVersor(versors1[10]);
|
|
PrintVersor(versors2[10]);
|
|
PrintVersor(results[10]);
|
|
|
|
return 0;
|
|
}
|
|
*/
|
|
public static int Main()
|
|
{
|
|
Vector2FP32 vector = Vector2FP32.ZERO;
|
|
|
|
Console.WriteLine("{0}", vector.ToString());
|
|
|
|
return 0;
|
|
}
|
|
} |