diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-30 16:07:50 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-30 16:07:50 +0200 |
| commit | dec32e1516a05db805ff75a9e016e8bea04d1d8e (patch) | |
| tree | 1087efc189d5ca533ac01fec6746347212d66202 /Tausworthe.R | |
| parent | added readme (diff) | |
| download | SyncRNG-dec32e1516a05db805ff75a9e016e8bea04d1d8e.tar.gz SyncRNG-dec32e1516a05db805ff75a9e016e8bea04d1d8e.zip | |
name change to SyncRNG and documentation in the .c file
Diffstat (limited to 'Tausworthe.R')
| -rw-r--r-- | Tausworthe.R | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/Tausworthe.R b/Tausworthe.R deleted file mode 100644 index e4fe355..0000000 --- a/Tausworthe.R +++ /dev/null @@ -1,45 +0,0 @@ -library(methods) - -dyn.load('tausR.so') - -TauswortheRNG <- setRefClass('TauswortheRNG', - fields=list( - seed='numeric', - state='numeric' - ), - methods=list( - initialize=function(..., seed=0) { - seed <<- seed - tmp <- .Call('R_tausworthe_seed', - as.integer(seed)) - state <<- tmp[1:4] - callSuper(...) - }, - randi=function() { - tmp <- .Call('R_tausworthe_rand', - as.integer(state)) - state <<- tmp[1:4] - return(tmp[5]) - }, - rand=function() { - r <- randi() - return (r * 2.3283064365387e-10) - } - ) - ) - -taus.seed <- function(seed=0) -{ - t <- TauswortheRNG(seed=seed) - return(t) -} - -taus.rand <- function(t) -{ - return(t$rand()) -} - -taus.randi <- function(t) -{ - return(t$randi()) -} |
