redesign matrix design

This commit is contained in:
Youmu Liu
2025-12-23 18:13:05 +08:00
parent b32c1cb4eb
commit b60ce56f1c
12 changed files with 493 additions and 225 deletions
@@ -44,6 +44,8 @@ namespace StgSharp.HighPerformance
public unsafe struct MatrixKernel<T> where T : unmanaged, INumber<T>
{
public static readonly int Size = 16 * sizeof(T);
private T c0r0;
public MatrixKernel()
@@ -58,10 +60,10 @@ namespace StgSharp.HighPerformance
}
}
public ref T this[int column, int row]
public ref T this[int row, int column]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref Unsafe.Add(ref c0r0, (column * 4) + row);
get => ref Unsafe.Add(ref c0r0, (row * 4) + column);
}
}