|
Nemo
2.4.0b
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>
Collaboration diagram for bitstring:Classes | |
| class | reference |
Public Types | |
| typedef unsigned long | _ul |
Public Member Functions | |
| bitstring () | |
| bitstring (size_t length) | |
| bitstring (const bitstring &b) | |
| ~bitstring () | |
| void | reset (size_t length) |
| _ul * | getword_atPos (size_t pos) const |
| _ul * | getword_atIdx (size_t index) const |
| size_t | size () const |
| size_t | nb_words () const |
| bool | at (size_t word, unsigned long bitmask) const |
| 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 | set (size_t n, bool x) |
| Set a bit to 0 or 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) |
| Copy a delimited sequence block. More... | |
| std::string | to_string () const |
| std::string | to_string (size_t from, size_t to) const |
| void | print (size_t from, size_t to) const |
| void | print () const |
Private Attributes | |
| size_t | _size |
| Number of bits in the sequence. More... | |
| size_t | _words |
| Number of _ul-long Words necessary to hold the _size bits. More... | |
| _ul * | _data |
| The sequence. More... | |
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 |
|
inline |
Unchecked copy, assumes we have sames sizes.
Referenced by TTQuanti_diallelic_bitstring_no_pleio::copy_sequence_block(), TTQuanti_diallelic_bitstring_full_pleio::copy_sequence_block(), TTQuanti_diallelic_bitstring_var_pleio::copy_sequence_block(), TProtoBDMI::inherit_low(), TProtoDeletMutations_bitstring::inherit_low(), TT_BDMI::operator=(), TTDeletMutations_bitstring::operator=(), TTQuanti_diallelic_bitstring::operator=(), TTQuanti_diallelic_bitstring::set_bit_sequence(), TT_BDMI::set_sequence(), and TTDeletMutations_bitstring::set_sequence().
|
inline |
|
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 TTQuanti_diallelic_bitstring_no_pleio::init_sequence(), TTQuanti_diallelic_bitstring_full_pleio::init_sequence(), TTQuanti_diallelic_bitstring_var_pleio::init_sequence(), TT_BDMI::mutate_diplo(), TT_BDMI::mutate_haplo(), TTQuanti_diallelic_bitstring::mutate_inplace(), TTDeletMutations_bitstring::mutate_noredraw(), and TTQuanti_diallelic_bitstring::set_allele_value().
|
inline |
References _data.
Referenced by TT_BDMI::store_data(), TTDeletMutations_bitstring::store_data(), and TTQuanti_diallelic_bitstring::store_data().
|
inline |
|
inline |
Counts number of one's in string using a bit table count.
References _bit_count.
Referenced by count().
|
inline |
|
inline |
References _data, and BITS_PER_WORD.
|
inline |
|
inline |
References _data, _size, and BITS_PER_WORD.
|
inline |
References _data, _size, and BITS_PER_WORD.
|
inline |
|
inline |
References _data, _size, _words, and BITSET_WORDS.
Referenced by TTDeletMutBitstrFH::FHread(), TT_BDMI::init(), TTQuanti_diallelic_bitstring::init(), TT_BDMI::init_sequence(), TTDeletMutations_bitstring::init_sequence(), and TT_BDMI::reset().
|
inline |
Set a bit to 1.
References _data, and BITS_PER_WORD.
Referenced by TTDeletMutBitstrFH::FHread(), TT_BDMI::init_sequence(), TTDeletMutations_bitstring::init_sequence(), TTQuanti_diallelic_bitstring::mutate_add(), TTDeletMutations_bitstring::mutate_noredraw(), TTDeletMutations_bitstring::mutate_noredraw_noBackMutation(), TTDeletMutations_bitstring::mutate_redraw(), TTQuanti_diallelic_bitstring::set_allele_bit(), and TTDeletMutations_bitstring::set_allele_value().
|
inline |
|
inline |
Copy bits from an array of unsigned long words.
Referenced by TT_BDMI::retrieve_data(), TTDeletMutations_bitstring::retrieve_data(), and TTQuanti_diallelic_bitstring::retrieve_data().
|
inline |
References _data, _size, and BITS_PER_WORD.
|
inline |
References _data, _size, and BITS_PER_WORD.
|
friend |
Referenced by operator[]().
|
staticprivate |
Referenced by local_popcountl().
|
private |
The sequence.
Referenced by at(), bitstring(), copy(), count(), flip(), getword_atIdx(), getword_atPos(), operator&=(), operator=(), operator[](), operator^=(), operator|=(), operator~(), print(), reset(), set(), set_data(), to_string(), and ~bitstring().
|
private |
Number of bits in the sequence.
Referenced by copy(), operator=(), print(), reset(), size(), and to_string().
|
private |
Number of _ul-long Words necessary to hold the _size bits.
Referenced by bitstring(), copy(), count(), nb_words(), operator&=(), operator=(), operator^=(), operator|=(), operator~(), reset(), and set_data().
1.9.1 -- Nemo is hosted on