Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: boolean calculation with very large data

by Corion (Patriarch)
on Sep 24, 2009 at 07:15 UTC ( [id://797137]=note: print w/replies, xml ) Need Help??


in reply to boolean calculation with very large data

If your area is "sparse", that is, the number of regions is far smaller than the number of points in your space, I think using arithmetic instead of a bitmask will be much faster.

The two regions can be ordered by the numerical order of their lower bound, and if the two are equal, by their upper bound. Two regions then overlap iff the lower bound of the upper region is smaller than the upper bound of the lower region.

Alternatively, if you have many one-dimensional regions, or regions with holes in them, and a large space, like Unicode has, Inversion Lists (also greping big numbers) might be a good approach to do fast set operations.

  • Comment on Re: boolean calculation with very large data

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found