daily update on 20230822 by nitload youmu

This commit is contained in:
Nitload
2023-08-22 23:01:20 +08:00
parent 969406c4e4
commit 8aac9fee87
111 changed files with 3205 additions and 11145 deletions
+58 -10
View File
@@ -1,25 +1,70 @@
using StgSharp.Math;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
namespace StgSharp
{
internal static class Program
{
internal unsafe static void Main(string[] args)
{
Matrix4x4 m = new Matrix4x4(
0,1,2,3,
4,5,6,7,
0,1,2,3,
4,5,6,7
/**/
Matrix4x4 matrix = new Matrix4x4(
1,1,-1,2,
-1,-1,-4,1,
2,4,-6,1,
1,2,4,2
);
for (int i = 0; i < 1000; i++)
Console.WriteLine(matrix.Det());
/*
System.Numerics.Matrix4x4 m = new System.Numerics.Matrix4x4(
0,1,2,3,
0,0,1,2,
0,0,0,0,
1,2,5,6
);
int cycle = 1000;
int time = 10000;
for (int t = 0; t < cycle; t++)
{
Matrix4x4 ret = m;
Stopwatch sw = Stopwatch.StartNew();
sw.Start();
for (int i = 0; i < time; i++)
{
Matrix4x4 mat = matrix * matrix;
}
sw.Stop();
TimeSpan timeSpan = sw.Elapsed;
Console.WriteLine(timeSpan.TotalMilliseconds);
Stopwatch sw2 = new Stopwatch();
sw2.Start();
for (int i = 0; i < time; i++)
{
System.Numerics.Matrix4x4 mat = m * m;
}
sw2.Stop();
TimeSpan timeSpan1 = sw2.Elapsed;
Console.WriteLine(timeSpan1.TotalMilliseconds);
Console.WriteLine();
}
//Console.WriteLine(m + m);
/**/
/*
System.Numerics.Matrix4x4 smt1 = new System.Numerics.Matrix4x4(
@@ -42,11 +87,13 @@ namespace StgSharp
for (int t = 0; t < 1000; t++)
{
s.Reset();
s.Start();
for (int i = 0; i < cycle; i++)
{
System.Numerics.Matrix4x4 ret = smt1* smt1;
System.Numerics.Matrix4x4 ret = smt1 * smt1;
}
s.Stop();
@@ -58,13 +105,14 @@ namespace StgSharp
for (int i = 0; i < cycle; i++)
{
Matrix4x4 ret = VectorCalc.Multiple(gmt1,gmt1);
Matrix4x4 ret = VectorCalc.Multiple(gmt1, gmt1);
}
s.Stop();
TimeSpan span1 = s.Elapsed;
Console.WriteLine(span1.TotalMilliseconds);
Console.WriteLine(t);
Console.WriteLine();