Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Populating a vector

by bageler (Hermit)
on Dec 15, 2005 at 17:56 UTC ( #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? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-10-07 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (29 votes). Check out past polls.

    Notices?