LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
claswp.f
Go to the documentation of this file.
00001 *> \brief \b CLASWP
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download CLASWP + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claswp.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claswp.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claswp.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE CLASWP( N, A, LDA, K1, K2, IPIV, INCX )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       INTEGER            INCX, K1, K2, LDA, N
00025 *       ..
00026 *       .. Array Arguments ..
00027 *       INTEGER            IPIV( * )
00028 *       COMPLEX            A( LDA, * )
00029 *       ..
00030 *  
00031 *
00032 *> \par Purpose:
00033 *  =============
00034 *>
00035 *> \verbatim
00036 *>
00037 *> CLASWP performs a series of row interchanges on the matrix A.
00038 *> One row interchange is initiated for each of rows K1 through K2 of A.
00039 *> \endverbatim
00040 *
00041 *  Arguments:
00042 *  ==========
00043 *
00044 *> \param[in] N
00045 *> \verbatim
00046 *>          N is INTEGER
00047 *>          The number of columns of the matrix A.
00048 *> \endverbatim
00049 *>
00050 *> \param[in,out] A
00051 *> \verbatim
00052 *>          A is COMPLEX array, dimension (LDA,N)
00053 *>          On entry, the matrix of column dimension N to which the row
00054 *>          interchanges will be applied.
00055 *>          On exit, the permuted matrix.
00056 *> \endverbatim
00057 *>
00058 *> \param[in] LDA
00059 *> \verbatim
00060 *>          LDA is INTEGER
00061 *>          The leading dimension of the array A.
00062 *> \endverbatim
00063 *>
00064 *> \param[in] K1
00065 *> \verbatim
00066 *>          K1 is INTEGER
00067 *>          The first element of IPIV for which a row interchange will
00068 *>          be done.
00069 *> \endverbatim
00070 *>
00071 *> \param[in] K2
00072 *> \verbatim
00073 *>          K2 is INTEGER
00074 *>          The last element of IPIV for which a row interchange will
00075 *>          be done.
00076 *> \endverbatim
00077 *>
00078 *> \param[in] IPIV
00079 *> \verbatim
00080 *>          IPIV is INTEGER array, dimension (K2*abs(INCX))
00081 *>          The vector of pivot indices.  Only the elements in positions
00082 *>          K1 through K2 of IPIV are accessed.
00083 *>          IPIV(K) = L implies rows K and L are to be interchanged.
00084 *> \endverbatim
00085 *>
00086 *> \param[in] INCX
00087 *> \verbatim
00088 *>          INCX is INTEGER
00089 *>          The increment between successive values of IPIV.  If IPIV
00090 *>          is negative, the pivots are applied in reverse order.
00091 *> \endverbatim
00092 *
00093 *  Authors:
00094 *  ========
00095 *
00096 *> \author Univ. of Tennessee 
00097 *> \author Univ. of California Berkeley 
00098 *> \author Univ. of Colorado Denver 
00099 *> \author NAG Ltd. 
00100 *
00101 *> \date November 2011
00102 *
00103 *> \ingroup complexOTHERauxiliary
00104 *
00105 *> \par Further Details:
00106 *  =====================
00107 *>
00108 *> \verbatim
00109 *>
00110 *>  Modified by
00111 *>   R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
00112 *> \endverbatim
00113 *>
00114 *  =====================================================================
00115       SUBROUTINE CLASWP( N, A, LDA, K1, K2, IPIV, INCX )
00116 *
00117 *  -- LAPACK auxiliary routine (version 3.4.0) --
00118 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00119 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00120 *     November 2011
00121 *
00122 *     .. Scalar Arguments ..
00123       INTEGER            INCX, K1, K2, LDA, N
00124 *     ..
00125 *     .. Array Arguments ..
00126       INTEGER            IPIV( * )
00127       COMPLEX            A( LDA, * )
00128 *     ..
00129 *
00130 * =====================================================================
00131 *
00132 *     .. Local Scalars ..
00133       INTEGER            I, I1, I2, INC, IP, IX, IX0, J, K, N32
00134       COMPLEX            TEMP
00135 *     ..
00136 *     .. Executable Statements ..
00137 *
00138 *     Interchange row I with row IPIV(I) for each of rows K1 through K2.
00139 *
00140       IF( INCX.GT.0 ) THEN
00141          IX0 = K1
00142          I1 = K1
00143          I2 = K2
00144          INC = 1
00145       ELSE IF( INCX.LT.0 ) THEN
00146          IX0 = 1 + ( 1-K2 )*INCX
00147          I1 = K2
00148          I2 = K1
00149          INC = -1
00150       ELSE
00151          RETURN
00152       END IF
00153 *
00154       N32 = ( N / 32 )*32
00155       IF( N32.NE.0 ) THEN
00156          DO 30 J = 1, N32, 32
00157             IX = IX0
00158             DO 20 I = I1, I2, INC
00159                IP = IPIV( IX )
00160                IF( IP.NE.I ) THEN
00161                   DO 10 K = J, J + 31
00162                      TEMP = A( I, K )
00163                      A( I, K ) = A( IP, K )
00164                      A( IP, K ) = TEMP
00165    10             CONTINUE
00166                END IF
00167                IX = IX + INCX
00168    20       CONTINUE
00169    30    CONTINUE
00170       END IF
00171       IF( N32.NE.N ) THEN
00172          N32 = N32 + 1
00173          IX = IX0
00174          DO 50 I = I1, I2, INC
00175             IP = IPIV( IX )
00176             IF( IP.NE.I ) THEN
00177                DO 40 K = N32, N
00178                   TEMP = A( I, K )
00179                   A( I, K ) = A( IP, K )
00180                   A( IP, K ) = TEMP
00181    40          CONTINUE
00182             END IF
00183             IX = IX + INCX
00184    50    CONTINUE
00185       END IF
00186 *
00187       RETURN
00188 *
00189 *     End of CLASWP
00190 *
00191       END
 All Files Functions