LAPACK 3.3.1
Linear Algebra PACKage

zsytri2.f

Go to the documentation of this file.
00001       SUBROUTINE ZSYTRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
00002 *
00003 *  -- LAPACK routine (version 3.3.1) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *  -- April 2011                                                      --
00007 *
00008 *  -- Written by Julie Langou of the Univ. of TN    --
00009 *
00010 * @precisions normal z -> s d c
00011 *     .. Scalar Arguments ..
00012       CHARACTER          UPLO
00013       INTEGER            INFO, LDA, LWORK, N
00014 *     ..
00015 *     .. Array Arguments ..
00016       INTEGER            IPIV( * )
00017       COMPLEX*16         A( LDA, * ), WORK( * )
00018 *     ..
00019 *
00020 *  Purpose
00021 *  =======
00022 *
00023 *  ZSYTRI2 computes the inverse of a COMPLEX*16 hermitian indefinite matrix
00024 *  A using the factorization A = U*D*U**T or A = L*D*L**T computed by
00025 *  ZSYTRF. ZSYTRI2 sets the LEADING DIMENSION of the workspace
00026 *  before calling ZSYTRI2X that actually computes the inverse.
00027 *
00028 *  Arguments
00029 *  =========
00030 *
00031 *  UPLO    (input) CHARACTER*1
00032 *          Specifies whether the details of the factorization are stored
00033 *          as an upper or lower triangular matrix.
00034 *          = 'U':  Upper triangular, form is A = U*D*U**T;
00035 *          = 'L':  Lower triangular, form is A = L*D*L**T.
00036 *
00037 *  N       (input) INTEGER
00038 *          The order of the matrix A.  N >= 0.
00039 *
00040 *  A       (input/output) COMPLEX*16 array, dimension (LDA,N)
00041 *          On entry, the NB diagonal matrix D and the multipliers
00042 *          used to obtain the factor U or L as computed by ZSYTRF.
00043 *
00044 *          On exit, if INFO = 0, the (symmetric) inverse of the original
00045 *          matrix.  If UPLO = 'U', the upper triangular part of the
00046 *          inverse is formed and the part of A below the diagonal is not
00047 *          referenced; if UPLO = 'L' the lower triangular part of the
00048 *          inverse is formed and the part of A above the diagonal is
00049 *          not referenced.
00050 *
00051 *  LDA     (input) INTEGER
00052 *          The leading dimension of the array A.  LDA >= max(1,N).
00053 *
00054 *  IPIV    (input) INTEGER array, dimension (N)
00055 *          Details of the interchanges and the NB structure of D
00056 *          as determined by ZSYTRF.
00057 *
00058 *  WORK    (workspace) COMPLEX*16 array, dimension (N+NB+1)*(NB+3)
00059 *
00060 *  LWORK   (input) INTEGER
00061 *          The dimension of the array WORK.
00062 *          WORK is size >= (N+NB+1)*(NB+3)
00063 *          If LDWORK = -1, then a workspace query is assumed; the routine
00064 *           calculates:
00065 *              - the optimal size of the WORK array, returns
00066 *          this value as the first entry of the WORK array,
00067 *              - and no error message related to LDWORK is issued by XERBLA.
00068 *
00069 *  INFO    (output) INTEGER
00070 *          = 0: successful exit
00071 *          < 0: if INFO = -i, the i-th argument had an illegal value
00072 *          > 0: if INFO = i, D(i,i) = 0; the matrix is singular and its
00073 *               inverse could not be computed.
00074 *
00075 *  =====================================================================
00076 *
00077 *     .. Local Scalars ..
00078       LOGICAL            UPPER, LQUERY
00079       INTEGER            MINSIZE, NBMAX
00080 *     ..
00081 *     .. External Functions ..
00082       LOGICAL            LSAME
00083       INTEGER            ILAENV
00084       EXTERNAL           LSAME, ILAENV
00085 *     ..
00086 *     .. External Subroutines ..
00087       EXTERNAL           ZSYTRI2X
00088 *     ..
00089 *     .. Executable Statements ..
00090 *
00091 *     Test the input parameters.
00092 *
00093       INFO = 0
00094       UPPER = LSAME( UPLO, 'U' )
00095       LQUERY = ( LWORK.EQ.-1 )
00096 *     Get blocksize
00097       NBMAX = ILAENV( 1, 'ZSYTRF', UPLO, N, -1, -1, -1 )
00098       IF ( NBMAX .GE. N ) THEN
00099          MINSIZE = N
00100       ELSE
00101          MINSIZE = (N+NBMAX+1)*(NBMAX+3)
00102       END IF
00103 *
00104       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00105          INFO = -1
00106       ELSE IF( N.LT.0 ) THEN
00107          INFO = -2
00108       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00109          INFO = -4
00110       ELSE IF (LWORK .LT. MINSIZE .AND. .NOT.LQUERY ) THEN
00111          INFO = -7
00112       END IF
00113 *
00114 *     Quick return if possible
00115 *
00116 *
00117       IF( INFO.NE.0 ) THEN
00118          CALL XERBLA( 'ZSYTRI2', -INFO )
00119          RETURN
00120       ELSE IF( LQUERY ) THEN
00121          WORK(1)=MINSIZE
00122          RETURN
00123       END IF
00124       IF( N.EQ.0 )
00125      $   RETURN
00126       
00127       IF( NBMAX .GE. N ) THEN
00128          CALL ZSYTRI( UPLO, N, A, LDA, IPIV, WORK, INFO )
00129       ELSE
00130          CALL ZSYTRI2X( UPLO, N, A, LDA, IPIV, WORK, NBMAX, INFO )
00131       END IF
00132       RETURN
00133 *
00134 *     End of ZSYTRI2
00135 *
00136       END
 All Files Functions