Any efficient building function in C++/C to fast uniformly sample b entries without replacement from n entries?
It seems that, using shuffle(Index, Index+n, g) before getting the first b entries is still not efficient when n is very big but b is very small, where Index is a vector/array storing 0 ... (n-1).
Aucun commentaire:
Enregistrer un commentaire