comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Speedy Julia Set Fractals
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Speedy Julia Set Fractals [message #67913 is a reply to message #67911] Sun, 06 September 2009 14:45 Go to previous messageGo to previous message
Caleb is currently offline  Caleb
Messages: 2
Registered: September 2009
Junior Member
On Sep 6, 4:44 pm, Caleb <calebwhe...@gmail.com> wrote:
> Hello!
>
> I have a quick question about some fractal work I am doing. I know
> that doing matrix multiplications and histograms can exponentiate
> processes that are historically done with for loops. I have been
> trying to think of a way to do this with a fractal program I just
> wrote. Here is a snippet of the code that I want to speed up:
>
> <code>
>
> ; Loop through and do calculations on each point:
>   FOR i = 0, x_size-1 DO BEGIN
>
>     FOR j = 0, y_size-1 DO BEGIN
>
>       ; Initialize number of iterations:
>       num = 0
>
>       ; Complex value of the current coordinate point:
>       z = COMPLEX(FLOAT(i-X_OFFSET)/(X_OFFSET*SCALE),FLOAT(j-Y_OFFSET) /
> (Y_OFFSET*SCALE))
>
>       ; Calculate value of F(z) at above z:
>       z1 = z^K + c
>
>       ; Take magnitude of the above value (z1):
>       mag = ABS(z1^K + c)
>
>       ; Do loop until mag is greater than threshold or max iterations
> have been calculated:
>       WHILE ((mag LE THRESH) AND (num LT MAX_ITERATION)) DO BEGIN
>
>         ; Re-Calculate value of F(z) at above z1:
>         z1 = z1^K + c
>
>         ; Take magnitude of the above value (z1):
>         mag = ABS(z1^K + c)
>
>         ; Increment iteration variable:
>         num++
>
>       ENDWHILE
>
>       ; Value of matrix is set to iteration number:
>       grid(i,j) = num
>
>     ENDFOR
>
>   ENDFOR
>
> </code>
>
> My problem is that I have a while loop for every iteration of my
> matrix which can run up to 256 iterations if need be. Can I speed of
> these calculations without going to multiple cores?
>
> Oh and if you need more of the code let me know and I'll post it.
>
> Thanks!
>
> Caleb Wherry

Whoops, thought there were "code" tags. Guess not!

- Caleb
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mapping the US with values for each state
Next Topic: Re: advise for saving a for-loop

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:43:22 PDT 2025

Total time taken to generate the page: 0.55774 seconds