Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Processing data with lot of math...

by QM (Parson)
on May 12, 2004 at 23:00 UTC ( [id://352916]=note: print w/replies, xml ) Need Help??


in reply to Re: Processing data with lot of math...
in thread Processing data with lot of math...

Why use sqrt? There is no added value in it; instead, transform the cutoff value.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re: Re: Re: Processing data with lot of math...
by ysth (Canon) on May 12, 2004 at 23:14 UTC
    Because there's no point in optimizing until you have triaged your algorithm (irremedially slow, a little too slow, or fast enough). If I were certain what form the original questioner's points stored in, I would have even used a distance() sub. Code should be written for minimum conceptual complexity and then optimized only if needed, and having a separate $cutoff_squared checking against a square distance is beyond my minimum. YMMV.

    Update: the above is obviously hypocritical; I get sucked into premature optimization and complexity fascination all the time.

      Oops, my reply lies above. Please forgive me this time. Was not aware what I was doing..., presumed that the reply will come at the bottom. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found