Rate This Document
Findability
Accuracy
Completeness
Readability

v?cis

Compute the complex result of , where the input parameter x is a real vector.

Interface Definition

C interface:

void vccis(const int len, const float *src, float complex *dst);

void vzcis(const int len, const double *src, 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

src

  • Single-precision floating-point type for vccis
  • Double-precision floating-point type for vzcis

Input vector src with length len.

If the pointer is null, a null pointer error is reported and the function returns.

Input

dst

  • Single-precision floating-point complex type for vccis
  • Double-precision floating-point complex type for vzcis

Output vector dst with length len.

If the pointer is null, a null pointer error is reported and the function returns.

Output

Return Value

  • Each operation value returns a complex number whose real part is the cos result and imaginary part is the sin result.
  • For special values, see the following table.

    Input Value (src)

    Real Part of the Output (y.real)

    Imaginary Part of the Output (y.imag)

    +0

    1

    +0

    -0

    1

    -0

    ±inf

    nan

    nan

    nan

    nan

    nan

Dependencies

C: "kvml.h"

Examples

C interface:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    int i, len = 4;
    float src[4] = {0.0f, 2.0f, INFINITY, NAN};
    float complex* dst = (float complex*)malloc(sizeof(float complex) * len);
    if (dst == NULL) {
        printf("Malloc Failed!\n");
        return 0;
    }
    vccis(len, src, dst);
    /** 
     *  Output dst: 
     *     1.000000+0.000000*I -0.416147+0.909297*I nan+nan*I nan+nan*I 
     */