Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Compact and sparse bit vector

by diotalevi (Canon)
on Dec 27, 2008 at 21:37 UTC ( #732843=CUFP: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use constant MEGABYTE => 2 ** 20;
    my $vector = '';
    # 5,000 bits. Set every 100th bit between 15 million and 20 million. 
    ...
        }
    }
    printf "%0.1fM\n", length( $vector ) / MEGABYTE;
    
  2. or download this
    use constant KILOBYTE => 2 ** 10;
    use Judy::1 qw( Set MemUsed );
    my $vec;
    ...
        }
    }
    printf "%0.1fK\n", MemUsed( $judy ) / KILOBYTE;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://732843]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-09-17 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (89 votes), past polls