Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
Gecode::Support::BitSetOffset< A > Class Template Reference

Bitsets with index offset. More...

#include <bitset-offset.hpp>

Public Member Functions

 BitSetOffset (A &a, unsigned int s, int o)
 Bit set with space for s bits with offset of \o.
 
 BitSetOffset (A &a, const BitSetOffset &bs)
 Copy bit set bs.
 
 ~BitSetOffset (void)
 Destructor.
 
bool get (int i) const
 Access value at bit i.
 
void set (int i)
 Set bit i.
 
void clear (int i)
 Clear bit i.
 
int next (int i) const
 Return position greater or equal i of next set bit (i is allowed to be equal to size)
 
void resize (A &a, unsigned int n, int offset, bool set=false)
 Resize bitset to n elements with specified offset.
 
int offset (void) const
 Retrieve the minimum valid index (the offset).
 
int max_bit (void) const
 Retrieve the maximum valid index.
 
bool valid (int i) const
 Is the bit index valid for this bitset?
 
- Public Member Functions inherited from Gecode::Support::BitSetBase
 BitSetBase (void)
 Default constructor (yields empty set)
 
template<class A >
 BitSetBase (A &a, unsigned int s, bool setbits=false)
 Initialize for s bits and allocator a.
 
template<class A >
 BitSetBase (A &a, const BitSetBase &bs)
 Copy from bitset bs with allocator a.
 
template<class A >
void init (A &a, unsigned int s, bool setbits=false)
 Initialize for s bits and allocator a (only after default constructor)
 
void clearall (bool setbits=false)
 Clear sz bits.
 
void copy (const BitSetBase &bs)
 Copy sz bits from bs.
 
unsigned int size (void) const
 Return size of bitset (number of bits)
 
bool get (unsigned int i) const
 Access value at bit i.
 
void set (unsigned int i)
 Set bit i.
 
void clear (unsigned int i)
 Clear bit i.
 
unsigned int next (unsigned int i) const
 Return position greater or equal i of next set bit (i is allowed to be equal to size)
 
BitSetStatus status (void) const
 Return status of bitset.
 
bool all (void) const
 Test whether all bits are set.
 
bool none (void) const
 Test whether no bits are set.
 
template<class A >
void resize (A &a, unsigned int n, bool setbits=false)
 Resize bitset to n elememts.
 
template<class A >
void dispose (A &a)
 Dispose memory for bit set.
 
- Public Member Functions inherited from Gecode::Support::RawBitSetBase
 RawBitSetBase (void)
 Default constructor (yields empty set)
 
template<class A >
 RawBitSetBase (A &a, unsigned int sz, bool setbits=false)
 Initialize for sz bits and allocator a.
 
template<class A >
 RawBitSetBase (A &a, unsigned int sz, const RawBitSetBase &bs)
 Copy from bitset bs with allocator a.
 
template<class A >
void allocate (A &a, unsigned int sz)
 Allocate for sz bits and allocator a (only after default constructor)
 
template<class A >
void init (A &a, unsigned int sz, bool setbits=false)
 Initialize for sz bits and allocator a (only after default constructor)
 
void clearall (unsigned int sz, bool setbits=false)
 Clear sz bits.
 
void copy (unsigned int sz, const RawBitSetBase &bs)
 Copy sz bits from bs.
 
bool get (unsigned int i) const
 Access value at bit i.
 
void set (unsigned int i)
 Set bit i.
 
void clear (unsigned int i)
 Clear bit i.
 
unsigned int next (unsigned int i) const
 Return position greater or equal i of next set bit (i is allowed to be equal to size)
 
BitSetStatus status (unsigned int sz) const
 Return status of bitset.
 
bool all (unsigned int sz) const
 Test whether all bits are set.
 
bool none (unsigned int sz) const
 Test whether no bits are set.
 
template<class A >
void resize (A &a, unsigned int sz, unsigned int n, bool setbits=false)
 Resize bitset from sz to n elememts.
 
template<class A >
void dispose (A &a, unsigned int sz)
 Dispose memory for bit set.
 

Protected Attributes

A & a
 Allocator.
 
int _offset
 Offset.
 
- Protected Attributes inherited from Gecode::Support::BitSetBase
unsigned int sz
 Size of bitset (number of bits)
 
- Protected Attributes inherited from Gecode::Support::RawBitSetBase
BitSetDatadata
 Stored bits.
 

Additional Inherited Members

- Static Protected Attributes inherited from Gecode::Support::RawBitSetBase
static const unsigned int bpb = BitSetData::bpb
 Bits per base.
 

Detailed Description

template<class A>
class Gecode::Support::BitSetOffset< A >

Bitsets with index offset.

The valid range of indices for a BitSetOffset with s bits and an offset of o is [o, o+1, ..., o+s-1].

Definition at line 51 of file bitset-offset.hpp.

Constructor & Destructor Documentation

◆ BitSetOffset() [1/2]

template<class A >
Gecode::Support::BitSetOffset< A >::BitSetOffset ( A & a,
unsigned int s,
int o )
inline

Bit set with space for s bits with offset of \o.

Definition at line 90 of file bitset-offset.hpp.

◆ BitSetOffset() [2/2]

template<class A >
Gecode::Support::BitSetOffset< A >::BitSetOffset ( A & a,
const BitSetOffset< A > & bs )
inline

Copy bit set bs.

Definition at line 95 of file bitset-offset.hpp.

◆ ~BitSetOffset()

template<class A >
Gecode::Support::BitSetOffset< A >::~BitSetOffset ( void )
inline

Destructor.

Definition at line 100 of file bitset-offset.hpp.

Member Function Documentation

◆ get()

template<class A >
bool Gecode::Support::BitSetOffset< A >::get ( int i) const
inline

Access value at bit i.

Definition at line 106 of file bitset-offset.hpp.

◆ set()

template<class A >
void Gecode::Support::BitSetOffset< A >::set ( int i)
inline

Set bit i.

Definition at line 110 of file bitset-offset.hpp.

◆ clear()

template<class A >
void Gecode::Support::BitSetOffset< A >::clear ( int i)
inline

Clear bit i.

Definition at line 114 of file bitset-offset.hpp.

◆ next()

template<class A >
int Gecode::Support::BitSetOffset< A >::next ( int i) const
inline

Return position greater or equal i of next set bit (i is allowed to be equal to size)

Definition at line 118 of file bitset-offset.hpp.

◆ resize()

template<class A >
void Gecode::Support::BitSetOffset< A >::resize ( A & a,
unsigned int n,
int offset,
bool set = false )

Resize bitset to n elements with specified offset.

Definition at line 122 of file bitset-offset.hpp.

◆ offset()

template<class A >
int Gecode::Support::BitSetOffset< A >::offset ( void ) const
inline

Retrieve the minimum valid index (the offset).

Definition at line 129 of file bitset-offset.hpp.

◆ max_bit()

template<class A >
int Gecode::Support::BitSetOffset< A >::max_bit ( void ) const
inline

Retrieve the maximum valid index.

Definition at line 133 of file bitset-offset.hpp.

◆ valid()

template<class A >
bool Gecode::Support::BitSetOffset< A >::valid ( int i) const
inline

Is the bit index valid for this bitset?

Definition at line 137 of file bitset-offset.hpp.

Member Data Documentation

◆ a

template<class A >
A& Gecode::Support::BitSetOffset< A >::a
protected

Allocator.

Definition at line 54 of file bitset-offset.hpp.

◆ _offset

template<class A >
int Gecode::Support::BitSetOffset< A >::_offset
protected

Offset.

Definition at line 56 of file bitset-offset.hpp.


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