LAPACK 3.3.0

csytri2.f

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