Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by itub (Priest)
on May 12, 2004 at 19:40 UTC ( [id://352871]=note: print w/replies, xml ) Need Help??


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

Regarding the concatenations, my implementation has several differences with respect to your original proposal:

  • The real coordinates are normalized by dividing by the cutoff (which is relatively small), and rounded to the next lower integer (i.e., floored). The "concatenation" is numerical; $n = 1000000*$x + 1000*$y + $z + 500500500. Problem here: I'm assuming that the entire system is within +/- 500*$cutoff. I'll have to fix that somehow.
  • I use a hash to store the atoms. Each "bucket" ($hash{$n}) may contain more than one atom (usually 1-4), so it's actually an array reference. Atoms are Chemistry::Atom objects, which know their own symbol, name, real coordinates, etc.
  • The buckets don't need to be sorted; I just loop for each of them, and then check for bonds with the N^2 algorithm within the bucket (remember N is small), and then check for bonds with the atoms in the neighboring buckets (this requires N*M checks if there are M atoms in the neighbor). "Neighbor" is defined in a way that avoids counting the same pair twice.

Note: the neighbors of $n are $n+1, $n+1000, $n+1000000, etc., for a total of 13 neighbors (a cube is surrounded by 26 cubes, but you only need half of them to avoid counting twice)

  • Comment on Re: Re: Re: Re: Processing data with lot of math...

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Processing data with lot of math...
by BrowserUk (Patriarch) on May 12, 2004 at 20:43 UTC

    When you said "based on your post", you should have prefixed it with "loosely" :)

    I'm not sure that I fully understand the details of what you are doing. Maybe I'll pull the module and take a looksee if the code and POD clarifies anything. Note: It's not your description that is lacking, just my knowledge of the actual application.

    If the idea adapts to something useful, it's the best reward one can ask for. Thanks for mentioning it:)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail

Log In?
Username:
Password:

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

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

    No recent polls found