v?powx
Compute a variable raised to a specified power element-wise. The variable and result are vectors, and the power is a scalar.
Interface Definition
C interface:
void vspowx(const int len, const float* src1, const float src2, float* dst);
void vdpowx(const int len, const double* src1, const double src2, double* dst);
void vcpowx(const int len, const float complex *src1, const float complex src2, float complex *dst);
void vzpowx(const int len, const double complex *src1, const double complex src2, double complex *dst);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
len |
Integer |
Number of elements in the input vector. If len ≤ 0, an invalid parameter error is reported and the function returns. |
Input |
src1 |
|
Input vector src1 with length len. If the pointer is null, a null pointer error is reported and the function returns. |
Input |
src2 |
|
Indicates the power, which is of the scalar type. |
Input |
dst |
|
Output vector dst with length len. If the pointer is null, a null pointer error is reported and the function returns. |
Output |
Return Value
See v?pow.
Dependencies
C: "kvml.h"
Examples
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #define N 4 const float src1[N] = {-2.2f, 1.0f, +INFINITY, -0.0f}; const float src2 = +2.0f; float dst[N] = {0}; vspowx(N, src1, src2, dst); printFArr("input1:", N, src1); printf("src2 = %.3f\n", src2); printFArr("output:", N, dst); /** * input1: -2.200 1.000 inf -0.000 * src2 = 2.000 * output: 4.840 1.000 inf 0.000 */ |