# Create the bit vectors my $bv1 = Bit::Vector->new(50); my $bv2 = Bit::Vector->new(50); ... # Keep associated bv's together my @source1 :shared = ($bv1a,$bv2a,...,$bv85000a,...$bv25000000a); my @source2 :shared = ($bv1b,$bv2b,...,$bv85000b); ... # Add these arrays to a single, global array my @sources :shared = (\@source1, \@source2, ...); #### # One pairwise intersection: # $intrx1_2 is a bit vector whose bits correspond to the positions # in @source1 whose bit vectors intersected with those in @source2; my ($intrx1_2, $intrx2_1) = set_intersection(\@source1,\@source2); # Storing the results in a globally shared hash $globally_shared_hash{$source1}->{$target2} = $intrx1_2; $globally_shared_hash{$source2}->{$target1} = $intrx2_1; #### %globally_shared_hash = ( $source1 => { $target2 => $bv1_2, $target3 => $bv1_3, $target4 => $bv1_4, ... }, $source2 => { $target1 => $bv2_1, $target3 => $bv2_3, $target4 => $bv2_4, ... }, ... ); #### Bit::Vector->new() # bv constructor $vec->to_Hex() # bv -> HEX string $vec->to_Bin() # bv -> BINARY string $vec->Clone() # new vector, exact duplicate $vec->Size() # gets length of bv $vec->Reverse() # reverses bv $vec->bit_test($index) # 0 or 1 $vec->bit_flip($index) # flips bv's bit at $index $vec->Bit_On($index) # turn bit on $vec->Bit_Off($index) # turn bit off $vec->Interval_Scan_dec # grabs (min,max) of next chunk of 0's $vec->Lexicompare($vec2) # +1,0, or -1