random generator that can be used in multithreaded contexts More...
#include <utils.h>
Public Member Functions | |
| int | rand_int () |
| random 31-bit positive integer | |
| long | rand_long () |
| random long < 2 ^ 62 | |
| int | rand_int (int max) |
| generate random number between 0 and max-1 More... | |
| float | rand_float () |
| between 0 and 1 | |
| double | rand_double () |
| RandomGenerator (long seed=1234) | |
| initialize | |
| RandomGenerator (const RandomGenerator &other) | |
| default copy constructor messes up pointer in rand_data | |
| int faiss::RandomGenerator::rand_int | ( | int | max | ) |
generate random number between 0 and max-1
The definition of random functions depends on the architecture:
Unfortunately, system designers are more concerned with making the most unpredictable random sequences for cryptographic use, when in scientific contexts what acutally matters is having reproducible squences in multi-threaded contexts.
1.8.5