Generated on for Gecode by doxygen 1.17.0
Gecode::Int::Extensional::TinyBitSet< _size > Class Template Reference

Tiny bit-set. More...

#include <gecode/int/extensional.hh>

Public Member Functions

 TinyBitSet (Space &home, unsigned int n, bool indexed=false)
 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.
void add_to_mask (const CompressedSupport &s, 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 &s)
 Intersect with compressed support list.
void intersect_with_masks (const BitSetData *a, const BitSetData *b)
 Intersect with the "or" of 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 *b)
 Check if has a non-empty intersection with the set.
bool intersects (const CompressedSupport &s)
 Check if compressed support list intersects with the set.
void nand_with_mask (const BitSetData *b)
 Perform "nand" with b.
void nand_with_mask (const CompressedSupport &s)
 Perform "nand" with compressed support list.
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 ones (const CompressedSupport &s) 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 total number of words.
template<unsigned int largersz>
 TinyBitSet (Space &, const TinyBitSet< largersz > &sbs)

Protected Attributes

BitSetData _bits [_size]
 Words.

Detailed Description

template<unsigned int _size>
class Gecode::Int::Extensional::TinyBitSet< _size >

Tiny bit-set.

Definition at line 340 of file extensional.hh.

Constructor & Destructor Documentation

◆ TinyBitSet() [1/4]

template<unsigned int sz>
Gecode::Int::Extensional::TinyBitSet< sz >::TinyBitSet ( Space & home,
unsigned int n,
bool indexed = false )
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.

◆ TinyBitSet() [2/4]

template<unsigned int _size>
template<unsigned int largersize>
Gecode::Int::Extensional::TinyBitSet< _size >::TinyBitSet ( Space & home,
const TinyBitSet< largersize > & tbs )

Initialize during cloning.

◆ TinyBitSet() [3/4]

template<unsigned int sz>
template<class IndexType>
Gecode::Int::Extensional::TinyBitSet< sz >::TinyBitSet ( Space & home,
const BitSet< IndexType > & bs )
inline

Initialize during cloning.

Definition at line 69 of file tiny-bit-set.hpp.

◆ TinyBitSet() [4/4]

template<unsigned int _size>
template<unsigned int largersz>
Gecode::Int::Extensional::TinyBitSet< _size >::TinyBitSet ( Space & ,
const TinyBitSet< largersz > & sbs )
inline

Definition at line 59 of file tiny-bit-set.hpp.

Member Function Documentation

◆ limit()

template<unsigned int _size>
int Gecode::Int::Extensional::TinyBitSet< _size >::limit ( void ) const

Get the limit.

◆ empty()

template<unsigned int sz>
bool Gecode::Int::Extensional::TinyBitSet< sz >::empty ( void ) const
inline

Check whether the set is empty.

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

◆ flush()

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::flush ( void )
inline

Make the set empty.

Definition at line 171 of file tiny-bit-set.hpp.

◆ width()

template<unsigned int sz>
unsigned int Gecode::Int::Extensional::TinyBitSet< sz >::width ( void ) const
inline

Return the highest active index.

Find the index of the last non-zero word

Definition at line 247 of file tiny-bit-set.hpp.

◆ clear_mask()

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::clear_mask ( BitSetData * mask)
inline

Clear the first limit words in mask.

Definition at line 81 of file tiny-bit-set.hpp.

◆ add_to_mask() [1/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::add_to_mask ( const BitSetData * b,
BitSetData * mask ) const
inline

Add to mask.

Definition at line 90 of file tiny-bit-set.hpp.

◆ add_to_mask() [2/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::add_to_mask ( const CompressedSupport & s,
BitSetData * mask ) const
inline

Add compressed support list to mask.

Definition at line 97 of file tiny-bit-set.hpp.

◆ intersect_with_mask() [1/2]

template<unsigned int sz>
template<bool sparse>
void Gecode::Int::Extensional::TinyBitSet< sz >::intersect_with_mask ( const BitSetData * mask)
inline

Intersect with mask, sparse mask if sparse is true.

Definition at line 109 of file tiny-bit-set.hpp.

◆ intersect_with_mask() [2/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::intersect_with_mask ( const CompressedSupport & s)
inline

Intersect with compressed support list.

Definition at line 116 of file tiny-bit-set.hpp.

◆ intersect_with_masks() [1/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::intersect_with_masks ( const BitSetData * a,
const BitSetData * b )
inline

Intersect with the "or" of and b.

Definition at line 128 of file tiny-bit-set.hpp.

◆ intersect_with_masks() [2/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::intersect_with_masks ( const CompressedSupport & a,
const CompressedSupport & b )
inline

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

Definition at line 136 of file tiny-bit-set.hpp.

◆ intersects() [1/2]

template<unsigned int sz>
bool Gecode::Int::Extensional::TinyBitSet< sz >::intersects ( const BitSetData * b)
inline

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

Definition at line 179 of file tiny-bit-set.hpp.

◆ intersects() [2/2]

template<unsigned int sz>
bool Gecode::Int::Extensional::TinyBitSet< sz >::intersects ( const CompressedSupport & s)
inline

Check if compressed support list intersects with the set.

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

◆ nand_with_mask() [1/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::nand_with_mask ( const BitSetData * b)
inline

Perform "nand" with b.

Definition at line 154 of file tiny-bit-set.hpp.

◆ nand_with_mask() [2/2]

template<unsigned int sz>
void Gecode::Int::Extensional::TinyBitSet< sz >::nand_with_mask ( const CompressedSupport & s)
inline

Perform "nand" with compressed support list.

Definition at line 161 of file tiny-bit-set.hpp.

◆ nand_with_masks()

template<unsigned int _size>
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.

◆ ones() [1/3]

template<unsigned int sz>
unsigned long long int Gecode::Int::Extensional::TinyBitSet< sz >::ones ( void ) const
inline

Return the number of ones.

Definition at line 222 of file tiny-bit-set.hpp.

◆ ones() [2/3]

template<unsigned int sz>
unsigned long long int Gecode::Int::Extensional::TinyBitSet< sz >::ones ( const BitSetData * b) const
inline

Return the number of ones after intersection with b.

Definition at line 199 of file tiny-bit-set.hpp.

◆ ones() [3/3]

template<unsigned int sz>
unsigned long long int Gecode::Int::Extensional::TinyBitSet< sz >::ones ( const CompressedSupport & s) const
inline

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

Definition at line 209 of file tiny-bit-set.hpp.

◆ bits()

template<unsigned int sz>
unsigned long long int Gecode::Int::Extensional::TinyBitSet< sz >::bits ( void ) const
inline

Return an upper bound on the number of bits.

Definition at line 231 of file tiny-bit-set.hpp.

◆ words()

template<unsigned int sz>
unsigned int Gecode::Int::Extensional::TinyBitSet< sz >::words ( void ) const
inline

Return the number of required bit set words.

Definition at line 259 of file tiny-bit-set.hpp.

◆ size()

template<unsigned int sz>
unsigned int Gecode::Int::Extensional::TinyBitSet< sz >::size ( void ) const
inline

Return the total number of words.

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

Member Data Documentation

◆ _bits

template<unsigned int _size>
BitSetData Gecode::Int::Extensional::TinyBitSet< _size >::_bits[_size]
protected

Words.

Definition at line 344 of file extensional.hh.


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