i?amin
Return the index of the minimum absolute value of a real number vector, and return the index of the minimum sum of the absolute values of the real part and the imaginary part of a complex number vector.
Interface Definition
C interface:
CBLAS_INDEX cblas_isamin(const BLASINT n, const float *x, const BLASINT incx);
CBLAS_INDEX cblas_idamin(const BLASINT n, const double *x, const BLASINT incx);
CBLAS_INDEX cblas_icamin(const BLASINT n, const void *x, const BLASINT incx);
CBLAS_INDEX cblas_izamin(const BLASINT n, const void *x, const BLASINT incx);
Fortran interface:
INDEX = ISAMIN(N, X, INCX)
INDEX = IDAMIN(N, X, INCX)
INDEX = ICAMIN(N, X, INCX)
INDEX = IZAMIN(N, X, INCX)
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
n |
Integer |
Number of elements in the x vector. |
Input |
x |
|
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
For a real number vector, the index of the minimum absolute value is returned. For a complex number vector, the index of the minimum sum of the absolute values of the real part and the imaginary part is returned. It is of the CBLAS_INDEX type.
Dependency
#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_isamin(n, x, incx);
/**
* Output: 1
*/
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 ISAMIN
INDEX=ISAMIN(N, X, INCX)
* Output : 1