in reply to decomposing binary matrices (2)

Hi Hugo,

Re PDL: it is possible to add types, using PDL::Types. Each type needs to be something the C compiler understands, though.

It does occur to me that perhaps you could stick with the types that are already there, and pack your flags into a byte (or larger) datatype, then use bitwise operators to work on them. Take a look at bandover() and borover() in PDL::Ufunc.

In general: PDL is great and well worth the time spent learning. The chief disadvantage is that occasionally the syntax of PDL threading, and the amount of power that you can put into one statement, can make your head explode. Ensure a plentiful supply of calming tea and biscuits while learning.

Also, once you start doing threaded ops on large matrices, it's easy to run out of memory - that's not PDL's fault though.

Best, andye

Replies are listed 'Best First'.
Re^2: decomposing binary matrices (2)
by hv (Prior) on Feb 28, 2007 at 13:17 UTC

    Unfortunately, on this occasion exactly as on a half-dozen previous occasions, by the time I'd determined whether the task was remotely possible with PDL and had some idea of what I'd need to learn to get there, I'd already solved the problem some other way.

    I think that's mainly an issue of domain - the type of problems I tend to deal with are rarely a close fit to the sort of problem PDL is primarily designed to solve. That leaves me never quite sure whether the benefit (to me) would justify the effort of climbing its learning curve, though I recognise that within its domain it is clearly a useful and powerful tool.

    Hugo

      Yeah, I know what you mean. I found the book(*) "PDL: Scientific Programming in Perl" a useful, and fairly gentle, introduction - you can always read it in the bath sometime when you don't have a particular use for PDL - then when you do, you can fish the knowledge out of the back of your brain. That's my technique, anyway. :)

      Best, andye

      * An online book - not a printed 'book' book. I don't have the URL handy but I'm sure Google will find it for you.