Hey, David,
Very nice writeup. Contributions like this are a big part of why I
like working with such an active user/developer community. It's great
to have so many fine examples lain out where people can get to them.
I probably should (have?) put something in range's documentation about
this -- but your life example will both run faster and be shorter if
you range() the other way: instead of getting your neighbor counts with
$n = ($a->range(ndcoords($a)-1,3,3)->reorder(2,3,0,1)->sumover-
>sumover)-$a;
you could instead use:
$n = ( $a->range(ndcoords(3,3)->clump(1,2)-1, [$a->dims], p)-
>sumover ) - $a;
Here, range() is faster because large range sizes run faster than
large index variables (range() doesn't have to store as many index
coordinates when building the transformed PDL). You'll get a much
smaller memory footprint and probably 30% faster runs.
I post this here because I think this is a big oversight in the
range() documentation...
Cheers,
Craig
On Nov 15, 2009, at 11:11 PM, David Mertens wrote:
Matt -
That's a great write-up. You are clearly a wizard with threading
over sub matrices. Wow.
I've added a link to it in the main wiki documentation, Getting
Started with PDL. Generally, the Getting Started section needs lots
of work. Your threading intro is a welcome contribution!
Feel free to post links elsewhere on the wiki as you see fit, and
keep up the great writing.
David
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl