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

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.