http://qs321.pair.com?node_id=517044


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