Generate uniformly distributed random number from interval [0,1[. More...
Go to the source code of this file.
Functions | |
my_bool | rand_mt_init (UDF_INIT *initid, UDF_ARGS *args, char *message) |
Called before first usage of function. More... | |
double | rand_mt (UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) |
Retrieve Mersenne Twister random number. More... | |
void | rand_mt_deinit (UDF_INIT *initid) |
Called after last access to function. More... | |
Generate uniformly distributed random number from interval [0,1[.
CREATE FUNCTION rand_mt RETURNS REAL SONAME 'libsqlstat.so'; SELECT rand_mt() FROM mytab; DROP FUNCTION rand_mt;
Definition in file rand_mt.cc.
double rand_mt | ( | UDF_INIT * | initid, |
UDF_ARGS * | args, | ||
char * | is_null, | ||
char * | error | ||
) |
Retrieve Mersenne Twister random number.
A double random number in the range [0,1[ is generated. It has 53 random bits.
initid | function description |
args | argument values |
is_null | result is NULL |
error | error message |
Definition at line 81 of file rand_mt.cc.
rand_mt_deinit | ( | UDF_INIT * | initid | ) |
Called after last access to function.
Deallocate memory for counter and sums.
initid |
Definition at line 92 of file rand_mt.cc.
my_bool rand_mt_init | ( | UDF_INIT * | initid, |
UDF_ARGS * | args, | ||
char * | message | ||
) |
Called before first usage of function.
Checksparameters.
Indicate type of return value.
initid | function description |
args | parameters |
message | error message |
Definition at line 48 of file rand_mt.cc.