Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Non-template and faster implementation of std::bitset. More...
#include <bitstring.h>
Classes | |
class | reference |
Public Types | |
typedef unsigned long | _ul |
Public Member Functions | |
bitstring (size_t length) | |
bitstring (const bitstring &b) | |
~bitstring () | |
_ul * | getword_atPos (size_t pos) |
_ul * | getword_atIdx (size_t index) |
size_t | size () |
size_t | nb_words () |
bool | at (size_t word, unsigned long bitmask) |
reference | operator[] (size_t pos) |
bool | operator[] (size_t n) const |
bitstring & | operator= (const bitstring &b) |
bitstring & | operator&= (const bitstring &x) |
bitstring & | operator|= (const bitstring &x) |
bitstring & | operator^= (const bitstring &x) |
bitstring | operator~ (void) |
bitstring | operator& (const bitstring &x) |
bitstring | operator| (const bitstring &x) |
bitstring | operator^ (const bitstring &x) |
unsigned int | local_popcountl (_ul wd) |
Counts number of one's in string using a bit table count. More... | |
unsigned int | count () |
Count number of set bits. More... | |
void | set (size_t n) |
Set a bit to 1. More... | |
void | flip (size_t n) |
Flip the bit at n. More... | |
void | set_data (_ul *srce, size_t nbwrd) |
Copy bits from an array of unsigned long words. More... | |
void | reset () |
Set all bits to 0. More... | |
void | copy (const bitstring &b) |
Unchecked copy, assumes we have sames sizes. More... | |
void | copy (const bitstring &b, size_t word_pos) |
Copy one word. More... | |
void | copy (const bitstring &b, size_t from, size_t to) |
Private Attributes | |
size_t | _size |
size_t | _words |
_ul * | _data |
Static Private Attributes | |
static unsigned char | _bit_count [256] |
Friends | |
class | reference |
Non-template and faster implementation of std::bitset.
typedef unsigned long bitstring::_ul |
|
inline |
|
inline |
|
inline |
|
inline |
Unchecked copy, assumes we have sames sizes.
Referenced by TProtoBDMI::inherit(), TProtoDeletMutations_bitstring::inherit_low(), TT_BDMI::operator=(), TTDeletMutations_bitstring::operator=(), TT_BDMI::set_sequence(), and TTDeletMutations_bitstring::set_sequence().
|
inline |
References _data, _size, BITS_PER_WORD, and MASK.
|
inline |
|
inline |
Count number of set bits.
References _data, _words, and local_popcountl().
Referenced by TTDeletMutations_bitstring::set_nb_hmz_mutations(), TTDeletMutations_bitstring::set_nb_htz_mutations(), and TTDeletMutations_bitstring::set_nb_mutations().
|
inline |
Flip the bit at n.
References _data, and BITS_PER_WORD.
Referenced by TT_BDMI::mutate_diplo(), TT_BDMI::mutate_haplo(), and TTDeletMutations_bitstring::mutate_noredraw().
|
inline |
References _data.
Referenced by TT_BDMI::store_data(), and TTDeletMutations_bitstring::store_data().
|
inline |
References _data, and BITS_PER_WORD.
Referenced by bitstring::reference::reference().
Counts number of one's in string using a bit table count.
References _bit_count.
Referenced by count().
|
inline |
References _words.
Referenced by TT_BDMI::retrieve_data(), TTDeletMutations_bitstring::retrieve_data(), TT_BDMI::store_data(), and TTDeletMutations_bitstring::store_data().
|
inline |
References _data, and BITS_PER_WORD.
|
inline |
|
inline |
|
inline |
Set all bits to 0.
Referenced by TTDeletMutBitstrFH::FHread(), TT_BDMI::init_sequence(), TTDeletMutations_bitstring::init_sequence(), and TTNeutralGenesFH::write_PLINK_BED().
|
inline |
Set a bit to 1.
References _data, and BITS_PER_WORD.
Referenced by TTDeletMutBitstrFH::FHread(), TT_BDMI::init_sequence(), TTDeletMutations_bitstring::init_sequence(), TTDeletMutations_bitstring::mutate_noredraw(), TTDeletMutations_bitstring::mutate_noredraw_noBackMutation(), TTDeletMutations_bitstring::mutate_redraw(), and TTDeletMutations_bitstring::set_allele_value().
|
inline |
Copy bits from an array of unsigned long words.
Referenced by TT_BDMI::retrieve_data(), and TTDeletMutations_bitstring::retrieve_data().
|
friend |
|
staticprivate |
Referenced by local_popcountl().
|
private |
Referenced by at(), bitstring(), copy(), count(), flip(), getword_atIdx(), getword_atPos(), operator&=(), operator=(), operator[](), operator^=(), operator|=(), operator~(), reset(), set(), set_data(), and ~bitstring().
|
private |
Referenced by copy(), operator=(), and size().
|
private |
Referenced by bitstring(), copy(), count(), nb_words(), operator&=(), operator=(), operator^=(), operator|=(), operator~(), reset(), and set_data().