Annotation of rpl/lapack/lapack/zsyswapr.f, revision 1.13

1.4       bertrand    1: *> \brief \b ZSYSWAPR
                      2: *
                      3: *  =========== DOCUMENTATION ===========
                      4: *
1.10      bertrand    5: * Online html documentation available at
                      6: *            http://www.netlib.org/lapack/explore-html/
1.4       bertrand    7: *
                      8: *> \htmlonly
1.10      bertrand    9: *> Download ZSYSWAPR + dependencies
                     10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsyswapr.f">
                     11: *> [TGZ]</a>
                     12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsyswapr.f">
                     13: *> [ZIP]</a>
                     14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyswapr.f">
1.4       bertrand   15: *> [TXT]</a>
1.10      bertrand   16: *> \endhtmlonly
1.4       bertrand   17: *
                     18: *  Definition:
                     19: *  ===========
                     20: *
                     21: *       SUBROUTINE ZSYSWAPR( UPLO, N, A, LDA, I1, I2)
1.10      bertrand   22: *
1.4       bertrand   23: *       .. Scalar Arguments ..
                     24: *       CHARACTER        UPLO
                     25: *       INTEGER          I1, I2, LDA, N
                     26: *       ..
                     27: *       .. Array Arguments ..
                     28: *       COMPLEX*16       A( LDA, N )
1.10      bertrand   29: *
1.4       bertrand   30: *
                     31: *> \par Purpose:
                     32: *  =============
                     33: *>
                     34: *> \verbatim
                     35: *>
                     36: *> ZSYSWAPR applies an elementary permutation on the rows and the columns of
                     37: *> a symmetric matrix.
                     38: *> \endverbatim
                     39: *
                     40: *  Arguments:
                     41: *  ==========
                     42: *
                     43: *> \param[in] UPLO
                     44: *> \verbatim
                     45: *>          UPLO is CHARACTER*1
                     46: *>          Specifies whether the details of the factorization are stored
                     47: *>          as an upper or lower triangular matrix.
                     48: *>          = 'U':  Upper triangular, form is A = U*D*U**T;
                     49: *>          = 'L':  Lower triangular, form is A = L*D*L**T.
                     50: *> \endverbatim
                     51: *>
                     52: *> \param[in] N
                     53: *> \verbatim
                     54: *>          N is INTEGER
                     55: *>          The order of the matrix A.  N >= 0.
                     56: *> \endverbatim
                     57: *>
                     58: *> \param[in,out] A
                     59: *> \verbatim
1.13    ! bertrand   60: *>          A is COMPLEX*16 array, dimension (LDA,*)
        !            61: *>          On entry, the N-by-N matrix A. On exit, the permuted matrix
        !            62: *>          where the rows I1 and I2 and columns I1 and I2 are interchanged.
        !            63: *>          If UPLO = 'U', the interchanges are applied to the upper
        !            64: *>          triangular part and the strictly lower triangular part of A is
        !            65: *>          not referenced; if UPLO = 'L', the interchanges are applied to
        !            66: *>          the lower triangular part and the part of A above the diagonal
        !            67: *>          is not referenced.
1.4       bertrand   68: *> \endverbatim
                     69: *>
                     70: *> \param[in] LDA
                     71: *> \verbatim
                     72: *>          LDA is INTEGER
                     73: *>          The leading dimension of the array A.  LDA >= max(1,N).
                     74: *> \endverbatim
                     75: *>
                     76: *> \param[in] I1
                     77: *> \verbatim
                     78: *>          I1 is INTEGER
                     79: *>          Index of the first row to swap
                     80: *> \endverbatim
                     81: *>
                     82: *> \param[in] I2
                     83: *> \verbatim
                     84: *>          I2 is INTEGER
                     85: *>          Index of the second row to swap
                     86: *> \endverbatim
                     87: *
                     88: *  Authors:
                     89: *  ========
                     90: *
1.10      bertrand   91: *> \author Univ. of Tennessee
                     92: *> \author Univ. of California Berkeley
                     93: *> \author Univ. of Colorado Denver
                     94: *> \author NAG Ltd.
1.4       bertrand   95: *
                     96: *> \ingroup complex16SYauxiliary
                     97: *
                     98: *  =====================================================================
1.3       bertrand   99:       SUBROUTINE ZSYSWAPR( UPLO, N, A, LDA, I1, I2)
1.1       bertrand  100: *
1.13    ! bertrand  101: *  -- LAPACK auxiliary routine --
1.1       bertrand  102: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
                    103: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
                    104: *
                    105: *     .. Scalar Arguments ..
                    106:       CHARACTER        UPLO
1.3       bertrand  107:       INTEGER          I1, I2, LDA, N
1.1       bertrand  108: *     ..
                    109: *     .. Array Arguments ..
1.13    ! bertrand  110:       COMPLEX*16       A( LDA, * )
1.1       bertrand  111: *
                    112: *  =====================================================================
                    113: *
                    114: *     ..
                    115: *     .. Local Scalars ..
                    116:       LOGICAL            UPPER
1.4       bertrand  117:       COMPLEX*16         TMP
1.1       bertrand  118: *
                    119: *     .. External Functions ..
                    120:       LOGICAL            LSAME
                    121:       EXTERNAL           LSAME
                    122: *     ..
                    123: *     .. External Subroutines ..
                    124:       EXTERNAL           ZSWAP
                    125: *     ..
                    126: *     .. Executable Statements ..
                    127: *
                    128:       UPPER = LSAME( UPLO, 'U' )
                    129:       IF (UPPER) THEN
                    130: *
                    131: *         UPPER
                    132: *         first swap
1.10      bertrand  133: *          - swap column I1 and I2 from I1 to I1-1
1.1       bertrand  134:          CALL ZSWAP( I1-1, A(1,I1), 1, A(1,I2), 1 )
                    135: *
                    136: *          second swap :
                    137: *          - swap A(I1,I1) and A(I2,I2)
1.10      bertrand  138: *          - swap row I1 from I1+1 to I2-1 with col I2 from I1+1 to I2-1
1.1       bertrand  139:          TMP=A(I1,I1)
                    140:          A(I1,I1)=A(I2,I2)
                    141:          A(I2,I2)=TMP
                    142: *
1.13    ! bertrand  143:          CALL ZSWAP( I2-I1-1, A(I1,I1+1), LDA, A(I1+1,I2), 1 )
1.1       bertrand  144: *
                    145: *          third swap
                    146: *          - swap row I1 and I2 from I2+1 to N
1.13    ! bertrand  147:          IF ( I2.LT.N )
        !           148:      $      CALL ZSWAP( N-I2, A(I1,I2+1), LDA, A(I2,I2+1), LDA )
1.1       bertrand  149: *
                    150:         ELSE
                    151: *
                    152: *         LOWER
                    153: *         first swap
1.10      bertrand  154: *          - swap row I1 and I2 from I1 to I1-1
1.3       bertrand  155:          CALL ZSWAP( I1-1, A(I1,1), LDA, A(I2,1), LDA )
1.1       bertrand  156: *
                    157: *         second swap :
                    158: *          - swap A(I1,I1) and A(I2,I2)
1.10      bertrand  159: *          - swap col I1 from I1+1 to I2-1 with row I2 from I1+1 to I2-1
1.1       bertrand  160:           TMP=A(I1,I1)
                    161:           A(I1,I1)=A(I2,I2)
                    162:           A(I2,I2)=TMP
                    163: *
1.13    ! bertrand  164:           CALL ZSWAP( I2-I1-1, A(I1+1,I1), 1, A(I2,I1+1), LDA )
1.1       bertrand  165: *
                    166: *         third swap
                    167: *          - swap col I1 and I2 from I2+1 to N
1.13    ! bertrand  168:          IF ( I2.LT.N )
        !           169:      $      CALL ZSWAP( N-I2, A(I2+1,I1), 1, A(I2+1,I2), 1 )
1.1       bertrand  170: *
                    171:       ENDIF
                    172:       END SUBROUTINE ZSYSWAPR
                    173: 

CVSweb interface <joel.bertrand@systella.fr>