i?amin
实数向量返回最小绝对值的索引值,复数向量返回实部绝对值和虚部绝对值之和的最小值索引值。
接口定义
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)
参数
| 参数名 | 类型 | 描述 | 输入/输出 | 
|---|---|---|---|
| n | 整型数 | 表示x向量的元素个数。 | 输入 | 
| x | 
 | 向量x,向量规模至少是(1+(n-1)*abs(incX))。 | 输入 | 
| incx | 整型数 | 表示x向量增长步长。 | 输入 | 
返回值
实数向量返回最小绝对值的索引值,复数向量返回实部绝对值和虚部绝对值之和的最小值索引值。CBLAS_INDEX类型。
依赖
#include "kblas.h"
示例
C interface:
| 1 2 3 4 5 6 7 8 9 10 11 | 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
父主题: KML_BLAS Level 1函数