From 4fc568eb07548bd5d08bfefbfd84472af4b062ee Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 6 Aug 2015 13:07:32 +0200 Subject: update readme, bump version to 1.0, store first 1000 for future reference --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2e70f8b..b222cfb 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,8 @@ be the same in both languages, provided the same seed is used. How --- -First install the packages as stated under Installation. Then, in a Python -script located in the same directory as `syncrng.so` and `SyncRNG.py`, you can -do: +First install the packages as stated under Installation. Then, in Python you +can do: ```python from SyncRNG import SyncRNG @@ -30,8 +29,7 @@ for i in range(10): print(s.randi()) ``` -Similarly, in an R script located in the same directory as `RSyncRNG.so` and -`SyncRNG.R`, you can do: +Similarly, after installing the R library you can do in R: ```R library(SyncRNG) @@ -66,14 +64,20 @@ or system-wide through: sudo python setup.py install ``` -Notes +Usage ----- -The random numbers are uniformly distributed on `[0, 2^32 - 1]`. +In both R and Python the following methods are available for the `SyncRNG` +class: +1. `randi()`: generate a random integer on the interval [0, 2^32). +2. `rand()`: generate a random floating point number on the interval [0.0, + 1.0) +3. `randbelow(n)`: generate a random integer below a given integer `n`. +4. `shuffle(x)`: generate a permutation of a given list of numbers `x`. -TODO ----- +Notes +----- + +The random numbers are uniformly distributed on `[0, 2^32 - 1]`. -It may be easier to provide system-wide installation through an R package and -a Python module. -- cgit v1.2.3