lab_ml
Lazy Machine Learning
|
Provides random functionality per a given seed. More...
#include <random.h>
Public Member Functions | |
Random (unsigned long seed) | |
Constructor. More... | |
int | nextInt () |
template<class T > | |
void | shuffle (vector< T > &array) |
Randomly shuffles a vector with the current seed state. More... | |
template<class T > | |
void | shuffle (vector< T > &array) |
Randomly shuffles a vector with the current seed state. More... | |
Private Member Functions | |
bool | LFSR () |
This function is taken from Bruce Schneier's \emph{Applied Cryptography}. More... | |
Private Attributes | |
unsigned long | shiftRegister |
Provides random functionality per a given seed.
This is useful when you want predictably random things, like for grading.
|
inline |
Constructor.
seed | - seed to initialize the RNG |
|
inlineprivate |
This function is taken from Bruce Schneier's \emph{Applied Cryptography}.
|
inline |
void Random::shuffle | ( | vector< T > & | array | ) |
Randomly shuffles a vector with the current seed state.
array | - the vector to shuffle |
void Random::shuffle | ( | vector< T > & | array | ) |
Randomly shuffles a vector with the current seed state.
array | - the vector to shuffle |