Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Linda Alvord
I can't believe what a relief this is: iroots [: ,. _1 ^ [: +: i. % ] iroots ttem 3 : 0 r0=. i. y q0=. +: r0 % y ,. (_1) ^ q0 ) irootse=: 13 :',.(_1)^+:(i.y)%y' irootse [: ,. _1 ^ [: +: i. % ] Linda -Original Message- From: programming-boun...@forums.jsoftware.c

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Linda Alvord
Or maybe imaginary roots: Iroots=: 13 :',._1^+:(i.y)%y' iroots [: ,. _1 ^ [: +: i. % ] iroots 3 1 _0.5j0.866025 _0.5j_0.866025 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behal

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Bo Jacoby
wrote: "My roots-of-unity verb was designed to get higher accuracy than simpler approaches." The verb    PoU=:_1^+: NB. Power of Unity is not contaminated by transcendental numbers such as (2p1) or transcendental functions such as monadic (^). If (y) is rational then (PoU y) is algebraic, so

Re: [Jprogramming] [Jgeneral] Un-puzzling expressions

2012-07-17 Thread Ian Clark
@Linda I simply keep it in my ~user folder (my own version, that is). It can be loaded automatically by putting the appropriate load statement in ~user/config/startup.ijs . But I don't do that: I load it at need. I have things set up to do that conveniently. You could of course put its name and lo

Re: [Jprogramming] [Jgeneral] Un-puzzling expressions

2012-07-17 Thread Linda Alvord
Where do you put the file 'tte.ijs' so it will be accessed? It is a very impressive script even without all the ideas you have to augment it. Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Ian Clark

Re: [Jprogramming] boxing each element

2012-07-17 Thread Roger Hui
I don't like this because usually I don't want to pad each item. If they had the same dimensions I wouldn't box 'em in the first place. On Tue, Jul 17, 2012 at 3:23 PM, Linda Alvord wrote: > How does this rank? > > <"1(>x),"1 0>y > ┌───┬───┬───┬───┐ > │CogitoA│, B│ergo

Re: [Jprogramming] boxing each element

2012-07-17 Thread Linda Alvord
How does this rank? <"1(>x),"1 0>y ┌───┬───┬───┬───┐ │CogitoA│, B│ergo C│sum. D│ └───┴───┴───┴───┘ Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Roger Hui S

Re: [Jprogramming] boxing each element

2012-07-17 Thread bob therriault
, each i. 10 would put a list in each box created. ] each i. 10 would put a scalar in each box Cheers, bob On 2012-07-17, at 2:14 PM, Dan Bron wrote: > It's not abuse - that's perfectly valid. Note, however: > > > ]A=:1 <\ i. 10 > +-+-+-+-+-+-+-+-+-+-+ > |0|1|2|3|4|5|6

Re: [Jprogramming] boxing each element

2012-07-17 Thread Roger Hui
Nice. With <"0 sometimes the 0 interacts with the argument and you'd need some kind of separate. ;/ doesn't not suffer from this. <"0 ]1 2 3 ┌─┬─┬─┐ │1│2│3│ └─┴─┴─┘ ;/1 2 3 ┌─┬─┬─┐ │1│2│3│ └─┴─┴─┘ On Tue, Jul 17, 2012 at 2:33 PM, chris burke wrote: > Also: > > ;/i.10 > > (argument sho

Re: [Jprogramming] boxing each element

2012-07-17 Thread chris burke
Also: ;/i.10 (argument should be non-empty) On Tue, Jul 17, 2012 at 10:11 AM, Devon McCormick wrote: > <"0 i.10 or ]&.> i.10 > > On Tue, Jul 17, 2012 at 12:49 PM, Kim Kuen Tang > wrote: > > Hi everyone, > > > > is there a better way to box each element ? > > > > 1 <\i.10 > > > > Thx for any

Re: [Jprogramming] boxing each element

2012-07-17 Thread Dan Bron
It's not abuse - that's perfectly valid. Note, however: ]A=:1 <\ i. 10 +-+-+-+-+-+-+-+-+-+-+ |0|1|2|3|4|5|6|7|8|9| +-+-+-+-+-+-+-+-+-+-+ ]B=:<"0 i. 10 +-+-+-+-+-+-+-+-+-+-+ |0|1|2|3|4|5|6|7|8|9| +-+-+-+-+-+-+-+-+-+-+

Re: [Jprogramming] boxing each element

2012-07-17 Thread Roger Hui
Yes, plus each boxed element is a vector rather than a scalar. $&.> <"0 i.10 ┌┬┐ │││ └┴┘ $&.> 1 <\i.10 ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │1│1│1│1│1│1│1│1│1│1│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ On Tue, Jul 17, 2012 at 1:35 PM, Kim Kuen Tang wrote: > > 1<\i.10 > > > is for me not ideal be

Re: [Jprogramming] boxing each element

2012-07-17 Thread Kim Kuen Tang
1<\i.10 is for me not ideal because you are abusing the adverb \ . Am 17.07.2012 21:15, schrieb Linda Alvord: <"0 i.10 --T-T-T-T-T-T-T-T-T-┐ │0│1│2│3│4│5│6│7│8│9│ L-+-+-+-+-+-+-+-+-+-- I'm not sure what you will call better. Linda -Original Message- From: programming-boun...@forums

Re: [Jprogramming] boxing each element

2012-07-17 Thread Roger Hui
What could be better is, if you are not just boxing each element but doing something to each element that may involve boxing it. In such a case f&.> aka f each may be better. For example: x=: ;: 'Cogito, ergo sum.' x ┌──┬─┬┬┐ │Cogito│,│ergo│sum.│ └──┴─┴┴┘ y=: 'AB

Re: [Jprogramming] boxing each element

2012-07-17 Thread Linda Alvord
<"0 i.10 --T-T-T-T-T-T-T-T-T-┐ │0│1│2│3│4│5│6│7│8│9│ L-+-+-+-+-+-+-+-+-+-- I'm not sure what you will call better. Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Kim Kuen Tang Sent: Tuesday, July

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Raul Miller
On Tue, Jul 17, 2012 at 2:07 PM, wrote: > My roots-of-unity verb was designed to get higher accuracy than simpler > approaches. If you just take numbers from 0 to pi you in effect lose an ULP > or two of significance. So, I calculated over a smaller & more accurate > interval & used reflecti

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread henryhrich
My roots-of-unity verb was designed to get higher accuracy than simpler approaches. If you just take numbers from 0 to pi you in effect lose an ULP or two of significance. So, I calculated over a smaller & more accurate interval & used reflection and sign-change. The results of FFT using the

Re: [Jprogramming] boxing each element

2012-07-17 Thread Kim Kuen Tang
Very cool, many thx. Kim Am 17.07.2012 19:11, schrieb Devon McCormick: <"0 i.10 or ]&.> i.10 On Tue, Jul 17, 2012 at 12:49 PM, Kim Kuen Tang wrote: Hi everyone, is there a better way to box each element ? 1<\i.10 Thx for any comments or solutions. Kim --

Re: [Jprogramming] boxing each element

2012-07-17 Thread Devon McCormick
<"0 i.10 or ]&.> i.10 On Tue, Jul 17, 2012 at 12:49 PM, Kim Kuen Tang wrote: > Hi everyone, > > is there a better way to box each element ? > > 1 <\i.10 > > Thx for any comments or solutions. > > Kim > -- > For information abo

Re: [Jprogramming] boxing each element

2012-07-17 Thread bob therriault
Another option might be: ] each i. 10 where 'each' is already defined in J as &.> Although this looks closer to a direct english translation, it is actually using the functionality of 'each' to do the boxing. Cheers, bob On 2012-07-17, at 9:55 AM, Joey K Tuttle wrote: > <"0]i.10 > > On

Re: [Jprogramming] boxing each element

2012-07-17 Thread Joey K Tuttle
<"0]i.10 On 2012/07/17 09:49 , Kim Kuen Tang wrote: Hi everyone, is there a better way to box each element ? 1 <\i.10 Thx for any comments or solutions. Kim -- For information about J forums see http://www.jsoftware.com

[Jprogramming] boxing each element

2012-07-17 Thread Kim Kuen Tang
Hi everyone, is there a better way to box each element ? 1 <\i.10 Thx for any comments or solutions. Kim -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] [Jgeneral] Un-puzzling expressions

2012-07-17 Thread Ian Clark
Thanks, Linda. I often feel I come out with things that everybody knows about except me. I'm delighted you share my enthusiasm for Ambrus's tte (ttem/ttes). The writeup says it's unfinished, and suggests it may fail on hooks. I use it with a slight modification to run it in its own locale, which m

Re: [Jprogramming] inverse of viewmat

2012-07-17 Thread Raul Miller
On Tue, Jul 17, 2012 at 10:52 AM, Istvan Kadar wrote: > Dear Forum, > > load 'viewmat' >a=: ?20 20$2 >b=:viewmat a >$b > 0 0 >#b > 0 The result from viewmat is nothing -- no rows, and no columns of nothing. >c=:(viewmat^:_1) b > |domain error viewmat is not designed to displ

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Raul Miller
On Tue, Jul 17, 2012 at 5:12 AM, Bo Jacoby wrote: > Yes, the roots-of-unity verb rou from the Essay/FFT is only to be used for > computing this fft. Ok... but I do not see any really good reasons for pushing that -: into the definition of rou. You can just as easily use rou@-: -- Raul ---

Re: [Jprogramming] jwiki/Essays/FFT

2012-07-17 Thread Bo Jacoby
Yes, the roots-of-unity verb rou from the Essay/FFT is only to be used for computing this fft.  A perfectly symmetric transform is nice    FT=:([:(%[:%:#)+floop&.cube rou@#) :.FT NB. Fourier Transform    (=FT^:2)i.16 NB. test 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 but then the convolution is trickier