|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
47 if(( use_larger ) ^ ( lhs.
size() < rhs.
size() )) {
60 if(( use_larger ) ^ ( lhs.
size() < rhs.
size() )) {
73 if(( use_larger ) ^ ( lhs.
size() < rhs.
size() )) {
91 return (lhs | rhs) & ~(lhs & rhs);
99 return ((sub & super) == sub) && (sub.
count() < super.count());
163 for(
size_t i = 0; i < bv.
size(); ++i ) {
164 s << (bv.
get(i) ?
"1" :
"0");
175 while( c ==
'0' || c ==
'1' ) {
183 for(
size_t i = 0; i < str.size(); ++i ) {
184 if( str[i] ==
'1' ) {
std::istream & operator>>(std::istream &in, Bitvector &bv)
Extraction operator that inputs a Bitvector from a string of '0's and '1's, and stops at the first ch...
void set(size_t index)
Set the value of a single bit to true, with boundary check.
bool get(size_t index) const
Return the value of a single bit, with boundary check.
std::ostream & operator<<(std::ostream &os, Color const &color)
Write a textual representation of the Color the a stream, in the format "(r, g, b,...
bool is_superset(Bitvector const &super, Bitvector const &sub)
Superset or equal.
bool is_strict_subset(Bitvector const &sub, Bitvector const &super)
Strict subset.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Bitvector set_minus(Bitvector const &lhs, Bitvector const &rhs)
Bitvector bitwise_or(Bitvector const &lhs, Bitvector const &rhs, bool use_larger)
Take the bitwise or of two Bitvectors of potentially different size.
bool is_subset(Bitvector const &sub, Bitvector const &super)
Subset or equal.
Bitvector symmetric_difference(Bitvector const &lhs, Bitvector const &rhs)
size_t count() const
Count the number of set bits in the Bitvector, that is, its Hamming weight, or population count (popc...
Bitvector bitwise_and(Bitvector const &lhs, Bitvector const &rhs, bool use_larger)
Take the bitwise and of two Bitvectors of potentially different size.
bool is_strict_superset(Bitvector const &super, Bitvector const &sub)
Strict superset.
size_t size() const
Return the size (number of bits) of this Bitvector.
Bitvector bitwise_xor(Bitvector const &lhs, Bitvector const &rhs, bool use_larger)
Take the bitwise xor of two Bitvectors of potentially different size.