NMSIS-DSP  Version 1.3.1
NMSIS DSP Software Library

Cosine distance. More...

Functions

RISCV_DSP_ATTRIBUTE float16_t riscv_cosine_distance_f16 (const float16_t *pA, const float16_t *pB, uint32_t blockSize)
 Cosine distance between two vectors. More...
 
RISCV_DSP_ATTRIBUTE float32_t riscv_cosine_distance_f32 (const float32_t *pA, const float32_t *pB, uint32_t blockSize)
 Cosine distance between two vectors. More...
 
RISCV_DSP_ATTRIBUTE float64_t riscv_cosine_distance_f64 (const float64_t *pA, const float64_t *pB, uint32_t blockSize)
 Cosine distance between two vectors. More...
 

Detailed Description

Cosine distance.

Function Documentation

◆ riscv_cosine_distance_f16()

RISCV_DSP_ATTRIBUTE float16_t riscv_cosine_distance_f16 ( const float16_t *  pA,
const float16_t *  pB,
uint32_t  blockSize 
)

Cosine distance between two vectors.

Parameters
[in]pAFirst vector
[in]pBSecond vector
[in]blockSizevector length
Returns
distance
Description
cosine_distance(u,v) is 1 - u . v / (Norm(u) Norm(v))

◆ riscv_cosine_distance_f32()

RISCV_DSP_ATTRIBUTE float32_t riscv_cosine_distance_f32 ( const float32_t pA,
const float32_t pB,
uint32_t  blockSize 
)

Cosine distance between two vectors.

Parameters
[in]pAFirst vector
[in]pBSecond vector
[in]blockSizevector length
Returns
distance
Description
cosine_distance(u,v) is 1 - u . v / (Norm(u) Norm(v))

◆ riscv_cosine_distance_f64()

RISCV_DSP_ATTRIBUTE float64_t riscv_cosine_distance_f64 ( const float64_t pA,
const float64_t pB,
uint32_t  blockSize 
)

Cosine distance between two vectors.

Parameters
[in]pAFirst vector
[in]pBSecond vector
[in]blockSizevector length
Returns
distance