Hi, does not work because Xiao-Yong is looking for a portable solution. A simple and fast - although not portable - solution is this: 1. write your favourite RNG in C/C++ (ie. copy the source code from Numerical Recipes and write the random number, say 8 bytes each, to stdout, 2. popen() the C/C++ program with ⎕FIO like: Handle←⎕FIO[24] 'path-to-the-C-program' Every chunk of 8 bytes fread() with, say, 256⊥8 ⎕FIO[6] Handle will then be one (signed) random number. You can also read several random numbers in one go). The above essentially pipes the output of your C/C++ RND directly into GNU APL. The code below will probably run faster if you can avoid to convert between integers and bit vectors too often (like in bit∆mult) and pre-compute constants like (⌽¯1+⍳64) beforehand. /// Jürgen On 05/18/2016 05:44 PM, Elias Mårtenson
wrote:
|
- Re: [Bug-apl] RNG Juergen Sauermann
- Re: [Bug-apl] RNG Juergen Sauermann
- Re: [Bug-apl] RNG Xiao-Yong Jin
- Re: [Bug-apl] RNG Juergen Sauermann
- Re: [Bug-apl] RNG Kacper Gutowski
- Re: [Bug-apl] RNG Juergen Sauermann
- Re: [Bug-apl] RNG Xiao-Yong Jin
- Re: [Bug-apl] RNG Kacper Gutowski