Re: [Bug-apl] RNG

2016-05-18 Thread Kacper Gutowski
On Thu, May 19, 2016 at 12:37 AM, Xiao-Yong Jin wrote: > Now, > (22⍴8)⊤2⊥63⍴1 > 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > Dyalog does the same thing. > Can someone please explain to me why? Because the result of ⊥ doesn't fit into integer and it gets converted to a floating point numbe

[Bug-apl] ravel with axis - assertion failed

2016-05-18 Thread Louis de Forcrand
t 0 0 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 1 0 ,[3 4],⌿⊃(⊂T)×(1⌽[2]T)(1⌽T←¯1+2×t) == Assertion failed: r < rho_rho in Function: get_shape_item in file: ./Shape.hh:105 Call sta

[Bug-apl] ravel with axis - assertion failed

2016-05-18 Thread Louis de Forcrand
∇E[⎕]∇ ∇ [0] λ←E ⍵ [1] λ←+/,⍤¯1⊃,/(⊂T)×(1⌽[2]T)(1⌽T←¯1+2×⍵) ∇ E←{+/⍪⊃,/(⊂T)×(1⌽[2]T)(1⌽T←¯1+2×⍵)} E t 4 ¯4 ∇E2[⎕]∇ SEGMENTATION FAULT -- Stack trace at main.cc:63 ---

[Bug-apl] ravel with axis - assertion failed

2016-05-18 Thread Louis de Forcrand
E2←E E2 SYNTAX ERROR E2 ^ → ∇E2[⎕]∇ ∇ [0] λ←E ⍵ [1] λ←+/,⍤¯1⊃,/(⊂T)×(1⌽[2]T)(1⌽T←¯1+2×⍵) ∇ E2 t == Assertion failed: get_ValueType() == TV_FUN in Function

Re: [Bug-apl] RNG

2016-05-18 Thread Xiao-Yong Jin
Now, (22⍴8)⊤2⊥63⍴1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Dyalog does the same thing. Can someone please explain to me why? > On May 18, 2016, at 1:09 PM, Juergen Sauermann > wrote: > > Hi Kacper, > > yes, thanks. Fixed in *SVN 729*. > > /// Jürgen > > > On 05/18/2016 07:29 PM,

Re: [Bug-apl] RNG

2016-05-18 Thread Xiao-Yong Jin
We need reproducibility, so /dev/urandom isn’t an option. ⎕FIO is a wonderful thing in gnu apl. I still want something easy to manipulate in apl so I can play with different ideas easily. > On May 18, 2016, at 11:56 AM, Juergen Sauermann > wrote: > > Hi Elias, > > yes, even better! I was thin

[Bug-apl] An other question about "⍶"

2016-05-18 Thread Christian Robert
Looking at https://www.youtube.com/watch?v=DmT80OseAGs Every thing goes fine (when he says "take" and use "⊃" you write "↑" instead in gnuapl) [...] 88 {⍺ ⍵} s44 88 ┌→──┐ ↓0 0 0 0│ │0 0 2 1│ │3 0 0 4│ │0 0 0 0│ └───┘ at the minute 03:41 it fail with a syntax e

Re: [Bug-apl] RNG

2016-05-18 Thread Juergen Sauermann
Hi Kacper, yes, thanks. Fixed in *SVN 729*. /// Jürgen On 05/18/2016 07:29 PM, Kacper Gutowski wrote: On Wed, May 18, 2016 at 5:09 PM, Xiao-Yong Jin wrote: (...) relying on ¯1=2⊥64⍴1 (always a 64-bit signed integer), for which Dyalog does differently. I think this is a bug. -k

Re: [Bug-apl] RNG

2016-05-18 Thread Kacper Gutowski
On Wed, May 18, 2016 at 5:09 PM, Xiao-Yong Jin wrote: (...) > relying on ¯1=2⊥64⍴1 (always a 64-bit signed integer), for which Dyalog > does differently. I think this is a bug. -k

Re: [Bug-apl] RNG

2016-05-18 Thread Juergen Sauermann
Hi Elias, yes, even better! I was thinking of */dev/random *but that one blocks immediately due to lack of entropy. /// Jürgen On 05/18/2016 06:41 PM, Elias Mårtenson wrote: In that case, one can just open /dev/urandom and read random data from there. That algorithm is supposed to be cryp

Re: [Bug-apl] RNG

2016-05-18 Thread Juergen Sauermann
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 wr

Re: [Bug-apl] RNG

2016-05-18 Thread Elias Mårtenson
In that case, one can just open /dev/urandom and read random data from there. That algorithm is supposed to be cryptographically secure. On 19 May 2016 12:39 a.m., "Juergen Sauermann" < juergen.sauerm...@t-online.de> wrote: > Hi, > > does not work because Xiao-Yong is looking for a portable solut

Re: [Bug-apl] RNG

2016-05-18 Thread Elias Mårtenson
How about implementing this as a native quad-function? On 18 May 2016 at 23:09, Xiao-Yong Jin wrote: > I translated a simple RNG from the book, Numerical Recipes. APL code is > slow, probably because of the bit operations. The bit operations are not > portable, relying on ¯1=2⊥64⍴1 (always a 6

Re: [Bug-apl] RNG

2016-05-18 Thread Xiao-Yong Jin
I translated a simple RNG from the book, Numerical Recipes. APL code is slow, probably because of the bit operations. The bit operations are not portable, relying on ¯1=2⊥64⍴1 (always a 64-bit signed integer), for which Dyalog does differently. I’d welcome some suggestions. Full code follows

Re: [Bug-apl] A question.

2016-05-18 Thread Louis de Forcrand
⍶ is the left argument to a monadic or dyadic operator that takes a function as an argument AND one or two actual arguments. ⍹ is the right (optional) second argument. Keep in mind that these can also be data, not just a function. A couple of other examples: -foldleft 1 2 3 4 5 <—> 1-(2-(3-(4-5))

Re: [Bug-apl] A question.

2016-05-18 Thread David Tran
Thanks for the question. As newbie, now i learned ]help and also ⍶ ⍹ I was on the "research" of how to define user operator too. I like ⍶ ⍹ better than Dyalog's ⍺⍺ and ⍵⍵ because { ⍺⍺⍺⍵⍵⍵ } will return a vector of ⍺ ⍺ ⍺ ⍵ ⍵ ⍵ on GNU APL, with Dyalog, one has to add "space" to not confuse with oper