mardi 1 août 2023

Get a sequence of samples (w/o replacement) in order given the range and number of samples in C++ [closed]

I want to sample without replacement a range but I don't want to materialize all the samples in memory. In other words I want to first get the minimum sample, given that and the number of remaining samples to get the next one etc.

Fundamentally I want a function with the following signature.

int next_sample(int prev_sample, int upper_bound, int remaining_samples);



Aucun commentaire:

Enregistrer un commentaire