zpotri.c
Go to the documentation of this file.
00001 /* zpotri.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Subroutine */ int zpotri_(char *uplo, integer *n, doublecomplex *a, 
00017         integer *lda, integer *info)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, i__1;
00021 
00022     /* Local variables */
00023     extern logical lsame_(char *, char *);
00024     extern /* Subroutine */ int xerbla_(char *, integer *), zlauum_(
00025             char *, integer *, doublecomplex *, integer *, integer *),
00026              ztrtri_(char *, char *, integer *, doublecomplex *, integer *, 
00027             integer *);
00028 
00029 
00030 /*  -- LAPACK routine (version 3.2) -- */
00031 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00032 /*     November 2006 */
00033 
00034 /*     .. Scalar Arguments .. */
00035 /*     .. */
00036 /*     .. Array Arguments .. */
00037 /*     .. */
00038 
00039 /*  Purpose */
00040 /*  ======= */
00041 
00042 /*  ZPOTRI computes the inverse of a complex Hermitian positive definite */
00043 /*  matrix A using the Cholesky factorization A = U**H*U or A = L*L**H */
00044 /*  computed by ZPOTRF. */
00045 
00046 /*  Arguments */
00047 /*  ========= */
00048 
00049 /*  UPLO    (input) CHARACTER*1 */
00050 /*          = 'U':  Upper triangle of A is stored; */
00051 /*          = 'L':  Lower triangle of A is stored. */
00052 
00053 /*  N       (input) INTEGER */
00054 /*          The order of the matrix A.  N >= 0. */
00055 
00056 /*  A       (input/output) COMPLEX*16 array, dimension (LDA,N) */
00057 /*          On entry, the triangular factor U or L from the Cholesky */
00058 /*          factorization A = U**H*U or A = L*L**H, as computed by */
00059 /*          ZPOTRF. */
00060 /*          On exit, the upper or lower triangle of the (Hermitian) */
00061 /*          inverse of A, overwriting the input factor U or L. */
00062 
00063 /*  LDA     (input) INTEGER */
00064 /*          The leading dimension of the array A.  LDA >= max(1,N). */
00065 
00066 /*  INFO    (output) INTEGER */
00067 /*          = 0:  successful exit */
00068 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00069 /*          > 0:  if INFO = i, the (i,i) element of the factor U or L is */
00070 /*                zero, and the inverse could not be computed. */
00071 
00072 /*  ===================================================================== */
00073 
00074 /*     .. External Functions .. */
00075 /*     .. */
00076 /*     .. External Subroutines .. */
00077 /*     .. */
00078 /*     .. Intrinsic Functions .. */
00079 /*     .. */
00080 /*     .. Executable Statements .. */
00081 
00082 /*     Test the input parameters. */
00083 
00084     /* Parameter adjustments */
00085     a_dim1 = *lda;
00086     a_offset = 1 + a_dim1;
00087     a -= a_offset;
00088 
00089     /* Function Body */
00090     *info = 0;
00091     if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) {
00092         *info = -1;
00093     } else if (*n < 0) {
00094         *info = -2;
00095     } else if (*lda < max(1,*n)) {
00096         *info = -4;
00097     }
00098     if (*info != 0) {
00099         i__1 = -(*info);
00100         xerbla_("ZPOTRI", &i__1);
00101         return 0;
00102     }
00103 
00104 /*     Quick return if possible */
00105 
00106     if (*n == 0) {
00107         return 0;
00108     }
00109 
00110 /*     Invert the triangular Cholesky factor U or L. */
00111 
00112     ztrtri_(uplo, "Non-unit", n, &a[a_offset], lda, info);
00113     if (*info > 0) {
00114         return 0;
00115     }
00116 
00117 /*     Form inv(U)*inv(U)' or inv(L)'*inv(L). */
00118 
00119     zlauum_(uplo, n, &a[a_offset], lda, info);
00120 
00121     return 0;
00122 
00123 /*     End of ZPOTRI */
00124 
00125 } /* zpotri_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:43