Loading...
Searching...
No Matches
Dune::BitSetVector< block_size, Allocator > Class Template Reference

A dynamic array of blocks of booleans. More...

`#include <dune/common/bitsetvector.hh>`

Inheritance diagram for Dune::BitSetVector< block_size, Allocator >:

## Public Types

typedef std::bitset< block_size > | value_type
| Type of the values stored by the container.
typedef BitSetVectorReference< block_size, Allocator > | reference
| Reference to a small block of bits.
typedef BitSetVectorConstReference< block_size, Allocator > | const_reference
| Const reference to a small block of bits.
typedef BitSetVectorReference< block_size, Allocator > * | pointer
| Pointer to a small block of bits.
typedef BitSetVectorConstReference< block_size, Allocator > * | const_pointer
| Const pointer to a small block of bits.
typedef std::vector< bool, Allocator >::size_type | size_type
| size type
typedef Allocator | allocator_type
| The type of the allocator.
typedef Dune::GenericIterator< BitSetVector< block_size, Allocator >, value_type, reference, std::ptrdiff_t, ForwardIteratorFacade > | iterator
typedef Dune::GenericIterator< const BitSetVector< block_size, Allocator >, const value_type, const_reference, std::ptrdiff_t, ForwardIteratorFacade > | const_iterator

## Public Member Functions

iterator | begin ()
| Returns a iterator pointing to the beginning of the vector.
const_iterator | begin () const
| Returns a const_iterator pointing to the beginning of the vector.
iterator | end ()
| Returns an iterator pointing to the end of the vector.
const_iterator | end () const
| Returns a const_iterator pointing to the end of the vector.
| BitSetVector ()
| Default constructor.
| BitSetVector (const BlocklessBaseClass &blocklessBitField)
| Construction from an unblocked bitfield.
| BitSetVector (int n)
| BitSetVector (int n, bool v)
| Constructor which initializes the field with true or false.
void | clear ()
| Erases all of the elements.
void | resize (int n, bool v=bool())
| Resize field.
size_type | size () const
| Return the number of blocks.
void | setAll ()
| Sets all entries to true .
void | unsetAll ()
| Sets all entries to false .
reference | operator[] (int i)
| Return reference to i-th block.
const_reference | operator[] (int i) const
| Return const reference to i-th block.
reference | back ()
| Return reference to last block.
const_reference | back () const
| Return const reference to last block.
size_type | count () const
| Returns the number of bits that are set.
size_type | countmasked (int j) const
| Returns the number of set bits, while each block is masked with 1<<i.

## Friends

class | BitSetVectorReference< block_size, Allocator >
class | BitSetVectorConstReference< block_size, Allocator >
std::ostream & | operator<< (std::ostream &s, const BitSetVector &v)
| Send bitfield to an output stream.

## Detailed Description

template<int block_size, class Allocator = std::allocator<bool>>
class Dune::BitSetVector< block_size, Allocator >

A dynamic array of blocks of booleans.

## Member Typedef Documentation

## allocator_type

template<int block_size, class Allocator = std::allocator<bool>>

typedef Allocator Dune::BitSetVector< block_size, Allocator >::allocator_type

The type of the allocator.

## const_iterator

template<int block_size, class Allocator = std::allocator<bool>>

typedef Dune::GenericIterator<const BitSetVector<block_size,Allocator>, const value_type, const_reference, std::ptrdiff_t, ForwardIteratorFacade> Dune::BitSetVector< block_size, Allocator >::const_iterator

## const_pointer

template<int block_size, class Allocator = std::allocator<bool>>

typedef BitSetVectorConstReference<block_size,Allocator>* Dune::BitSetVector< block_size, Allocator >::const_pointer

Const pointer to a small block of bits.

## const_reference

template<int block_size, class Allocator = std::allocator<bool>>

typedef BitSetVectorConstReference<block_size,Allocator> Dune::BitSetVector< block_size, Allocator >::const_reference

Const reference to a small block of bits.

## iterator

template<int block_size, class Allocator = std::allocator<bool>>

typedef Dune::GenericIterator<BitSetVector<block_size,Allocator>, value_type, reference, std::ptrdiff_t, ForwardIteratorFacade> Dune::BitSetVector< block_size, Allocator >::iterator

iterators

## pointer

template<int block_size, class Allocator = std::allocator<bool>>

typedef BitSetVectorReference<block_size,Allocator>* Dune::BitSetVector< block_size, Allocator >::pointer

Pointer to a small block of bits.

## reference

template<int block_size, class Allocator = std::allocator<bool>>

typedef BitSetVectorReference<block_size,Allocator> Dune::BitSetVector< block_size, Allocator >::reference

Reference to a small block of bits.

## size_type

template<int block_size, class Allocator = std::allocator<bool>>

typedef std::vector<bool,Allocator>::size_type Dune::BitSetVector< block_size, Allocator >::size_type

size type

## value_type

template<int block_size, class Allocator = std::allocator<bool>>

typedef std::bitset<block_size> Dune::BitSetVector< block_size, Allocator >::value_type

Type of the values stored by the container.

container interface typedefs

## Constructor & Destructor Documentation

## BitSetVector() [1/4]

template<int block_size, class Allocator = std::allocator<bool>>

Dune::BitSetVector< block_size, Allocator >::BitSetVector | ( |  | ) |

inline

Default constructor.

## BitSetVector() [2/4]

template<int block_size, class Allocator = std::allocator<bool>>

Dune::BitSetVector< block_size, Allocator >::BitSetVector | ( | const BlocklessBaseClass & | blocklessBitField | ) |

inline

Construction from an unblocked bitfield.

## BitSetVector() [3/4]

template<int block_size, class Allocator = std::allocator<bool>>

Dune::BitSetVector< block_size, Allocator >::BitSetVector | ( | int | n | ) |

inline explicit

Constructor with a given length

Parameters

  n | Number of blocks

## BitSetVector() [4/4]

template<int block_size, class Allocator = std::allocator<bool>>

Dune::BitSetVector< block_size, Allocator >::BitSetVector | ( | int | n,
|  | bool | v )

inline

Constructor which initializes the field with true or false.

## Member Function Documentation

## back() [1/2]

template<int block_size, class Allocator = std::allocator<bool>>

reference Dune::BitSetVector< block_size, Allocator >::back | ( |  | ) |

inline

Return reference to last block.

## back() [2/2]

template<int block_size, class Allocator = std::allocator<bool>>

const_reference Dune::BitSetVector< block_size, Allocator >::back | ( |  | ) | const

inline

Return const reference to last block.

## begin() [1/2]

template<int block_size, class Allocator = std::allocator<bool>>

iterator Dune::BitSetVector< block_size, Allocator >::begin | ( |  | ) |

inline

Returns a iterator pointing to the beginning of the vector.

## begin() [2/2]

template<int block_size, class Allocator = std::allocator<bool>>

const_iterator Dune::BitSetVector< block_size, Allocator >::begin | ( |  | ) | const

inline

Returns a const_iterator pointing to the beginning of the vector.

## clear()

template<int block_size, class Allocator = std::allocator<bool>>

void Dune::BitSetVector< block_size, Allocator >::clear | ( |  | ) |

inline

Erases all of the elements.

## count()

template<int block_size, class Allocator = std::allocator<bool>>

size_type Dune::BitSetVector< block_size, Allocator >::count | ( |  | ) | const

inline

Returns the number of bits that are set.

## countmasked()

template<int block_size, class Allocator = std::allocator<bool>>

size_type Dune::BitSetVector< block_size, Allocator >::countmasked | ( | int | j | ) | const

inline

Returns the number of set bits, while each block is masked with 1<<i.

## end() [1/2]

template<int block_size, class Allocator = std::allocator<bool>>

iterator Dune::BitSetVector< block_size, Allocator >::end | ( |  | ) |

inline

Returns an iterator pointing to the end of the vector.

## end() [2/2]

template<int block_size, class Allocator = std::allocator<bool>>

const_iterator Dune::BitSetVector< block_size, Allocator >::end | ( |  | ) | const

inline

Returns a const_iterator pointing to the end of the vector.

## operator[]() [1/2]

template<int block_size, class Allocator = std::allocator<bool>>

reference Dune::BitSetVector< block_size, Allocator >::operator[] | ( | int | i | ) |

inline

Return reference to i-th block.

## operator[]() [2/2]

template<int block_size, class Allocator = std::allocator<bool>>

const_reference Dune::BitSetVector< block_size, Allocator >::operator[] | ( | int | i | ) | const

inline

Return const reference to i-th block.

## resize()

template<int block_size, class Allocator = std::allocator<bool>>

void Dune::BitSetVector< block_size, Allocator >::resize | ( | int | n,
|  | bool | v = bool() )

inline

Resize field.

## setAll()

template<int block_size, class Allocator = std::allocator<bool>>

void Dune::BitSetVector< block_size, Allocator >::setAll | ( |  | ) |

inline

Sets all entries to true .

## size()

template<int block_size, class Allocator = std::allocator<bool>>

size_type Dune::BitSetVector< block_size, Allocator >::size | ( |  | ) | const

inline

Return the number of blocks.

## unsetAll()

template<int block_size, class Allocator = std::allocator<bool>>

void Dune::BitSetVector< block_size, Allocator >::unsetAll | ( |  | ) |

inline

Sets all entries to false .

## Friends And Related Symbol Documentation

## BitSetVectorConstReference< block_size, Allocator >

template<int block_size, class Allocator = std::allocator<bool>>

friend class BitSetVectorConstReference< block_size, Allocator >

friend

## BitSetVectorReference< block_size, Allocator >

template<int block_size, class Allocator = std::allocator<bool>>

friend class BitSetVectorReference< block_size, Allocator >

friend

## operator<<

template<int block_size, class Allocator = std::allocator<bool>>

std::ostream & operator<< | ( | std::ostream & | s,
|  | const BitSetVector< block_size, Allocator > & | v )

friend

Send bitfield to an output stream.

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

- bitsetvector.hh