Generated on for Gecode by doxygen 1.17.0
Gecode::Int::Extensional::BitSet< IndexType > Class Template Reference

Bit-set. More...

#include <gecode/int/extensional.hh>

Public Member Functions

 BitSet (Space &home, unsigned int n, bool indexed=false)
 Initialize bit set for a number of words n.
template<class OldIndexType>
 BitSet (Space &home, const BitSet< OldIndexType > &bs)
 Initialize during cloning.
 BitSet (Space &home, const TinyBitSet< 1U > &tbs)
 Initialize during cloning (unused).
 BitSet (Space &home, const TinyBitSet< 2U > &tbs)
 Initialize during cloning (unused).
 BitSet (Space &home, const TinyBitSet< 3U > &tbs)
 Initialize during cloning (unused).
 BitSet (Space &home, const TinyBitSet< 4U > &tbs)
 Initialize during cloning (unused).
unsigned int limit (void) const
 Get the number of active words.
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) const
 Clear all active words in mask.
void add_to_mask (const BitSetData *support, BitSetData *mask) const
 Add support to mask.
void add_to_mask (const CompressedSupport &support, BitSetData *mask) const
 Add compressed support list to mask.
template<bool sparse>
void intersect_with_mask (const BitSetData *mask)
 Intersect with mask, sparse mask if sparse is true.
void intersect_with_mask (const CompressedSupport &support)
 Intersect with compressed support list.
void intersect_with_masks (const BitSetData *a, const BitSetData *b)
 Intersect with the "or" of a and b.
void intersect_with_masks (const CompressedSupport &a, const CompressedSupport &b)
 Intersect with the "or" of two compressed support lists.
bool intersects (const BitSetData *mask) const
 Check if has a non-empty intersection with the set.
bool intersects (const CompressedSupport &support) const
 Check if compressed support list intersects with the set.
void nand_with_mask (const BitSetData *mask)
 Perform "nand" with mask.
void nand_with_mask (const CompressedSupport &support)
 Perform "nand" with compressed support list.
unsigned long long int ones (void) const
 Return the number of ones.
unsigned long long int ones (const BitSetData *mask) const
 Return the number of ones after intersection with mask.
unsigned long long int ones (const CompressedSupport &support) const
 Return the number of ones after intersection with compressed support list.
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 number of required bit set words.

Protected Member Functions

void replace_and_decrease (IndexType active_pos, BitSetData word)
 Replace active word active_pos, dropping it if word is zero.

Protected Attributes

IndexType _active_words
 Number of active words.
IndexType _word_capacity
 Number of addressable word slots.
IndexType * _word_index
 Original word index for each active word position.
BitSetData_word_bits
 Active word data.
IndexType * _active_position
 Reverse map from word index to active position+1 (optional).

Detailed Description

template<class IndexType>
class Gecode::Int::Extensional::BitSet< IndexType >

Bit-set.

Definition at line 256 of file extensional.hh.

Constructor & Destructor Documentation

◆ BitSet() [1/6]

template<class IndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
unsigned int n,
bool indexed = false )
inline

Initialize bit set for a number of words n.

Definition at line 118 of file bit-set.hpp.

◆ BitSet() [2/6]

template<class IndexType>
template<class OldIndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
const BitSet< OldIndexType > & bs )
inline

Initialize during cloning.

Definition at line 137 of file bit-set.hpp.

◆ BitSet() [3/6]

template<class IndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
const TinyBitSet< 1U > & tbs )
inline

Initialize during cloning (unused).

Definition at line 170 of file bit-set.hpp.

◆ BitSet() [4/6]

template<class IndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
const TinyBitSet< 2U > & tbs )
inline

Initialize during cloning (unused).

Definition at line 176 of file bit-set.hpp.

◆ BitSet() [5/6]

template<class IndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
const TinyBitSet< 3U > & tbs )
inline

Initialize during cloning (unused).

Definition at line 182 of file bit-set.hpp.

◆ BitSet() [6/6]

template<class IndexType>
Gecode::Int::Extensional::BitSet< IndexType >::BitSet ( Space & home,
const TinyBitSet< 4U > & tbs )
inline

Initialize during cloning (unused).

Definition at line 188 of file bit-set.hpp.

Member Function Documentation

◆ replace_and_decrease()

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::replace_and_decrease ( IndexType active_pos,
BitSetData word )
inlineprotected

Replace active word active_pos, dropping it if word is zero.

Definition at line 195 of file bit-set.hpp.

◆ limit()

template<class IndexType>
unsigned int Gecode::Int::Extensional::BitSet< IndexType >::limit ( void ) const
inline

Get the number of active words.

Definition at line 83 of file bit-set.hpp.

◆ empty()

template<class IndexType>
bool Gecode::Int::Extensional::BitSet< IndexType >::empty ( void ) const
inline

Check whether the set is empty.

Definition at line 89 of file bit-set.hpp.

◆ flush()

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::flush ( void )
inline

Make the set empty.

Definition at line 163 of file bit-set.hpp.

◆ width()

template<class IndexType>
unsigned int Gecode::Int::Extensional::BitSet< IndexType >::width ( void ) const
inline

Return the highest active index.

Definition at line 107 of file bit-set.hpp.

◆ clear_mask()

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::clear_mask ( BitSetData * mask) const
inline

Clear all active words in mask.

Definition at line 219 of file bit-set.hpp.

◆ add_to_mask() [1/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::add_to_mask ( const BitSetData * support,
BitSetData * mask ) const
inline

Add support to mask.

Definition at line 229 of file bit-set.hpp.

◆ add_to_mask() [2/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::add_to_mask ( const CompressedSupport & support,
BitSetData * mask ) const
inline

Add compressed support list to mask.

Definition at line 238 of file bit-set.hpp.

◆ intersect_with_mask() [1/2]

template<class IndexType>
template<bool sparse>
void Gecode::Int::Extensional::BitSet< IndexType >::intersect_with_mask ( const BitSetData * mask)
inline

Intersect with mask, sparse mask if sparse is true.

Definition at line 265 of file bit-set.hpp.

◆ intersect_with_mask() [2/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::intersect_with_mask ( const CompressedSupport & support)
inline

Intersect with compressed support list.

Definition at line 288 of file bit-set.hpp.

◆ intersect_with_masks() [1/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::intersect_with_masks ( const BitSetData * a,
const BitSetData * b )
inline

Intersect with the "or" of a and b.

Definition at line 308 of file bit-set.hpp.

◆ intersect_with_masks() [2/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::intersect_with_masks ( const CompressedSupport & a,
const CompressedSupport & b )
inline

Intersect with the "or" of two compressed support lists.

Definition at line 324 of file bit-set.hpp.

◆ intersects() [1/2]

template<class IndexType>
bool Gecode::Int::Extensional::BitSet< IndexType >::intersects ( const BitSetData * mask) const
inline

Check if has a non-empty intersection with the set.

Definition at line 394 of file bit-set.hpp.

◆ intersects() [2/2]

template<class IndexType>
bool Gecode::Int::Extensional::BitSet< IndexType >::intersects ( const CompressedSupport & support) const
inline

Check if compressed support list intersects with the set.

Definition at line 403 of file bit-set.hpp.

◆ nand_with_mask() [1/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::nand_with_mask ( const BitSetData * mask)
inline

Perform "nand" with mask.

Definition at line 350 of file bit-set.hpp.

◆ nand_with_mask() [2/2]

template<class IndexType>
void Gecode::Int::Extensional::BitSet< IndexType >::nand_with_mask ( const CompressedSupport & support)
inline

Perform "nand" with compressed support list.

Definition at line 363 of file bit-set.hpp.

◆ ones() [1/3]

template<class IndexType>
unsigned long long int Gecode::Int::Extensional::BitSet< IndexType >::ones ( void ) const
inline

Return the number of ones.

Definition at line 469 of file bit-set.hpp.

◆ ones() [2/3]

template<class IndexType>
unsigned long long int Gecode::Int::Extensional::BitSet< IndexType >::ones ( const BitSetData * mask) const
inline

Return the number of ones after intersection with mask.

Definition at line 430 of file bit-set.hpp.

◆ ones() [3/3]

template<class IndexType>
unsigned long long int Gecode::Int::Extensional::BitSet< IndexType >::ones ( const CompressedSupport & support) const
inline

Return the number of ones after intersection with compressed support list.

Definition at line 440 of file bit-set.hpp.

◆ bits()

template<class IndexType>
unsigned long long int Gecode::Int::Extensional::BitSet< IndexType >::bits ( void ) const
inline

Return an upper bound on the number of bits.

Definition at line 478 of file bit-set.hpp.

◆ words()

template<class IndexType>
unsigned int Gecode::Int::Extensional::BitSet< IndexType >::words ( void ) const
inline

Return the number of required bit set words.

Definition at line 95 of file bit-set.hpp.

◆ size()

template<class IndexType>
unsigned int Gecode::Int::Extensional::BitSet< IndexType >::size ( void ) const
inline

Return the number of required bit set words.

Definition at line 101 of file bit-set.hpp.

Member Data Documentation

◆ _active_words

template<class IndexType>
IndexType Gecode::Int::Extensional::BitSet< IndexType >::_active_words
protected

Number of active words.

Definition at line 261 of file extensional.hh.

◆ _word_capacity

template<class IndexType>
IndexType Gecode::Int::Extensional::BitSet< IndexType >::_word_capacity
protected

Number of addressable word slots.

Definition at line 263 of file extensional.hh.

◆ _word_index

template<class IndexType>
IndexType* Gecode::Int::Extensional::BitSet< IndexType >::_word_index
protected

Original word index for each active word position.

Definition at line 265 of file extensional.hh.

◆ _word_bits

template<class IndexType>
BitSetData* Gecode::Int::Extensional::BitSet< IndexType >::_word_bits
protected

Active word data.

Definition at line 267 of file extensional.hh.

◆ _active_position

template<class IndexType>
IndexType* Gecode::Int::Extensional::BitSet< IndexType >::_active_position
protected

Reverse map from word index to active position+1 (optional).

Definition at line 269 of file extensional.hh.


The documentation for this class was generated from the following files: