LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
chetri2.f
Go to the documentation of this file.
00001 *> \brief \b CHETRI2
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download CHETRI2 + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chetri2.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chetri2.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetri2.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE CHETRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          UPLO
00025 *       INTEGER            INFO, LDA, LWORK, N
00026 *       ..
00027 *       .. Array Arguments ..
00028 *       INTEGER            IPIV( * )
00029 *       COMPLEX            A( LDA, * ), WORK( * )
00030 *       ..
00031 *  
00032 *
00033 *> \par Purpose:
00034 *  =============
00035 *>
00036 *> \verbatim
00037 *>
00038 *> CHETRI2 computes the inverse of a COMPLEX hermitian indefinite matrix
00039 *> A using the factorization A = U*D*U**T or A = L*D*L**T computed by
00040 *> CHETRF. CHETRI2 set the LEADING DIMENSION of the workspace
00041 *> before calling CHETRI2X that actually computes the inverse.
00042 *> \endverbatim
00043 *
00044 *  Arguments:
00045 *  ==========
00046 *
00047 *> \param[in] UPLO
00048 *> \verbatim
00049 *>          UPLO is CHARACTER*1
00050 *>          Specifies whether the details of the factorization are stored
00051 *>          as an upper or lower triangular matrix.
00052 *>          = 'U':  Upper triangular, form is A = U*D*U**T;
00053 *>          = 'L':  Lower triangular, form is A = L*D*L**T.
00054 *> \endverbatim
00055 *>
00056 *> \param[in] N
00057 *> \verbatim
00058 *>          N is INTEGER
00059 *>          The order of the matrix A.  N >= 0.
00060 *> \endverbatim
00061 *>
00062 *> \param[in,out] A
00063 *> \verbatim
00064 *>          A is COMPLEX array, dimension (LDA,N)
00065 *>          On entry, the NB diagonal matrix D and the multipliers
00066 *>          used to obtain the factor U or L as computed by CHETRF.
00067 *>
00068 *>          On exit, if INFO = 0, the (symmetric) inverse of the original
00069 *>          matrix.  If UPLO = 'U', the upper triangular part of the
00070 *>          inverse is formed and the part of A below the diagonal is not
00071 *>          referenced; if UPLO = 'L' the lower triangular part of the
00072 *>          inverse is formed and the part of A above the diagonal is
00073 *>          not referenced.
00074 *> \endverbatim
00075 *>
00076 *> \param[in] LDA
00077 *> \verbatim
00078 *>          LDA is INTEGER
00079 *>          The leading dimension of the array A.  LDA >= max(1,N).
00080 *> \endverbatim
00081 *>
00082 *> \param[in] IPIV
00083 *> \verbatim
00084 *>          IPIV is INTEGER array, dimension (N)
00085 *>          Details of the interchanges and the NB structure of D
00086 *>          as determined by CHETRF.
00087 *> \endverbatim
00088 *>
00089 *> \param[out] WORK
00090 *> \verbatim
00091 *>          WORK is COMPLEX array, dimension (N+NB+1)*(NB+3)
00092 *> \endverbatim
00093 *>
00094 *> \param[in] LWORK
00095 *> \verbatim
00096 *>          LWORK is INTEGER
00097 *>          The dimension of the array WORK.
00098 *>          WORK is size >= (N+NB+1)*(NB+3)
00099 *>          If LDWORK = -1, then a workspace query is assumed; the routine
00100 *>           calculates:
00101 *>              - the optimal size of the WORK array, returns
00102 *>          this value as the first entry of the WORK array,
00103 *>              - and no error message related to LDWORK is issued by XERBLA.
00104 *> \endverbatim
00105 *>
00106 *> \param[out] INFO
00107 *> \verbatim
00108 *>          INFO is INTEGER
00109 *>          = 0: successful exit
00110 *>          < 0: if INFO = -i, the i-th argument had an illegal value
00111 *>          > 0: if INFO = i, D(i,i) = 0; the matrix is singular and its
00112 *>               inverse could not be computed.
00113 *> \endverbatim
00114 *
00115 *  Authors:
00116 *  ========
00117 *
00118 *> \author Univ. of Tennessee 
00119 *> \author Univ. of California Berkeley 
00120 *> \author Univ. of Colorado Denver 
00121 *> \author NAG Ltd. 
00122 *
00123 *> \date November 2011
00124 *
00125 *> \ingroup complexHEcomputational
00126 *
00127 *  =====================================================================
00128       SUBROUTINE CHETRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
00129 *
00130 *  -- LAPACK computational routine (version 3.4.0) --
00131 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00132 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00133 *     November 2011
00134 *
00135 *     .. Scalar Arguments ..
00136       CHARACTER          UPLO
00137       INTEGER            INFO, LDA, LWORK, N
00138 *     ..
00139 *     .. Array Arguments ..
00140       INTEGER            IPIV( * )
00141       COMPLEX            A( LDA, * ), WORK( * )
00142 *     ..
00143 *
00144 *  =====================================================================
00145 *
00146 *     .. Local Scalars ..
00147       LOGICAL            UPPER, LQUERY
00148       INTEGER            MINSIZE, NBMAX
00149 *     ..
00150 *     .. External Functions ..
00151       LOGICAL            LSAME
00152       INTEGER            ILAENV
00153       EXTERNAL           LSAME, ILAENV
00154 *     ..
00155 *     .. External Subroutines ..
00156       EXTERNAL           CHETRI2X
00157 *     ..
00158 *     .. Executable Statements ..
00159 *
00160 *     Test the input parameters.
00161 *
00162       INFO = 0
00163       UPPER = LSAME( UPLO, 'U' )
00164       LQUERY = ( LWORK.EQ.-1 )
00165 *     Get blocksize
00166       NBMAX = ILAENV( 1, 'CHETRF', UPLO, N, -1, -1, -1 )
00167       IF ( NBMAX .GE. N ) THEN
00168          MINSIZE = N
00169       ELSE
00170          MINSIZE = (N+NBMAX+1)*(NBMAX+3)
00171       END IF
00172 *
00173       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00174          INFO = -1
00175       ELSE IF( N.LT.0 ) THEN
00176          INFO = -2
00177       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00178          INFO = -4
00179       ELSE IF (LWORK .LT. MINSIZE .AND. .NOT.LQUERY ) THEN
00180          INFO = -7
00181       END IF
00182 *
00183 *     Quick return if possible
00184 *
00185 *
00186       IF( INFO.NE.0 ) THEN
00187          CALL XERBLA( 'CHETRI2', -INFO )
00188          RETURN
00189       ELSE IF( LQUERY ) THEN
00190          WORK(1)=MINSIZE
00191          RETURN
00192       END IF
00193       IF( N.EQ.0 )
00194      $   RETURN
00195       
00196       IF( NBMAX .GE. N ) THEN
00197          CALL CHETRI( UPLO, N, A, LDA, IPIV, WORK, INFO )
00198       ELSE
00199          CALL CHETRI2X( UPLO, N, A, LDA, IPIV, WORK, NBMAX, INFO )
00200       END IF
00201       RETURN
00202 *
00203 *     End of CHETRI2
00204 *
00205       END
 All Files Functions