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
@@ -25,11 +25,13 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.HighPerformance.Memory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@@ -41,6 +43,11 @@ namespace StgSharp.Mathematics.Numeric
public abstract class MatrixStorage<T> : IDisposable where T : unmanaged, INumber<T>
{
internal unsafe ref MatrixKernel<T> this[long index]
{
get { return ref Unsafe.AsRef<MatrixKernel<T>>(BufferPointer + MatrixKernel<T>.Size * index); }
}
protected internal abstract unsafe T* BufferPointer { get; }
public abstract void Dispose();