Gecode::Support::BitSetBase Class Reference

Basic bitset support. More...

`#include <bitset-base.hpp>`

## Public Member Functions

| 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

unsigned int | sz
| Size of bitset (number of bits).
Protected Attributes inherited from Gecode::Support::RawBitSetBase
BitSetData * | data
| 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

Basic bitset support.

Definition at line 190 of file bitset-base.hpp.

## Constructor & Destructor Documentation

## BitSetBase() [1/3]

Gecode::Support::BitSetBase::BitSetBase | ( | void |  | ) |

inline

Default constructor (yields empty set).

Definition at line 553 of file bitset-base.hpp.

## BitSetBase() [2/3]

template<class A>

Gecode::Support::BitSetBase::BitSetBase | ( | A & | a,
|  | unsigned int | s,
|  | bool | setbits = false )

inline

Initialize for s bits and allocator a.

Definition at line 558 of file bitset-base.hpp.

## BitSetBase() [3/3]

template<class A>

Gecode::Support::BitSetBase::BitSetBase | ( | A & | a,
|  | const BitSetBase & | bs )

inline

Copy from bitset bs with allocator a.

Definition at line 563 of file bitset-base.hpp.

## Member Function Documentation

## init()

template<class A>

void Gecode::Support::BitSetBase::init | ( | A & | a,
|  | unsigned int | s,
|  | bool | setbits = false )

inline

Initialize for s bits and allocator a (only after default constructor).

Definition at line 568 of file bitset-base.hpp.

## clearall()

void Gecode::Support::BitSetBase::clearall | ( | bool | setbits = false | ) |

inline

Clear sz bits.

Definition at line 580 of file bitset-base.hpp.

## copy()

void Gecode::Support::BitSetBase::copy | ( | const BitSetBase & | bs | ) |

inline

Copy sz bits from bs.

Definition at line 574 of file bitset-base.hpp.

## size()

unsigned int Gecode::Support::BitSetBase::size | ( | void |  | ) | const

inline

Return size of bitset (number of bits).

Definition at line 585 of file bitset-base.hpp.

## get()

bool Gecode::Support::BitSetBase::get | ( | unsigned int | i | ) | const

inline

Access value at bit i.

Definition at line 590 of file bitset-base.hpp.

## set()

void Gecode::Support::BitSetBase::set | ( | unsigned int | i | ) |

inline

Set bit i.

Definition at line 595 of file bitset-base.hpp.

## clear()

void Gecode::Support::BitSetBase::clear | ( | unsigned int | i | ) |

inline

Clear bit i.

Definition at line 600 of file bitset-base.hpp.

## next()

unsigned int Gecode::Support::BitSetBase::next | ( | unsigned 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 606 of file bitset-base.hpp.

## status()

BitSetStatus Gecode::Support::BitSetBase::status | ( | void |  | ) | const

inline

Return status of bitset.

Definition at line 612 of file bitset-base.hpp.

## all()

bool Gecode::Support::BitSetBase::all | ( | void |  | ) | const

inline

Test whether all bits are set.

Definition at line 617 of file bitset-base.hpp.

## none()

bool Gecode::Support::BitSetBase::none | ( | void |  | ) | const

inline

Test whether no bits are set.

Definition at line 622 of file bitset-base.hpp.

## resize()

template<class A>

void Gecode::Support::BitSetBase::resize | ( | A & | a,
|  | unsigned int | n,
|  | bool | setbits = false )

Resize bitset to n elememts.

Definition at line 542 of file bitset-base.hpp.

## dispose()

template<class A>

void Gecode::Support::BitSetBase::dispose | ( | A & | a | ) |

inline

Dispose memory for bit set.

Definition at line 548 of file bitset-base.hpp.

## Member Data Documentation

## sz

unsigned int Gecode::Support::BitSetBase::sz

protected

Size of bitset (number of bits).

Definition at line 193 of file bitset-base.hpp.

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

- gecode/support/bitset-base.hpp