i?amin
The real number vector returns the index value of the minimum absolute value, and the complex number vector returns the minimum 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_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
The real number vector returns the index value of the minimum absolute value, and the complex number vector returns the minimum 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_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