You might find
http://www.jsoftware.com/pipermail/general/2003-March/015990.html useful, or
at least interesting.  A J6 version follows:



NB. -----Original Message-----
NB. From: O^DAIRA, To^ru [mailto:[EMAIL PROTECTED] 
NB. Sent: Friday, February 28, 2003 10:02 PM
NB. To: [EMAIL PROTECTED]
NB. Subject: Re: [Jforum] Frractals - Mandelbrot Set P
NB. 
NB. (1) Viewing Mandelbrot neighbours as the SecretSign(Thanks for
inspiring)
NB. Subject: RE: Jforum: Say-what-you-see series
NB. Sent: Mon, 3 Feb 2003 01:34:15 -0000
NB. From: Mohammad Reza Jahanbin <[EMAIL PROTECTED]>
NB. To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>


{"0 _&' SecretSign
'@e@((o;e+(2:<|)@o)@((e=.>@{:);~C&+@:*:@o=.>@{.)^:11)C;0$~$C=:(12%~i:_20)j.~
/18%~_50+i.80


NB. (2) Viewing Mandelbrot set using viewmat
load 'viewmat'
require 'numeric bmp'
Pos=: j./&steps/ _0.9 2.1 300,: _1.2 0 120
Lim=: -&Pos@:*:^:20 (0)
viewmat | (}: , |.) (4: <: |)`(,:&4 )} |: Lim
viewmat | (}: , |.) (4: <: |)`(,:&70)} |: Lim  NB. rplc such t (4<:|t) with
70


NB. (3) Viewing Mandelbrot set using plot
require 'plot'
  'dot'plot <"1 |: +. (, +) (, 4> | Lim)# , Pos
'point'plot <"1 |: +. (, +) (, 4> | Lim)# , Pos


NB. (4) FYI: Viewing Julia set using viewmat
require 'numeric bmp'
decmpx=: i.~ ~.@,     NB. necessary because viewmat rejects complex arg.
NB. " =: <"0          NB. neat but creates numerous small memory cells
clattice=: j./&steps  NB. dyad: substitution for region in the complex plane
clattice=: (j.~/~ |.)&steps  NB. transpose for math. graph. coord.
NB. aNewtonRaphson1step4derivable=:   1 :'- x. % x.d.1'
NB. aNewtonRaphson1step4underivable=: 1 :'- x. % 1e_3&(x."0 D:1)' NB.
"underivable" here means "that d. can not transform as symbols"
aNR1s4all=: f.1 :'- x % x(1 :''try. x d.1 catch. 1e_3&(x"0 D:1) end.'')' 
enlargeMat_x3  =: 3&#"1 @: (3&#)  NB. for optinal use before laplacian
laplacianoid_bw=: (>1 1;2 2)&(-:&[EMAIL PROTECTED]@~.@,;._3)
nabloid_color  =: (>1 1;2 2)&(    [EMAIL PROTECTED]:@,;._3)

foo    =: _1 0 0 1&p.  NB. 0 = _1 + x^3
ReRange=: _1   1   100
ImRange=: _0.5 1.5 100

Lim=: foo(aNR1s4all)^:_ ReRange(clattice) ImRange
viewmat decmpx          Lim
viewmat laplacianoid_bw Lim  NB. viewmat laplacianoid_bw enlargeMat_x3 Lim
viewmat nabloid_color   Lim



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] On Behalf Of Ahmad Issa
> Sent: Saturday, August 19, 2006 4:07 AM
> To: Programming forum
> Subject: Re: [Jprogramming] Mandelbrot
> 
> I don't quite have the money to get the book (i'm still in highschool),
> i'd
> really appreciate it if you could write some code that i can study.
> 
> regards, Ahmad
> 
> On 8/19/06, Miller, Raul D <[EMAIL PROTECTED]> wrote:
> >
> > Ahmad Issa wrote:
> > > I'm trying to plot some of the mandelbrot set. My
> > > implementation is discouragingly slow, are there
> > > any faster implementations in J?
> >
> > Presumably, yes:
> > http://www.jsoftware.com/jwiki/Books#head-8ca3f3769d7a001e890dcbfef60fb0
> > 8276bce3d6
> >
> > Inspecting your code, it looks like you've broken the
> > problem into a bunch of more or less unrelated little
> > pieces.  To get better performance, you should
> > eliminate unnecessary steps.  For example, I would
> > start by eliminating all your ext_* verbs and replacing
> > them with something which treats the data in an
> > array fashion (perhaps using inner product or something
> > of that nature).
> >
> > Except where this introduces big-O problems, eliminating
> > extra evaluation steps is one of the more obvious ways to
> > improve J performance.
> >
> > --
> > Raul
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to