Tiny bit-set. More...
#include <extensional.hh>
Public Member Functions | |
TinyBitSet (Space &home, unsigned int n) | |
Initialize sparse bit set for a number of words n. | |
template<unsigned int largersize> | |
TinyBitSet (Space &home, const TinyBitSet< largersize > &tbs) | |
Initialize during cloning. | |
template<class IndexType> | |
TinyBitSet (Space &home, const BitSet< IndexType > &bs) | |
Initialize during cloning. | |
int | limit (void) const |
Get the limit. | |
bool | empty (void) const |
Check whether the set is empty. | |
void | flush (void) |
Make the set empty. | |
unsigned int | width (void) const |
Return the highest active index. | |
void | clear_mask (BitSetData *mask) |
Clear the first limit words in mask. | |
void | add_to_mask (const BitSetData *b, BitSetData *mask) const |
Add to mask. | |
template<bool sparse> | |
void | intersect_with_mask (const BitSetData *mask) |
Intersect with mask, sparse mask if sparse is true. | |
void | intersect_with_masks (const BitSetData *a, const BitSetData *b) |
Intersect with the "or" of and b. | |
bool | intersects (const BitSetData *b) |
Check if has a non-empty intersection with the set. | |
void | nand_with_mask (const BitSetData *b) |
Perform "nand" with b. | |
void | nand_with_masks (const BitSetData *a, const BitSetData *b) |
Perform "nand" with and the "or" of a and b. | |
unsigned long long int | ones (void) const |
Return the number of ones. | |
unsigned long long int | ones (const BitSetData *b) const |
Return the number of ones after intersection with b. | |
unsigned long long int | bits (void) const |
Return an upper bound on the number of bits. | |
unsigned int | words (void) const |
Return the number of required bit set words. | |
unsigned int | size (void) const |
Return the total number of words. | |
template<unsigned int largersz> | |
TinyBitSet (Space &, const TinyBitSet< largersz > &sbs) |
Protected Attributes | |
BitSetData | _bits [_size] |
Words. |
Tiny bit-set.
Definition at line 302 of file extensional.hh.
|
inline |
Initialize sparse bit set for a number of words n.
Set the active bits
Clear unused suffix bits
Definition at line 46 of file tiny-bit-set.hpp.
Gecode::Int::Extensional::TinyBitSet< _size >::TinyBitSet | ( | Space & | home, |
const TinyBitSet< largersize > & | tbs ) |
Initialize during cloning.
|
inline |
Initialize during cloning.
Definition at line 70 of file tiny-bit-set.hpp.
|
inline |
Definition at line 59 of file tiny-bit-set.hpp.
int Gecode::Int::Extensional::TinyBitSet< _size >::limit | ( | void | ) | const |
Get the limit.
|
inline |
Check whether the set is empty.
Definition at line 164 of file tiny-bit-set.hpp.
|
inline |
Make the set empty.
Definition at line 121 of file tiny-bit-set.hpp.
|
inline |
Return the highest active index.
Find the index of the last non-zero word
Definition at line 173 of file tiny-bit-set.hpp.
|
inline |
Clear the first limit words in mask.
Definition at line 82 of file tiny-bit-set.hpp.
|
inline |
Add to mask.
Definition at line 91 of file tiny-bit-set.hpp.
|
inline |
Intersect with mask, sparse mask if sparse is true.
Definition at line 99 of file tiny-bit-set.hpp.
|
inline |
Intersect with the "or" of and b.
Definition at line 106 of file tiny-bit-set.hpp.
|
inline |
Check if has a non-empty intersection with the set.
Definition at line 129 of file tiny-bit-set.hpp.
|
inline |
Perform "nand" with b.
Definition at line 114 of file tiny-bit-set.hpp.
void Gecode::Int::Extensional::TinyBitSet< _size >::nand_with_masks | ( | const BitSetData * | a, |
const BitSetData * | b ) |
Perform "nand" with and the "or" of a and b.
|
inline |
Return the number of ones.
Definition at line 148 of file tiny-bit-set.hpp.
|
inline |
Return the number of ones after intersection with b.
Definition at line 138 of file tiny-bit-set.hpp.
|
inline |
Return an upper bound on the number of bits.
Definition at line 157 of file tiny-bit-set.hpp.
|
inline |
Return the number of required bit set words.
Definition at line 185 of file tiny-bit-set.hpp.
|
inline |
Return the total number of words.
Definition at line 191 of file tiny-bit-set.hpp.
|
protected |
Words.
Definition at line 306 of file extensional.hh.