Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: computational efficiency

by Old_Gray_Bear (Bishop)
on Oct 05, 2011 at 14:37 UTC ( [id://929817]=note: print w/replies, xml ) Need Help??


in reply to computational efficiency

The three steps to writing Good Code:
  1. Make it run
  2. Make it run right
  3. Make it run fast
Keep your notes about optimization around for when you get to the third step. (No, I don't remember who said it; probably Kernigan.)

Update -- fixed typo

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: computational efficiency
by thelycaeum (Initiate) on Oct 10, 2011 at 17:42 UTC
    First of all, thanks for all of your replies.

    BrowserUK: I'll try that one, I think it's exactly the benchmark code I was looking for.

    Perlbotics: Quantizing the angles seems to be a good idea. At first glance, the following problem arises in my mind: To achieve random 3D rotation, I have to apply rotations around the x,y and z axis. Do you think I could achieve a random probability distribution by simply randomizing the rotation axis and walking through the quantized angles with a foreach loop?

    Lotus1 & moritz: Thanks moritz, I thought about that shortly after the post. I could get rid of that problem by randomizing the sign of the cosine... shouldn't I? I'll think about that and read the article lotus posted, I don't understand it yet.

    zentara: Actually, I intend to learn how to use PDL by writing that program. However, I wanted to get started by writing a backbone in Perl and only solve the more sophisticated problems with PDL. I was having some problems with the notation of complex values in the PDL:FFTW package before, therefore I was wondering what I could program in Perl efficiently and what not.

    roboticus: Very good point, I'll do some analysis on the probability distribution for both methods using BrowserUK's code and I'll work on the point moritz made about the two vs. four quadrants.

    hardburn: I've messing around with POGL a bit, but I think it's too much for me... yet ;)

    Old_Gray_Bear: Thanks, I don't have much programming experience and so I was looking for some hints on how to plan this project.

    Thanks again for all of these great comments :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://929817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found