Rate This Document
Findability
Accuracy
Completeness
Readability

i?amax

The real number vector returns the index value of the maximum absolute value, and the complex number vector returns the maximum index value of the sum of the absolute value of the real part and the absolute value of the imaginary part.

Interface Definition

C interface:

CBLAS_INDEX cblas_isamax(const BLASINT n, const float *x, const BLASINT incx);

CBLAS_INDEX cblas_idamax(const BLASINT n, const double *x, const BLASINT incx);

CBLAS_INDEX cblas_icamax(const BLASINT n, const void *x, const BLASINT incx);

CBLAS_INDEX cblas_izamax(const BLASINT n, const void *x, const BLASINT incx);

Fortran interface:

INDEX = ISAMAX(N, X, INCX)

INDEX = IDAMAX(N, X, INCX)

INDEX = ICAMAX(N, X, INCX)

INDEX = IZAMAX(N, X, INCX)

Parameters

Parameter

Type

Description

Input/Output

n

Integer

Number of elements in the x vector

Input

x

  • For isamax, x is of double-precision floating-point type.
  • For idamax, x is of single-precision floating-point type.
  • For icamax, x is of single-precision complex number type.
  • For izamax, x is of double-precision complex number type.

Vector x. The vector size is at least (1+(n-1)*abs(incX)).

Input

incx

Integer

Increment for the elements of vector x

Input

Return Value

The real number vector returns the index value of the maximum absolute value, and the complex number vector returns the maximum index value of the sum of the absolute value of the real part and the absolute value of the imaginary part. It is of the CBLAS_INDEX type.

Dependencies

#include "kblas.h"

Examples

C interface:

    int n = 5, incx = 1; 
    int res; 
    /** 
     *   X:  0.340188, -0.105617, 0.283099, 0.298440, 0.411647 
     */ 
    float x[5] = {0.340188, -0.105617, 0.283099, 0.298440, 0.411647}; 
 
    res = cblas_isamax(n, x, incx); 
    /** 
     * Output:  4 
     */

Fortran interface:

      INTEGER :: N=5 
      INTEGER :: INCX=1 
      INTEGER :: INDEX 
      REAL(4) :: X(5) 
      DATA X/0.340188, -0.105617, 0.283099, 0.298440, 0.411647/ 
      EXTERNAL ISAMAX 
      INDEX=ISAMAX(N, X, INCX) 
 
*     Output : 4