Interface RNG
access this type via: io.compute.apps.RNG (provides, requires or uses)
A set of functions for generating random vectors and matrices. CAUTION: Please inspect the underlying implemetation of this interface before using the pseudo-random numbers for security sensitive applications!
Functions
RNG()
void setSeed(int seed)
dec[][] randomMatrixDec(int rows, int cols, dec lo, dec hi)
int[][] randomMatrixInt(int rows, int cols, int lo, int hi)
dec[] randomVectorDec(int len, dec lo, dec hi)
int[] randomVectorInt(int len, int lo, int hi)
RNG()
Allows the implementing component to initialise any external compute device it intends to use
void setSeed(int seed)
Set a 'seed' value for the underlying random number generator. Depending on the implementing component and your intended use case, this value should be something like the current time
dec[][] randomMatrixDec(int rows, int cols, dec lo, dec hi)
Returns a decimal matrix of 'rows' number of rows and 'cols' number of columns which cells are populated with psedo-random numbers between 'lo' and 'hi' in value
int[][] randomMatrixInt(int rows, int cols, int lo, int hi)
Returns a integer matrix of 'rows' number of rows and 'cols' number of columns which cells are populated with pseudo-random numbers between 'lo' and 'hi' in value
dec[] randomVectorDec(int len, dec lo, dec hi)
Returns a 'len' dimensional decimal vector for which its cells are populated with pseudo-random numbers between 'lo' and 'hi' in value
int[] randomVectorInt(int len, int lo, int hi)
Returns a 'len' dimensional integer vector for which its cells are populated with pseudo-random numbers between 'lo' and 'hi' in value