计算变量的幂函数,变量和幂次以及结果均为向量。
C interface:
void vspow(const int len, const float* src1, const float* src2, float* dst);
void vdpow(const int len, const double* src1, const double* src2, double* dst);
void vcpow(const int len, const float complex *src1, const float complex *src2, float complex *dst);
void vzpow(const int len, const double complex *src1, const double complex *src2, double complex *dst);
Fortran interface:
CALL VSPOW(LEN, SRC1, SRC2, DST);
CALL VDPOW(LEN, SRC1, SRC2, DST);
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
len |
整型数 |
表示输入向量的元素个数。 len≤0时会提示len无效并返回。 |
输入 |
src1 |
|
输入向量src1,向量长度为len。 若为空指针,会提示空指针错误并返回。 |
输入 |
src2 |
|
输入向量src2,向量长度为len。 若为空指针,会提示空指针错误并返回。 |
输入 |
dst |
|
输出向量dst,向量长度为len。 若为空指针,会提示空指针错误并返回。 |
输出 |
C: "kvml.h"
C interface:
#define N 4 const float src1[N] = {-2.2f, 1.0f, +INFINITY, -0.0f}; const float src2[N] = {+2.0f, 111.0f, +1.1f, -6.9f}; float dst[N] = {0}; vspow(N, src1, src2, dst); printFArr("input1:", N, src1); printFArr("input2:", N, src2); printFArr("output:", N, dst); /** * input1: -2.200 1.000 inf -0.000 * input2: 2.000 111.000 1.100 -6.900 * output: 4.840 1.000 inf inf */
Fortran interface:
INTEGER :: LEN = 4 REAL(4) SRC1(4) REAL(4) SRC2(4) REAL(4) DST(4) DATA SRC1 /1.2, 2.5, 2.4, 3.6/ DATA SRC2 /8.6, -2.5, 1.7, 1.3/ CALL VSPOW(LEN, SRC1, SRC2, DST) ! ! OUTPUT DST: ! 4.79688072, 0.101192884, 4.42954540, 5.28680420 !