Rate This Document
Findability
Accuracy
Completeness
Readability

v?ln

Interface Definition

C interface:

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

void vdln(const int len, const double* src, double* dst);

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

void vzln(const int len, const double complex *src, double complex *dst);

Fortran interface:

CALL VSLN(LEN, SRC, DST);

CALL VDLN(LEN, SRC, 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 vsln
  • Double-precision floating-point type for vdln
  • Single-precision floating-point complex type for vcln
  • Double-precision floating-point complex type for vzln

Input vector src with length len.

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

Input

dst

  • Single-precision floating-point type for vsln
  • Double-precision floating-point type for vdln
  • Single-precision floating-point complex type for vcln
  • Double-precision floating-point complex type for vzln

Output vector dst with length len.

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

Output

Return Value

  • Return the result of .
  • For vsln and vdln, special output values are listed in the following table.

    Input Value (src)

    Output Value (dst)

    ±0

    -inf

    <0

    nan

    +inf

    +inf

    nan

    nan

  • For vcln and vzln, special output values are listed in vcln&vzln.xlsx.

Dependencies

C: "kvml.h"

Examples

C interface:

    int i, len = 4; 
    float src[len] = {0.0f, 1.0f, inf, nan}; 
    float* dst = (float*)malloc(sizeof(float) * len); 
    if (dst == NULL) { 
        printf("Malloc Failed!\n"); 
        return 0; 
    } 
    vsln(len, src, dst); 
    /** 
     *  Output dst: 
     *     -inf  0  inf  nan 
     * 
     */

Fortran interface:

    INTEGER :: LEN = 4 
    REAL(4) SRC(4)  
    REAL(4) DST(4) 
    DATA SRC /1, 2, 3, 4/ 
    CALL VSLN(LEN, SRC, DST) 
    !  
    ! OUTPUT DST: 
    !     0.00000000, 0.693147182, 1.09861231, 1.38629436 
    !