我要评分
获取效率
正确性
完整性
易理解

v?powx

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, the system displays a message indicating that the value of len is invalid.

Input

src1

  • Single-precision floating-point type for vspowx
  • Double-precision floating-point type for vdpowx
  • Single-precision floating-point complex type for vcpowx
  • Double-precision floating-point complex type for vzpowx

Input vector src1 with length len.

If the pointer is null, the system prompts a null pointer error.

Input

src2

  • Single-precision floating-point type for vspowx
  • Double-precision floating-point type for vdpowx
  • Single-precision floating-point complex type for vcpowx
  • Double-precision floating-point complex type for vzpowx

Indicates the power, which is of the scalar type.

Input

dst

  • Single-precision floating-point type for vspowx
  • Double-precision floating-point type for vdpowx
  • Single-precision floating-point complex type for vcpowx
  • Double-precision floating-point complex type for vzpowx

Output vector dst with length len.

If the pointer is null, the system prompts a null pointer error.

Output

Return Value

For details, see v?pow.

Dependencies

C: "kvml.h"

Examples

C interface:

    #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
     */