Rate This Document
Findability
Accuracy
Completeness
Readability

v?cis

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

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, the system prompts a null pointer error.

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, the system prompts a null pointer error.

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

Dependency

C: "kvml.h"

Example

C interface:

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