/// <summary>
            /// Compute the inverse of a matrix, using the Cholesky factorization of the <c>A</c> matrix,
            /// typically returned from <c>Pptrf</c>.
            /// The <c>pptrf</c> name comes from LAPACK, and means PositiveDefinitePackedTriangular(Cholesky)Invert.
            /// </summary>
            /// <param name="layout">The storage order of this matrix</param>
            /// <param name="uplo">Whether the passed in matrix stores the upper or lower triangular part of the matrix</param>
            /// <param name="n">The order of the matrix</param>
            /// <param name="ap">An array with at least n*(n+1)/2 entries, containing a Cholesky factorization
            /// of the matrix in the linear equation. The inverse is returned in this array.</param>
            public static void Pptri(Layout layout, UpLo uplo, int n, Double[] ap)
            {
                Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length");
                int retval = PptriInternal(layout, uplo, n, ap);

                if (retval == 0)
                {
                    return;
                }

                switch (-1 - retval)
                {
                case 0:
                    throw Contracts.ExceptParam(nameof(layout));

                case 1:
                    throw Contracts.ExceptParam(nameof(uplo));

                case 2:
                    throw Contracts.ExceptParam(nameof(n));

                case 3:
                    throw Contracts.ExceptParam(nameof(ap));

                default:
                    throw Contracts.Except();
                }
            }
예제 #2
0
            /// <summary>
            /// Solves a system of linear equations, using the Cholesky factorization of the <c>A</c> matrix,
            /// typically returned from <c>Pptrf</c>.
            /// The <c>pptrf</c> name comes from LAPACK, and means PositiveDefinitePackedTriangular(Cholesky)Solve.
            /// </summary>
            /// <param name="layout">The storage order of this matrix</param>
            /// <param name="uplo">Whether the passed in matrix stores the upper or lower triangular part of the matrix</param>
            /// <param name="n">The order of the matrix</param>
            /// <param name="nrhs">The number of columns in the right hand side matrix</param>
            /// <param name="ap">An array with at least n*(n+1)/2 entries, containing a Cholesky factorization
            /// of the matrix in the linear equation.</param>
            /// <param name="b">The right hand side</param>
            /// <param name="ldb">The major index step size (typically for row major order, the number of columns,
            /// or something larger)</param>
            public static void Pptrs(Layout layout, UpLo uplo, int n, int nrhs, Double[] ap, Double[] b, int ldb)
            {
                Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length");
                Contracts.CheckParam((long)n * ldb <= b.Length, nameof(b), "vector had insufficient length");
                int retval = PptrsInternal(layout, uplo, n, nrhs, ap, b, ldb);
                if (retval == 0)
                    return;

                switch (-1 - retval)
                {
                    case 0:
                        throw Contracts.ExceptParam(nameof(layout));
                    case 1:
                        throw Contracts.ExceptParam(nameof(uplo));
                    case 2:
                        throw Contracts.ExceptParam(nameof(n));
                    case 3:
                        throw Contracts.ExceptParam(nameof(nrhs));
                    case 4:
                        throw Contracts.ExceptParam(nameof(ap));
                    case 5:
                        throw Contracts.ExceptParam(nameof(b));
                    case 6:
                        throw Contracts.ExceptParam(nameof(ldb));
                    default:
                        throw Contracts.Except();
                }

            }
            /// <summary>
            /// Cholesky factorization of a symmetric positive-definite double matrix, using packed storage.
            /// The <c>pptrf</c> name comes from LAPACK, and means PositiveDefinitePackedTriangular(Cholesky)Factorize.
            /// </summary>
            /// <param name="layout">The storage order of this matrix</param>
            /// <param name="uplo">Whether the passed in matrix stores the upper or lower triangular part of the matrix</param>
            /// <param name="n">The order of the matrix</param>
            /// <param name="ap">An array with at least n*(n+1)/2 entries, containing the packed upper/lower part of the matrix.
            /// The triangular factorization is stored in this passed in matrix, when it returns. (U^T U or L L^T depending
            /// on whether this was upper or lower.)</param>
            public static void Pptrf(Layout layout, UpLo uplo, int n, Double[] ap)
            {
                Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length");
                int retval = PptrfInternal(layout, uplo, n, ap);

                if (retval == 0)
                {
                    return;
                }

                switch (-1 - retval)
                {
                case 0:
                    throw Contracts.ExceptParam(nameof(layout));

                case 1:
                    throw Contracts.ExceptParam(nameof(uplo));

                case 2:
                    throw Contracts.ExceptParam(nameof(n));

                case 3:
                    throw Contracts.ExceptParam(nameof(ap));

                default:
                    throw Contracts.ExceptParam(nameof(ap), "Input matrix was not positive-definite. Try using a larger L2 regularization weight.");
                }
            }
예제 #4
0
 private static void ArgumentCheck(UpLo uplo, int n, int nrhs, object A, int lda, object B, int ldb)
 {
     if (n < 0)
     {
         throw new ArgumentException("n must be at least zero.", "n");
     }
     if (nrhs < 0)
     {
         throw new ArgumentException("nrhs must be at least zero.", "nrhs");
     }
     if (A == null)
     {
         throw new ArgumentNullException("A", "A cannot be null.");
     }
     if (lda < n || lda < 1)
     {
         throw new ArgumentException("lda must be at least max(1,n)");
     }
     if (B == null)
     {
         throw new ArgumentNullException("B", "B cannot be null.");
     }
     if (ldb < n || ldb < 1)
     {
         throw new ArgumentException("ldb must be at least max(1,n)", "ldb");
     }
 }
예제 #5
0
 internal static void Compute( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, double alpha, double[] A, int lda, double[] B, int ldb ){
   if ( transA == Transpose.ConjTrans ) {
     transA = Transpose.Trans;
   }
   ArgumentCheck(side, m, n, A, lda, B, ldb);
   
   dna_blas_dtrsm(order, side, uplo, transA, diag, m, n, alpha, A, lda, B, ldb);
 }
예제 #6
0
 private static void ArgumentCheck(UpLo uplo, int n, object A, int lda){
   if (n<0) 
     throw new ArgumentException("n must be at least zero.", "n");
   if (A==null) 
     throw new ArgumentNullException("A","A cannot be null.");
   if (lda<n || lda<1) 
     throw new ArgumentException("lda must be at least max(1,n)", "lda");
 }
예제 #7
0
파일: Trsm.cs 프로젝트: carlhuth/GenXSource
        internal static void Compute(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, double alpha, double[] A, int lda, double[] B, int ldb)
        {
            if (transA == Transpose.ConjTrans)
            {
                transA = Transpose.Trans;
            }
            ArgumentCheck(side, m, n, A, lda, B, ldb);

            dna_blas_dtrsm(order, side, uplo, transA, diag, m, n, alpha, A, lda, B, ldb);
        }
예제 #8
0
파일: Potrs.cs 프로젝트: Altaxo/Altaxo
 private static void ArgumentCheck(UpLo uplo, int n, int nrhs, object A, int lda, object B, int ldb){
   if (n<0)
     throw new ArgumentException("n must be at least zero.", "n");
   if (nrhs<0)
     throw new ArgumentException("nrhs must be at least zero.", "nrhs");
   if (A==null)
     throw new ArgumentNullException("A","A cannot be null.");
   if (lda<n || lda<1)
     throw new ArgumentException("lda must be at least max(1,n)");
   if (B==null)
     throw new ArgumentNullException("B","B cannot be null.");
   if (ldb<n || ldb<1)
     throw new ArgumentException("ldb must be at least max(1,n)", "ldb");
 }
예제 #9
0
 private static void ArgumentCheck(UpLo uplo, int n, object A, int lda)
 {
     if (n < 0)
     {
         throw new ArgumentException("n must be at least zero.", "n");
     }
     if (A == null)
     {
         throw new ArgumentNullException("A", "A cannot be null.");
     }
     if (lda < n || lda < 1)
     {
         throw new ArgumentException("lda must be at least max(1,n)", "lda");
     }
 }
예제 #10
0
파일: Trsm.cs 프로젝트: carlhuth/GenXSource
        internal static void Compute(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, Complex alpha, Complex[] A, int lda, Complex[] B, int ldb)
        {
            ArgumentCheck(side, m, n, A, lda, B, ldb);

            dna_blas_ztrsm(order, side, uplo, transA, diag, m, n, ref alpha, A, lda, B, ldb);
        }
예제 #11
0
 private static extern int dna_lapack_cbdsqr( UpLo uplo, int n, int ncvt, int nru, int ncc, [In,Out]float[] d, [In,Out]float[] e, [In,Out]ComplexFloat[] vt, int ldvt, [In,Out]ComplexFloat[] u, int ldu, [In,Out]ComplexFloat[] c, int ldc );
예제 #12
0
 private static extern int dna_lapack_dpotri(UpLo uplo, int n, [In, Out] double[] A, int lda);
예제 #13
0
 internal static int Compute(UpLo uplo, int n, Complex[] A, int lda)
 {
     ArgumentCheck(uplo, n, A, lda);
     return(dna_lapack_zpotri(uplo, n, A, lda));
 }
예제 #14
0
 private static extern int dna_lapack_dpotrs(UpLo uplo, int n, int nrsh, [In, Out] double[] A, int lda, [In, Out] double[] B, int ldb);
예제 #15
0
파일: Potrs.cs 프로젝트: Altaxo/Altaxo
 private static extern int dna_lapack_dpotrs( UpLo uplo, int n, int nrsh, [In,Out]double[] A, int lda, [In,Out]double[] B, int ldb );
예제 #16
0
 private static extern void dna_blas_dtrsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, double alpha, [In]double[] A, int lda, [In,Out]double[] B, int ldb );
예제 #17
0
 internal static int Compute(UpLo uplo, int n, ComplexFloat[] A, int lda, float anorm, out float rcond)
 {
     ArgumentCheck(uplo, n, A, lda);
     rcond = 0;
     return(dna_lapack_cpocon(uplo, n, A, lda, anorm, out rcond));
 }
예제 #18
0
 private static extern int dna_lapack_zbdsqr(UpLo uplo, int n, int ncvt, int nru, int ncc, [In, Out] double[] d, [In, Out] double[] e, [In, Out] Complex[] vt, int ldvt, [In, Out] Complex[] u, int ldu, [In, Out] Complex[] c, int ldc);
예제 #19
0
 private static extern int dna_lapack_cbdsqr(UpLo uplo, int n, int ncvt, int nru, int ncc, [In, Out] float[] d, [In, Out] float[] e, [In, Out] ComplexFloat[] vt, int ldvt, [In, Out] ComplexFloat[] u, int ldu, [In, Out] ComplexFloat[] c, int ldc);
예제 #20
0
파일: Potrf.cs 프로젝트: Shine6Z/GenXSource
 private static extern int dna_lapack_cpotrf(UpLo uplo, int n, [In, Out] ComplexFloat[] A, int lda);
예제 #21
0
파일: Potrf.cs 프로젝트: Shine6Z/GenXSource
 internal static int Compute(UpLo uplo, int n, double[] A, int lda)
 {
     ArgumentCheck(uplo, n, A, lda);
     return(dna_lapack_dpotrf(uplo, n, A, lda));
 }
예제 #22
0
 private static extern int dna_lapack_zpotri( UpLo uplo, int n, [In,Out]Complex[] A, int lda );
예제 #23
0
 private static extern int dna_lapack_dpotri( UpLo uplo, int n, [In,Out]double[] A, int lda );
예제 #24
0
파일: Trsm.cs 프로젝트: carlhuth/GenXSource
 private static extern void dna_blas_dtrsm(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, double alpha, [In] double[] A, int lda, [In, Out] double[] B, int ldb);
예제 #25
0
 internal static int Compute( UpLo uplo, int n, double[] A, int lda  ){
   ArgumentCheck(uplo, n, A, lda);
   return dna_lapack_dpotrf(uplo, n, A, lda);
 }
예제 #26
0
 internal static int Compute(UpLo uplo, int n, Complex[] A, int lda, double anorm, out double rcond)
 {
     ArgumentCheck(uplo, n, A, lda);
     rcond = 0;
     return(dna_lapack_zpocon(uplo, n, A, lda, anorm, out rcond));
 }
예제 #27
0
파일: Potrs.cs 프로젝트: Altaxo/Altaxo
 private static extern int dna_lapack_zpotrs( UpLo uplo, int n, int nrsh, [In,Out]Complex[] A, int lda, [In,Out]Complex[] B, int ldb );
예제 #28
0
 private static extern int dna_lapack_cpocon(UpLo uplo, int n, [In, Out] ComplexFloat[] A, int lda, float anorm, out float rcond);
예제 #29
0
 private static extern int dna_lapack_spotri( UpLo uplo, int n, [In,Out]float[] A, int lda );
예제 #30
0
 private static extern int dna_lapack_zpocon(UpLo uplo, int n, [In, Out] Complex[] A, int lda, double anorm, out double rcond);
예제 #31
0
 public static extern int PptrfInternal(Layout layout, UpLo uplo, int n, Double[] ap);
예제 #32
0
 private static extern int dna_lapack_cpotrf( UpLo uplo, int n, [In,Out]ComplexFloat[] A, int lda );
예제 #33
0
 private static extern int dna_lapack_spotri(UpLo uplo, int n, [In, Out] float[] A, int lda);
예제 #34
0
 internal static int Compute( UpLo uplo, int n, ComplexFloat[] A, int lda, float anorm, out float rcond){
   ArgumentCheck(uplo, n, A, lda);
   rcond = 0;
   return dna_lapack_cpocon(uplo, n, A, lda, anorm, out rcond);
 }
예제 #35
0
 private static extern int dna_lapack_zpotri(UpLo uplo, int n, [In, Out] Complex[] A, int lda);
예제 #36
0
 internal static int Compute( UpLo uplo, int n, Complex[] A, int lda, double anorm, out double rcond){
   ArgumentCheck(uplo, n, A, lda);
   rcond = 0;
   return dna_lapack_zpocon(uplo, n, A, lda, anorm, out rcond);
 }
예제 #37
0
 private static extern int dna_lapack_zbdsqr( UpLo uplo, int n, int ncvt, int nru, int ncc, [In,Out]double[] d, [In,Out]double[] e, [In,Out]Complex[] vt, int ldvt, [In,Out]Complex[] u, int ldu, [In,Out]Complex[] c, int ldc );
예제 #38
0
 private static extern int dna_lapack_cpocon(UpLo uplo, int n, [In,Out]ComplexFloat[] A, int lda, float anorm, out float rcond);
예제 #39
0
파일: Trsm.cs 프로젝트: carlhuth/GenXSource
 private static extern void dna_blas_strsm(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, float alpha, [In] float[] A, int lda, [In, Out] float[] B, int ldb);
예제 #40
0
 private static extern int dna_lapack_zpocon(UpLo uplo, int n, [In,Out]Complex[] A, int lda, double anorm, out double rcond);
예제 #41
0
파일: Trsm.cs 프로젝트: carlhuth/GenXSource
 private static extern void dna_blas_ztrsm(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, ref Complex alpha, [In] Complex[] A, int lda, [In, Out] Complex[] B, int ldb);
 private static extern int PptriInternal(Layout layout, UpLo uplo, int n, Double[] ap);
예제 #43
0
 private static extern void dna_blas_strsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, float alpha, [In]float[] A, int lda, [In,Out]float[] B, int ldb );
예제 #44
0
파일: Potrs.cs 프로젝트: Altaxo/Altaxo
 private static extern int dna_lapack_spotrs( UpLo uplo, int n, int nrsh, [In,Out]float[] A, int lda, [In,Out]float[] B, int ldb );
예제 #45
0
 private static extern void dna_blas_ztrsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, ref Complex alpha, [In]Complex[] A, int lda, [In,Out]Complex[] B, int ldb );
예제 #46
0
 internal static int Compute(UpLo uplo, int n, int nrhs, Complex[] A, int lda, Complex[] B, int ldb)
 {
     ArgumentCheck(uplo, n, nrhs, A, lda, B, ldb);
     return(dna_lapack_zpotrs(uplo, n, nrhs, A, lda, B, ldb));
 }
예제 #47
0
 internal static void Compute( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, Complex alpha, Complex[] A, int lda, Complex[] B, int ldb ){
   ArgumentCheck(side, m, n, A, lda, B, ldb);
   
   dna_blas_ztrsm(order, side, uplo, transA, diag, m, n, ref alpha, A, lda, B, ldb);
 }
예제 #48
0
 private static extern int dna_lapack_spotrs(UpLo uplo, int n, int nrsh, [In, Out] float[] A, int lda, [In, Out] float[] B, int ldb);
 private static extern int PptrsInternal(Layout layout, UpLo uplo, int n, int nrhs, Double[] ap, Double[] b, int ldb);
예제 #50
0
 internal static int Compute( UpLo uplo, int n, Complex[] A, int lda  ){
   ArgumentCheck(uplo, n, A, lda);
   return dna_lapack_zpotri(uplo, n, A, lda);
 }
예제 #51
0
 private static extern int dna_lapack_zpotrs(UpLo uplo, int n, int nrsh, [In, Out] Complex[] A, int lda, [In, Out] Complex[] B, int ldb);
예제 #52
0
파일: Potrs.cs 프로젝트: Altaxo/Altaxo
 internal static int Compute( UpLo uplo, int n, int nrhs, Complex[] A, int lda, Complex[] B, int ldb  ){
   ArgumentCheck(uplo, n, nrhs, A, lda, B, ldb);
   return dna_lapack_zpotrs(uplo, n, nrhs, A, lda, B, ldb);
 }