CMSIS-DSP  
CMSIS DSP Software Library
Vector sorting algorithms

Functions

void arm_merge_sort_f32 (const arm_merge_sort_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
 
void arm_merge_sort_init_f32 (arm_merge_sort_instance_f32 *S, arm_sort_dir dir, float32_t *buffer)
 
void arm_sort_f32 (const arm_sort_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
 Generic sorting function. More...
 
void arm_sort_init_f32 (arm_sort_instance_f32 *S, arm_sort_alg alg, arm_sort_dir dir)
 

Description

Sort the elements of a vector

There are separate functions for floating-point, Q31, Q15, and Q7 data types.

Function Documentation

◆ arm_merge_sort_f32()

void arm_merge_sort_f32 ( const arm_merge_sort_instance_f32 S,
float32_t pSrc,
float32_t pDst,
uint32_t  blockSize 
)
Parameters
[in]Spoints to an instance of the sorting structure.
[in]pSrcpoints to the block of input data.
[out]pDstpoints to the block of output data
[in]blockSizenumber of samples to process.
Algorithm
The merge sort algorithm is a comparison algorithm that divide the input array in sublists and merge them to produce longer sorted sublists until there is only one list remaining.
A work array is always needed. It must be allocated by the user
linked to the instance at initialization time.
It's an in-place algorithm. In order to obtain an out-of-place
function, a memcpy of the source vector is performed

◆ arm_merge_sort_init_f32()

void arm_merge_sort_init_f32 ( arm_merge_sort_instance_f32 S,
arm_sort_dir  dir,
float32_t buffer 
)
Parameters
[in,out]Spoints to an instance of the sorting structure.
[in]dirSorting order.
[in]bufferWorking buffer.

◆ arm_sort_f32()

void arm_sort_f32 ( const arm_sort_instance_f32 S,
float32_t pSrc,
float32_t pDst,
uint32_t  blockSize 
)
Parameters
[in]Spoints to an instance of the sorting structure.
[in]pSrcpoints to the block of input data.
[out]pDstpoints to the block of output data.
[in]blockSizenumber of samples to process.

◆ arm_sort_init_f32()

void arm_sort_init_f32 ( arm_sort_instance_f32 S,
arm_sort_alg  alg,
arm_sort_dir  dir 
)
Parameters
[in,out]Spoints to an instance of the sorting structure.
[in]algSelected algorithm.
[in]dirSorting order.