#include <bmrandom.h>
Public Member Functions | |
| random_subset () | |
| ~random_subset () | |
| void | sample (BV &bv_out, const BV &bv_in, unsigned count) |
| Get random subset of input vector. | |
Class implements algorithm for random subset generation.
Implemented method tries to be fair, but doesn't guarantee true randomeness.
Performace note: Class holds temporary buffers and variables, so it is recommended to re-use instances over multiple calls.
Definition at line 53 of file bmrandom.h.
| bm::random_subset< BV >::random_subset | ( | ) | [inline] |
Definition at line 115 of file bmrandom.h.
| bm::random_subset< BV >::~random_subset | ( | ) | [inline] |
Definition at line 125 of file bmrandom.h.
| void bm::random_subset< BV >::sample | ( | BV & | bv_out, | |
| const BV & | bv_in, | |||
| unsigned | count | |||
| ) | [inline] |
Get random subset of input vector.
| bv_out | - destination vector | |
| bv_in | - input vector | |
| count | - number of bits to pick |
Definition at line 134 of file bmrandom.h.
Referenced by main().
1.6.1