Ejemplo n.º 1
0
        /// <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 Matrix256 <N, double> getrf <N>(Matrix256 <N, double> A, Span <int> P, ref Matrix256 <N, double> X)
            where N : unmanaged, ITypeNat
        {
            var n   = nat32i <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);
        }
Ejemplo n.º 2
0
Archivo: getrf.cs Proyecto: 0xCM/arrows
        /// <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);
        }