CracTools::BitVector - Full Perl BitVector implementation
version 1.251
my $bv = CracTools::BitVector->new(1000); # Setting bits my $bv->set(1); my $bv->set(12); # Query bits if($bv->get(12)) { print STDERR "I knew this one was set!!\n"; }
This module based implements a bitvector datastructure where individual bits can be set, unset and check. It also implement "rank", "select" functions, but it is poorly optimised.
You may want to check CracTools::GenomeMask that uses this BitVector implementation to define a complete bitset over a genome.
Arg [1] : Integer - lenght of the bitvector Description : Return a new CracTools::BitVector object ReturnType : CracTools::BitVector
Description : Return the position of the first bit set ReturnType : Integer
Description : Return a copy of the curent bitvector ReturnType : CracTools::BitVector
Arg [1] : Integer - position in the bitvector Description : Set 1-bit at position i ReturnType : undef
Arg [1] : Integer - position in the bitvector Description : Unset 1-bit at position i ReturnType : undef
Arg [1] : Integer - position in the bitvector Description : Return the value of the bit at position i ReturnType : Boolean
Arg [1] : Integer - position in the bitvector Arg [2] : (Optional) Integer - max shift from i Description : Return the previous position that has a bit set. ie. a position j <= i such that get(j) == 1 && get(k) == 0 , j < k <= i If max is set, j >= i - max -1 if no such position exists ReturnType : Integer
Arg [1] : Integer - position in the bitvector Arg [2] : (Optional) Integer - max shift from i Description : Return the next position that has a bit set. ie. a position j >= i such that get(j) == 1 && get(k) == 0 , j > k >= i If max is set, j <= i + max -1 if no such position exists ReturnType : Integer
Arg [1] : Integer - position in the bitvector Description : Return the number of bit set up to position i ReturnType : Integer
Arg [1] : Integer - position in the bitvector Description : Return the next position that has a bit set. ie. a position j >= i such that get(j) == 1 && get(k) == 0 , j > k >= i If max is set, j <= i + max -1 if no such position exists ReturnType : Integer
Description : Return the length of the bitvector ReturnType : Integer
Description : Return the number of bit set ReturnType : Integer
Arg [1] : (Optional) String - Separator character (space by default) Description : Return a string representation of the bitvector where each bit is separated with a space character. ReturnType : String
Nicolas PHILIPPE <nphilippe.research@gmail.com>
Jérôme AUDOUX <jaudoux@cpan.org>
Sacha BEAUMEUNIER <sacha.beaumeunier@gmail.com>
This software is Copyright (c) 2017 by IRMB/INSERM (Institute for Regenerative Medecine and Biotherapy / Institut National de la Santé et de la Recherche Médicale) and AxLR/SATT (Lanquedoc Roussilon / Societe d'Acceleration de Transfert de Technologie).
This is free software, licensed under:
The GNU Affero General Public License, Version 3, November 2007
To install CracTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CracTools
CPAN shell
perl -MCPAN -e shell install CracTools
For more information on module installation, please visit the detailed CPAN module installation guide.