Annotation of rpl/lapack/lapack/izmax1.f, revision 1.15

1.15    ! bertrand    1: *> \brief \b IZMAX1 finds the index of the first vector element of maximum absolute value.
1.9       bertrand    2: *
                      3: *  =========== DOCUMENTATION ===========
                      4: *
                      5: * Online html documentation available at 
                      6: *            http://www.netlib.org/lapack/explore-html/ 
                      7: *
                      8: *> \htmlonly
                      9: *> Download IZMAX1 + dependencies 
                     10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/izmax1.f"> 
                     11: *> [TGZ]</a> 
                     12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/izmax1.f"> 
                     13: *> [ZIP]</a> 
                     14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/izmax1.f"> 
                     15: *> [TXT]</a>
                     16: *> \endhtmlonly 
                     17: *
                     18: *  Definition:
                     19: *  ===========
                     20: *
1.15    ! bertrand   21: *       INTEGER          FUNCTION IZMAX1( N, ZX, INCX )
1.9       bertrand   22: * 
                     23: *       .. Scalar Arguments ..
                     24: *       INTEGER            INCX, N
                     25: *       ..
                     26: *       .. Array Arguments ..
1.15    ! bertrand   27: *       COMPLEX*16         ZX( * )
1.9       bertrand   28: *       ..
                     29: *  
                     30: *
                     31: *> \par Purpose:
                     32: *  =============
                     33: *>
                     34: *> \verbatim
                     35: *>
1.15    ! bertrand   36: *> IZMAX1 finds the index of the first vector element of maximum absolute value.
1.9       bertrand   37: *>
                     38: *> Based on IZAMAX from Level 1 BLAS.
                     39: *> The change is to use the 'genuine' absolute value.
                     40: *> \endverbatim
                     41: *
                     42: *  Arguments:
                     43: *  ==========
                     44: *
                     45: *> \param[in] N
                     46: *> \verbatim
                     47: *>          N is INTEGER
1.15    ! bertrand   48: *>          The number of elements in the vector ZX.
1.9       bertrand   49: *> \endverbatim
                     50: *>
1.15    ! bertrand   51: *> \param[in] ZX
1.9       bertrand   52: *> \verbatim
1.15    ! bertrand   53: *>          ZX is COMPLEX*16 array, dimension (N)
        !            54: *>          The vector ZX. The IZMAX1 function returns the index of its first
        !            55: *>          element of maximum absolute value.
1.9       bertrand   56: *> \endverbatim
                     57: *>
                     58: *> \param[in] INCX
                     59: *> \verbatim
                     60: *>          INCX is INTEGER
1.15    ! bertrand   61: *>          The spacing between successive values of ZX.  INCX >= 1.
1.9       bertrand   62: *> \endverbatim
                     63: *
                     64: *  Authors:
                     65: *  ========
                     66: *
                     67: *> \author Univ. of Tennessee 
                     68: *> \author Univ. of California Berkeley 
                     69: *> \author Univ. of Colorado Denver 
                     70: *> \author NAG Ltd. 
                     71: *
1.15    ! bertrand   72: *> \date February 2014
1.9       bertrand   73: *
1.15    ! bertrand   74: *> \ingroup complexOTHERauxiliary
1.9       bertrand   75: *
                     76: *> \par Contributors:
                     77: *  ==================
                     78: *>
                     79: *> Nick Higham for use with ZLACON.
                     80: *
                     81: *  =====================================================================
1.15    ! bertrand   82:       INTEGER FUNCTION IZMAX1( N, ZX, INCX )
1.1       bertrand   83: *
1.15    ! bertrand   84: *  -- LAPACK auxiliary routine (version 3.6.0) --
1.1       bertrand   85: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
                     86: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
1.15    ! bertrand   87: *     February 2014
1.1       bertrand   88: *
                     89: *     .. Scalar Arguments ..
                     90:       INTEGER            INCX, N
                     91: *     ..
                     92: *     .. Array Arguments ..
1.15    ! bertrand   93:       COMPLEX*16         ZX(*)
1.1       bertrand   94: *     ..
                     95: *
1.15    ! bertrand   96: *  =====================================================================
1.1       bertrand   97: *
                     98: *     .. Local Scalars ..
1.15    ! bertrand   99:       DOUBLE PRECISION   DMAX
1.1       bertrand  100:       INTEGER            I, IX
                    101: *     ..
                    102: *     .. Intrinsic Functions ..
                    103:       INTRINSIC          ABS
                    104: *     ..
                    105: *     .. Executable Statements ..
                    106: *
                    107:       IZMAX1 = 0
1.15    ! bertrand  108:       IF (N.LT.1 .OR. INCX.LE.0) RETURN
1.1       bertrand  109:       IZMAX1 = 1
1.15    ! bertrand  110:       IF (N.EQ.1) RETURN
        !           111:       IF (INCX.EQ.1) THEN
        !           112: *
        !           113: *        code for increment equal to 1
        !           114: *
        !           115:          DMAX = ABS(ZX(1))
        !           116:          DO I = 2,N
        !           117:             IF (ABS(ZX(I)).GT.DMAX) THEN
        !           118:                IZMAX1 = I
        !           119:                DMAX = ABS(ZX(I))
        !           120:             END IF
        !           121:          END DO
        !           122:       ELSE
1.1       bertrand  123: *
1.15    ! bertrand  124: *        code for increment not equal to 1
1.1       bertrand  125: *
1.15    ! bertrand  126:          IX = 1
        !           127:          DMAX = ABS(ZX(1))
        !           128:          IX = IX + INCX
        !           129:          DO I = 2,N
        !           130:             IF (ABS(ZX(IX)).GT.DMAX) THEN
        !           131:                IZMAX1 = I
        !           132:                DMAX = ABS(ZX(IX))
        !           133:             END IF
        !           134:             IX = IX + INCX
        !           135:          END DO
        !           136:       END IF
1.1       bertrand  137:       RETURN
                    138: *
                    139: *     End of IZMAX1
                    140: *
                    141:       END

CVSweb interface <joel.bertrand@systella.fr>