Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

PDL bitfield type - wanted?

by etj (Deacon)
on May 12, 2024 at 20:04 UTC ( [id://11159408]=perlquestion: print w/replies, xml ) Need Help??

etj has asked for the wisdom of the Perl Monks concerning the following question:

I'm toying with the idea of adding a bitfield type to PDL, so that along the zeroth dimension it's not a whole number of bytes, but a calculated bit read (when it's used as an rvalue) or write (probably needs a function to set that, since PDL can't parse the C code yet to spot an lvalue).

Feedback on whether that would be valuable enough welcome!

Replies are listed 'Best First'.
Re: PDL bitfield type - wanted?
by swl (Parson) on May 13, 2024 at 00:46 UTC
      You assume correctly! If you are prepared to help out (if you are, obviously I'd be very pleased to give lots and lots of help). I think the way forward would be for me to add (and use, to shake out bugs) the type implementation, then these algorithms would be in a separate PDL::BitOps or similar distro.

      My immediate "itch" was to use a bitmap to implement seenmap in the fancy new contour_polylines; it annoyed me a bit that while I'd made that be a byte (i.e. 8-bit) ndarray, I was only using 2 of the bits in each of those. It's not a vast amount of memory being wasted, but that has an impact on cache usage.

        I can help with testing and debugging. Any initial implementation is of course best done by yourself given familiarity with the innards of PDL.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11159408]
Approved by marto
Front-paged by marto
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-05-26 22:24 GMT
Find Nodes?
    Voting Booth?

    No recent polls found