Re: [Jprogramming] apply iteratively

2017-08-10 Thread Raul Miller
timing differences are sort of normal because computers have lots of other things going on: timespacex '+:^:(1e5 1) 2' 0.005421 12160 timespacex '+:^:(1e5 1e4) 2' 0.003509 12160 timespacex '+:^:(1e5 1e4) 2' 0.004045 12160 FYI, -- Raul On Thu, Aug 10, 2017 at 3:28 PM, 'Pascal Jasmin'

Re: [Jprogramming] apply iteratively

2017-08-10 Thread 'Pascal Jasmin' via Programming
performance measurements imply that it doesn't duplicate it, a =. |. 4 }. i.63 20 timespacex 'a { +: ^: (<63 ) 2' 2.168e_5 40832 20 timespacex ' +: ^: (a ) 2' 1.944e_5 38144 20 timespacex ' +: ^: (63 ) 2' 5.648e_6 1536 these results don't differ by much, but surprised that they do differ.

Re: [Jprogramming] apply iteratively

2017-08-10 Thread Rudolf Sykora
> yes its efficient, simply collecting the results of each iteration > while the function is applied to the "last value". Do you mean that F^:(5 3) y does not do any calculation for the '3' ? Does that mean that the evaluation can't be parallelized, and that it proceeds in order? Or is it even cle

Re: [Jprogramming] apply iteratively

2017-08-10 Thread robert therriault
Hi Ruda, Take a look at the effect of boxed arguments on the Power page of the dictionary. http://www.jsoftware.com/help/dictionary/d202n.htm Your example would become F^:( On Aug 10, 2017, at 7:30 AM, Rudolf Sykora wrote: > > Hello, > > if I want to apply a function F iteratively say 0, 1,

Re: [Jprogramming] apply iteratively

2017-08-10 Thread 'Pascal Jasmin' via Programming
yes its efficient, simply collecting the results of each iteration while the function is applied to the "last value". From: Rudolf Sykora To: programm...@jsoftware.com Sent: Thursday, August 10, 2017 10:30 AM Subject: [Jprogramming] apply i

[Jprogramming] apply iteratively

2017-08-10 Thread Rudolf Sykora
Hello, if I want to apply a function F iteratively say 0, 1, 2, 3 .. N times on y (and see the individual results), I know I can do F^: (i.N) y But is this efficient or not? I.e., does the F^:3 uses the result of previously calculated F^:2 ? Or are the calculations completely independent (as I g