[med-svn] [Git][med-team/tree-puzzle][master] Document changed interface of sprng

Andreas Tille gitlab at salsa.debian.org
Mon Jul 8 15:52:11 BST 2019



Andreas Tille pushed to branch master at Debian Med / tree-puzzle


Commits:
2dce726f by Andreas Tille at 2019-07-08T14:51:48Z
Document changed interface of sprng

- - - - -


1 changed file:

- debian/patches/use_debian_packaged_sprng.patch


Changes:

=====================================
debian/patches/use_debian_packaged_sprng.patch
=====================================
@@ -1,6 +1,55 @@
 Description: Use Debian packaged libsprng
 Author: Andreas Tille <tille at debian.org>
 Last-Update: Mon, 08 Jul 2019 16:47:12 +0200
+  ATTENTION: Please double check the change in src/util.c.
+             The Debian packaged sprng seems to have a different
+             interface for init_sprng (quoting from CHANGES.TEXT):
+             
+                               Changes in Version 2.0
+                  ----------------------
+
+        Using the previous version of SPRNG, a user can use only one of the
+        SPRNG generators in one run of the program. The objective of the new
+        version is to combine the current random number generators (RNGs) into
+        a single library so that a user can use all of them in a single program
+        at a same time.
+   
+        The user now is able to and needs to specify the type of RNG when a
+        random number stream is initialized. We add one integer argument
+        rng_type to the front of the argument list of the function init_sprng.
+
+        int *init_sprng(int rng_type, 
+                int stream_number, int nstreams, int seed, int rng_parameter) 
+           SPRNG_POINTER init_sprng(integer rng_type,
+                           integer streamnum, integer nstreams,
+                           integer seed, integer param)
+
+
+        User can sprcify one of the follows for rng_type:
+         SPRNG_LFG 
+         SPRNG_LCG 
+         SPRNG_LCG64 
+         SPRNG_CMRG 
+         SPRNG_MLFG 
+         SPRNG_PMLCG 
+        The following macros are added to sprng.h and sprng_f.h:
+
+        #define SPRNG_LFG       0
+        #define SPRNG_LCG       1
+        #define SPRNG_LCG64 2
+        #define SPRNG_CMRG      3
+        #define SPRNG_MLFG      4
+        #define SPRNG_PMLCG 5
+
+        For simple interface, a user can only have one random number stream at
+        one time since he doesn't specify stream ID.  
+        The default generator is "SPRNG_LFG".
+        User still can change RNG at runtime by calling init_sprng:
+        int *init_sprng(int rng_type, 
+                int seed, int rng_parameter) 
+           SPRNG_POINTER init_sprng(integer rng_type,
+                           integer seed, integer param)
+
 
 --- a/src/Makefile.am
 +++ b/src/Makefile.am



View it on GitLab: https://salsa.debian.org/med-team/tree-puzzle/commit/2dce726f58c9cbc70d83a05d3b8f954e83bd2807

-- 
View it on GitLab: https://salsa.debian.org/med-team/tree-puzzle/commit/2dce726f58c9cbc70d83a05d3b8f954e83bd2807
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190708/10e79def/attachment-0001.html>


More information about the debian-med-commit mailing list