Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

cblas_i?amax

Finds the index of the element with maximum absolute value.

Syntax

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

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

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

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

Include Files
  • mkl.h
Description

Given a vector x, the i?amax functions return the position of the vector element x[i] that has the largest absolute value for real flavors, or the largest sum |Re(x[i])|+|Im(x[i])| for complex flavors.

If either n or incx are not positive, the routine returns 0.

If more than one vector element is found with the same largest absolute value, the index of the first one encountered is returned.

If the vector contains NaN values, then the routine returns the index of the first NaN.

Input Parameters
n

Specifies the number of elements in vector x.

x

Array, size at least (1+(n-1)*abs(incx)).

incx

Specifies the increment for the elements of x.

Return Values

Returns the position of vector element that has the largest absolute value such that x[index-1] has the largest absolute value. The index returned is zero-based.