1: // random_sample -- Make a random sample of a set n integers from the interval [0..N]

  3: #ifndef __random_sample__H__
  4: #define __random_sample__H__

  6: #include "prng.H"


  9: extern void sample(prng rand, long* slot, long n, long N); // take a random sample

 11: class random_sample {                            // make a random sample

 13: private:

 15:   long* slot;

 17: public:

 19:   random_sample(prng rand, long n, long N);      // construct a random sample

 21:   ~random_sample();                              // destroy a random sample

 23:   long operator()(long i);                       // fetch random_sample[i]

 25: };

 27: #endif //  __random_sample__H__