Loading...
Searching...
No Matches
volk_32f_s32f_add_32f

Overview

Adds a floating point scalar to a floating point vector.

Dispatcher Prototype

void volk_32f_s32f_add_32f(float* cVector, const float* aVector, const float scalar,
unsigned int num_points)

Inputs

- aVector: The input vector of floats.
- scalar: the scalar value to add against `aVector`.
- num_points: The number of data points.

Outputs

- cVector: The output vector of floats.

Example

int N = 10;
unsigned int alignment = volk_get_alignment();
float* increasing = (float*)volk_malloc(sizeof(float)*N, alignment);
float* out = (float*)volk_malloc(sizeof(float)*N, alignment);
for(unsigned int ii = 0; ii < N; ++ii){
increasing[ii] = 2.f * ((float)ii / (float)N) - 1.f;
}
// Add addshift to each entry.
float addshift = 5.0f;
volk_32f_s32f_add_32f(out, increasing, addshift, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("out[%u] = %f\n", ii, out[ii]);
}
volk_free(increasing);
volk_free(out);