From 1981ca8c6277bda5fc145ef05e64bc0ca2752718 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Sat, 15 Oct 2016 10:58:41 +0200 Subject: update version and rename rst to md readme --- DESCRIPTION | 2 +- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 70 -------------------------------------------------------- cran-comments.md | 11 +++++++++ 4 files changed, 82 insertions(+), 71 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/DESCRIPTION b/DESCRIPTION index 9920125..f2326d1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: SyncRNG -Version: 1.1.1 +Version: 1.2.0 Date: 2016-10-12 Title: A Synchronized Tausworthe RNG for R and Python Author: Gertjan van den Burg diff --git a/README.md b/README.md new file mode 100644 index 0000000..08afc28 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +======= +SyncRNG +======= +A synchronized Tausworthe RNG usable in R and Python. + +Why? +==== + +This program was created because it was desired to have the same random +numbers in both R and Python programs. Although both languages implement a +Mersenne-Twister RNG, the implementations are so different that it is not +possible to get the same random numbers with the same seed. + +SyncRNG is a Tausworthe RNG implemented in ``syncrng.c``, and linked to both R +and Python. Since both use the same underlying C code, the random numbers will +be the same in both languages, provided the same seed is used. + +How +=== + +First install the packages as stated under Installation. Then, in Python you +can do:: + + from SyncRNG import SyncRNG + + s = SyncRNG(seed=123456) + for i in range(10): + print(s.randi()) + +Similarly, after installing the R library you can do in R:: + + library(SyncRNG) + + s <- SyncRNG(seed=123456) + for (i in 1:10) { + cat(s$randi(), '\n') + } + +You'll notice that the random numbers are indeed the same. + +Installation +============ + +Installing the R package can be done through CRAN:: + + install.packages('SyncRNG') + +The Python package can be installed using pip:: + + pip install syncrng + + +Usage +===== + +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``. + +Notes +===== + +The random numbers are uniformly distributed on ``[0, 2^32 - 1]``. + + diff --git a/README.rst b/README.rst deleted file mode 100644 index 08afc28..0000000 --- a/README.rst +++ /dev/null @@ -1,70 +0,0 @@ -======= -SyncRNG -======= -A synchronized Tausworthe RNG usable in R and Python. - -Why? -==== - -This program was created because it was desired to have the same random -numbers in both R and Python programs. Although both languages implement a -Mersenne-Twister RNG, the implementations are so different that it is not -possible to get the same random numbers with the same seed. - -SyncRNG is a Tausworthe RNG implemented in ``syncrng.c``, and linked to both R -and Python. Since both use the same underlying C code, the random numbers will -be the same in both languages, provided the same seed is used. - -How -=== - -First install the packages as stated under Installation. Then, in Python you -can do:: - - from SyncRNG import SyncRNG - - s = SyncRNG(seed=123456) - for i in range(10): - print(s.randi()) - -Similarly, after installing the R library you can do in R:: - - library(SyncRNG) - - s <- SyncRNG(seed=123456) - for (i in 1:10) { - cat(s$randi(), '\n') - } - -You'll notice that the random numbers are indeed the same. - -Installation -============ - -Installing the R package can be done through CRAN:: - - install.packages('SyncRNG') - -The Python package can be installed using pip:: - - pip install syncrng - - -Usage -===== - -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``. - -Notes -===== - -The random numbers are uniformly distributed on ``[0, 2^32 - 1]``. - - diff --git a/cran-comments.md b/cran-comments.md index 4dc64c6..2d3f44a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,5 +1,16 @@ ## Test environments * local Arch Linux install, R 3.3.1 +* win-builder (devel and release) ## R CMD check results +There were no ERRORs or WARNINGs. + +There was 1 NOTE: + +* checking CRAN incoming feasibility ... NOTE + Maintainer: ‘Gertjan van den Burg ’ + + New submission + + Non-FOSS package license (file LICENSE) -- cgit v1.2.3