I would like to see bitfield-array support in PDL.
Clearly, the needed functionality could be coded
up with PP and C.  It is the native datatype
support that is missing.

Another motivation for bitfield support is that it
is allows for an alternate implementation of badvalues
by use of an associated mask as a bitfield which can
greatly reduce the overhead of mask operations in
terms of memory pressure (e.g., the mask memory
would be 1/8th of the array memory).

--Chris

On Wed, Jul 27, 2011 at 10:36 PM, David Mertens
<[email protected]> wrote:
> David -
>
> On Wed, Jul 27, 2011 at 8:21 PM, David Myers <[email protected]> wrote:
>> Dave,
>>
>> I think BrowserUK's point was functional efficiency as opposed to
>> operators. The matrices in question had values that were zeroes and ones
>> only, probably connectivity matrices from some kind of graph. As such
>> they can be implemented within regular Perl via bit-vectors, and such an
>> implementation is both space efficient and fast.
>>
>> PDL, and I may be wrong here, is optimized for floating point
>> efficiency. I'd be happy to be proven wrong in this, but I think, if you
>> get past all the extraneous questions about operators in PDL, that the
>> compact expression of 0 & 1 only matrices as bit-vectors was at the
>> heart of UK's comments.
>>
>> That you could count bit wise operations with something like this one
>> liner
>>
>> my $count = sum ($poweroftwo & $My_PDL_Matrix ) >> $power;
>>
>> Is yet another issue.
>>
>> Sincerely,
>>
>> David Myers (dwm042@perlmonks).
>> CPAN ID DWMYERS
>
> Yes, that was his point, but since he raised the question, it needed
> to be answered. As for whether pure Perl would beat PDL on this one,
> though I will be working with networks and adjacency matrices starting
> this fall, I haven't started yet and I don't have time to cook up
> examples and run benchmarks. It might be a toss-up: it may depend on
> the size of the adjacency matrix.
>
> 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

Reply via email to