Loading...
Searching...
No Matches
volk_32f_index_min_32u

Overview

Returns Argmin_i x[i]. Finds and returns the index which contains the first minimum value in the given vector.

Dispatcher Prototype

void volk_32f_index_min_32u(uint32_t* target, const float* source, uint32_t num_points)

Inputs

- source: The input vector of floats.
- num_points: The number of data points.

Outputs

- target: The index of the first minimum value in the input buffer.

Example

int N = 10;
uint32_t alignment = volk_get_alignment();
float* in = (float*)volk_malloc(sizeof(float)*N, alignment);
uint32_t* out = (uint32_t*)volk_malloc(sizeof(uint32_t), alignment);
for(uint32_t ii = 0; ii < N; ++ii){
float x = (float)ii;
// a parabola with a minimum at x=4
in[ii] = (x-4) * (x-4) - 5;
}
volk_32f_index_min_32u(out, in, N);
printf("minimum is %1.2f at index %u\n", in[*out], *out);
volk_free(in);
volk_free(out);