File:  [local] / rpl / lapack / blas / izamax.f
Revision 1.18: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:38:44 2023 UTC (8 months, 3 weeks ago) by bertrand
Branches: MAIN
CVS tags: rpl-4_1_35, rpl-4_1_34, HEAD
Première mise à jour de lapack et blas.

    1: *> \brief \b IZAMAX
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at
    6: *            http://www.netlib.org/lapack/explore-html/
    7: *
    8: *  Definition:
    9: *  ===========
   10: *
   11: *       INTEGER FUNCTION IZAMAX(N,ZX,INCX)
   12: *
   13: *       .. Scalar Arguments ..
   14: *       INTEGER INCX,N
   15: *       ..
   16: *       .. Array Arguments ..
   17: *       COMPLEX*16 ZX(*)
   18: *       ..
   19: *
   20: *
   21: *> \par Purpose:
   22: *  =============
   23: *>
   24: *> \verbatim
   25: *>
   26: *>    IZAMAX finds the index of the first element having maximum |Re(.)| + |Im(.)|
   27: *> \endverbatim
   28: *
   29: *  Arguments:
   30: *  ==========
   31: *
   32: *> \param[in] N
   33: *> \verbatim
   34: *>          N is INTEGER
   35: *>         number of elements in input vector(s)
   36: *> \endverbatim
   37: *>
   38: *> \param[in] ZX
   39: *> \verbatim
   40: *>          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
   41: *> \endverbatim
   42: *>
   43: *> \param[in] INCX
   44: *> \verbatim
   45: *>          INCX is INTEGER
   46: *>         storage spacing between elements of ZX
   47: *> \endverbatim
   48: *
   49: *  Authors:
   50: *  ========
   51: *
   52: *> \author Univ. of Tennessee
   53: *> \author Univ. of California Berkeley
   54: *> \author Univ. of Colorado Denver
   55: *> \author NAG Ltd.
   56: *
   57: *> \ingroup aux_blas
   58: *
   59: *> \par Further Details:
   60: *  =====================
   61: *>
   62: *> \verbatim
   63: *>
   64: *>     jack dongarra, 1/15/85.
   65: *>     modified 3/93 to return if incx .le. 0.
   66: *>     modified 12/3/93, array(1) declarations changed to array(*)
   67: *> \endverbatim
   68: *>
   69: *  =====================================================================
   70:       INTEGER FUNCTION IZAMAX(N,ZX,INCX)
   71: *
   72: *  -- Reference BLAS level1 routine --
   73: *  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
   74: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
   75: *
   76: *     .. Scalar Arguments ..
   77:       INTEGER INCX,N
   78: *     ..
   79: *     .. Array Arguments ..
   80:       COMPLEX*16 ZX(*)
   81: *     ..
   82: *
   83: *  =====================================================================
   84: *
   85: *     .. Local Scalars ..
   86:       DOUBLE PRECISION DMAX
   87:       INTEGER I,IX
   88: *     ..
   89: *     .. External Functions ..
   90:       DOUBLE PRECISION DCABS1
   91:       EXTERNAL DCABS1
   92: *     ..
   93:       IZAMAX = 0
   94:       IF (N.LT.1 .OR. INCX.LE.0) RETURN
   95:       IZAMAX = 1
   96:       IF (N.EQ.1) RETURN
   97:       IF (INCX.EQ.1) THEN
   98: *
   99: *        code for increment equal to 1
  100: *
  101:          DMAX = DCABS1(ZX(1))
  102:          DO I = 2,N
  103:             IF (DCABS1(ZX(I)).GT.DMAX) THEN
  104:                IZAMAX = I
  105:                DMAX = DCABS1(ZX(I))
  106:             END IF
  107:          END DO
  108:       ELSE
  109: *
  110: *        code for increment not equal to 1
  111: *
  112:          IX = 1
  113:          DMAX = DCABS1(ZX(1))
  114:          IX = IX + INCX
  115:          DO I = 2,N
  116:             IF (DCABS1(ZX(IX)).GT.DMAX) THEN
  117:                IZAMAX = I
  118:                DMAX = DCABS1(ZX(IX))
  119:             END IF
  120:             IX = IX + INCX
  121:          END DO
  122:       END IF
  123:       RETURN
  124: *
  125: *     End of IZAMAX
  126: *
  127:       END

CVSweb interface <joel.bertrand@systella.fr>