I have this piece of code I wrote that apparently I don't understand
completely:

   mandel=: 4 : '(( +*:`] @. (2:<|)"0)^:x~) y'

So, for

   m1k=: (512%~512-~i.1024)j.~/419%~_825+i.1024

if we do this

   mm=. 3 mandel m1k

We can see the beginning of a Mandelbrot:

   viewmat mm

However, all my attempts to move the "power" (with the tilde: "^:x~") out
of the definition have failed:

   mandel0=: 3 : '(( +*:`] @. (2:<|)"0)^:1~) y'
   mm=. mandel0^:3 ] m1k
   viewmat mm            NB. Not the same as the above

   mandel0=: 3 : 'y (+*:`] @. (2:<|)"0) y'
   mm=. mandel0^:3 ] m1k
   viewmat mm            NB. Not the same as the above

   mandel0=: 3 : '((+*:)`] @. (2:<|)"0) y'
   mm=. mandel0^:3 ] m1k NB. Even worse: crashes J

Process shell<1> exited abnormally with code 5

Any hints as to what I'm missing?

-- 
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to