On Tue, Feb 04, 2003 at 05:01:38PM -0500, Uri Guttman wrote: > have you thought about doing bit string operations? you claim a 2d array > but you don't mention how it is stored. it could be an array of B bit > strings all of length A. the Bit::Vector module could be very handy > here. > > then you can OR (or XOR) lines at a time and then sum up the bits to see > how much overlap there is. you still would have to shift the C sized > bit string to test against A. and you would still have to scan down the > B array but it seems like much less cpu would be needed than a full 4D > loop. > > also you could try some heuristics (unless you must have the maximum > match) where you try to only maximize certain (random?) lines and rows > thereby shrinking the search space. you may get a suboptimal match but > it will/should take much less time. > > also even though Bit::Vector is mostly in C you could write your own > specialized code with Inline::C to speed up those row/bit tests.
Surely PDL does this already? http://pdl.perl.org -- John Tobey <[EMAIL PROTECTED]> \____^-^ /\ /\ _______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

