Thanks guys. I read your replies earlier today but couldn't reply. Work has a strict 'no fun' policy you see.. Yeah, I had already figured out the cause of the memory being eaten, I just wasn't sure what alternatives I could use.
Chris is right - Convolve might be what I am looking for. A quick google search about it tells me I should have been referring to my moving window as a 'kernel', which further helps me out. I'm clearly new to this stuff. Normally I write gui programs and low level comms and drivers.. none of this math voodoo. Anyway if convolve fails to help, I might give the PP routine a shot. We'll see. Thanks again guys! On Sep 26, 2011 12:55 AM, "Craig DeForest" <[email protected]> wrote: > Chris nailed this, as always. You're probably running out of memory with the range() call, simply because range() is implemented in the most boneheaded way possible, which is fine for smaller data sets -- but for a 1k x 1k image you're already looking at a gigapixel output from range. Chris's initiative to remove the 2GB Perl memory restriction should fix that, but meanwhile you're in territory where memory use actually matters -- and therefore out of the domain in which range() is meant to operate. > > I suggest using explicit looping inside an inline PP routine -- that way you can keep everything in cache and get optimal performance. Here is an example inline PP routine that also uses C helper function -- it helps to have a template to start from, but it's pretty straightforward to do. (The only hassle with Inline::PP is getting the darned thing to compile -- you have to drill down into the temp directory to find any error messages made by the compiler). >
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
