1: // sample -- Make a random permutation of the contents of an array. 3: #ifndef __permuted_sample__H__ 4: #define __permuted_sample__H__ 7: #include "prng.H" 8: #include "random_sample.H" 11: void permute(prng rand, long* slot, long n); // permute the contents of an array 14: class permuted_sample { 16: private: 18: long* slot; 20: public: 22: permuted_sample(prng rand, long n, long N); // construct a permuted sample 24: ~permuted_sample(); // destroy a permuted sample 26: long operator()(long i); // fetch permuted_sample[i] 28: }; 30: #endif // __permuted_sample__H__