reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
rand_utils.h File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

void perturb (int *src, size_t size, int *out)
 Ensures that the expectation of each entry of out is equal to the corresponding entry of src. Assumes that a random seed has already been set using srand.
 

Function Documentation

◆ perturb()

void perturb ( int * src,
size_t size,
int * out )

Ensures that the expectation of each entry of out is equal to the corresponding entry of src. Assumes that a random seed has already been set using srand.

Parameters
srcAn array of integers of size size.
sizeThe size of both src and out.
outAn array of integers of size size.