Bit-Vector

 view release on metacpan or  search on metacpan

Vector.pod  view on Meta::CPAN

C<$vec3-E<gt>Xor($vec1,$vec2);>

C<$set3-E<gt>ExclusiveOr($set1,$set2);>

This method calculates the symmetric difference of "C<$set1>" and "C<$set2>"
and stores the result in "C<$set3>".

This can be written as "C<$set3 = ($set1 u $set2) \ ($set1 n $set2)>" in set
theory (the union of the two sets less their intersection).

When sets are implemented as bit vectors then the above formula is
equivalent to the exclusive-or between corresponding bits of the two
bit vectors (hence the name of this method).

Note that this method is also much more efficient than evaluating the
above formula explicitly since it uses a built-in machine language
instruction internally.

In-place calculation is also possible, i.e., "C<$set3>" may be identical
with "C<$set1>" or "C<$set2>" or both.

=item *

C<$vec2-E<gt>Not($vec1);>

C<$set2-E<gt>Complement($set1);>



( run in 0.686 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )