/// <summary> /// Computes an LU factorization of an N-square matrix A using partial pivoting with row interchanges. /// </summary> /// <param name="A"></param> /// <param name="X"></param> /// <param name="P"></param> /// <typeparam name="M"></typeparam> /// <typeparam name="N"></typeparam> public static ref BlockMatrix <N, double> getrf <N>(BlockMatrix <N, double> A, Span <int> P, ref BlockMatrix <N, double> X) where N : ITypeNat, new() { var n = nati <N>(); var lda = n; A.CopyTo(ref X); var exit = LAPACK.LAPACKE_dgetrf(RowMajor, n, n, ref head(X), lda, ref head(P)); checkx(exit); return(ref X); }