keep working on PLN facotrize

This commit is contained in:
Youmu Liu
2025-12-24 18:09:16 +08:00
parent b60ce56f1c
commit 3b3a90a2af
12 changed files with 428 additions and 305 deletions
@@ -65,7 +65,7 @@ namespace StgSharp.Mathematics.Numeric
long kernelCount = layout switch
{
MatrixLayout.DenseSquare => (long)kernelColumns * kernelRows,
MatrixLayout.DenseRectangle => (long)kernelColumns * kernelRows,
MatrixLayout.UpperTriangle => TriangularKernelCount(kernelColumns),
MatrixLayout.LowerTriangle => TriangularKernelCount(kernelRows),
_ => throw new ArgumentOutOfRangeException(nameof(layout))
@@ -79,16 +79,10 @@ namespace StgSharp.Mathematics.Numeric
HybridLayerSegregatedFitAllocationHandle handle = allocator.Alloc((uint)requiredBytes);
MatrixStorageHLSF<T> storage = new MatrixStorageHLSF<T>(allocator, handle);
Matrix<T> matrix = new Matrix<T>
{
Layout = layout,
KernelColumnLength = kernelColumns,
KernelRowLength = kernelRows,
};
matrix._buffer = storage;
matrix._boarder = MatrixKernelBoarder.Create(layout);
matrix._size = new MatrixSize(columnLength, rowLength, kernelColumns, kernelRows);
Matrix<T> matrix = new Matrix<T>(MatrixKernelBoarder.Create(layout), new MatrixSize(columnLength,
rowLength,
kernelColumns,
kernelRows), storage);
return matrix;
}