Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Populating a vector

by bageler (Hermit)
on Dec 15, 2005 at 17:56 UTC ( [id://517044]=note: print w/replies, xml ) Need Help??


in reply to Populating a vector

You could use a real bitvector instead of a memory hungry array:
use PDL; $n = 50; $vec = zeroes ($n+1); index($vec,0) .= 1;

Replies are listed 'Best First'.
Re^2: Populating a vector
by thor (Priest) on Dec 15, 2005 at 18:03 UTC
    Assuming that his vectors contain only bits...

    thor

    The only easy day was yesterday

      You can put values other than 0 and 1 in PDL vectors and it's still less memory intensive than arrays
        I didn't see that you were using PDL. You had said "bitvector" which implies a vector of bits. :-)

        thor

        The only easy day was yesterday

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://517044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found