Initializes a RandomSample struct for random sampling from the given range using the generator specified by gen.
Initializes a RandomSample struct for random sampling from the given range using the generator specified by gen.