Working on Factorize

This commit is contained in:
Youmu Liu
2025-12-17 16:56:13 +08:00
parent 88ed5a95c5
commit 688a420574
8 changed files with 181 additions and 14 deletions
+10 -4
View File
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Matrix"
// Project: StgSharp
@@ -52,7 +52,8 @@ namespace StgSharp.Mathematics.Numeric
public static MatrixAllocation DefaultAllocation { get; set; } = MatrixAllocation.GC;
public static Matrix<T> FromDefault<T>(int columnLength, int rowLength) where T : unmanaged, INumber<T>
public static Matrix<T> FromDefault<T>(int columnLength, int rowLength)
where T : unmanaged, INumber<T>
{
return DefaultAllocation switch
{
@@ -62,15 +63,20 @@ namespace StgSharp.Mathematics.Numeric
};
}
public static Matrix<T> FromGC<T>(int columnLength, int rowLength) where T : unmanaged, INumber<T>
public static Matrix<T> FromGC<T>(int columnLength, int rowLength)
where T : unmanaged, INumber<T>
{
return new GCMatrix<T>(columnLength, rowLength);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Matrix<T> FromHlsf<T>(int columnLength, int rowLength, hlsfAllocator allocator)
public static Matrix<T> FromHlsf<T>(
int columnLength,
int rowLength,
hlsfAllocator allocator)
where T : unmanaged, INumber<T>
{
ArgumentNullException.ThrowIfNull(allocator, nameof(allocator));
return new HlsfMatrix<T>(columnLength, rowLength, allocator);
}