dune-common  2.2.1
Public Member Functions | Private Attributes | Friends | List of all members
Dune::BitSetVector< block_size, Alloc > Class Template Reference

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

#include <dune/common/bitsetvector.hh>

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

Public Types

typedef std::bitset< block_size > value_type
 Type of the values stored by the container. More...
 
typedef BitSetVectorReference
< block_size, Allocator > 
reference
 Reference to a small block of bits. More...
 
typedef
BitSetVectorConstReference
< block_size, Allocator > 
const_reference
 Const reference to a small block of bits. More...
 
typedef BitSetVectorReference
< block_size, Allocator > * 
pointer
 Pointer to a small block of bits. More...
 
typedef
BitSetVectorConstReference
< block_size, Allocator > * 
const_pointer
 Const pointer to a small block of bits. More...
 
typedef std::vector< bool,
Allocator >::size_type 
size_type
 size type More...
 
typedef Allocator allocator_type
 The type of the allocator. More...
 
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. More...
 
const_iterator begin () const
 Returns a const_iterator pointing to the beginning of the vector. More...
 
iterator end ()
 Returns an iterator pointing to the end of the vector. More...
 
const_iterator end () const
 Returns a const_iterator pointing to the end of the vector. More...
 
 BitSetVector ()
 Default constructor. More...
 
 BitSetVector (const BlocklessBaseClass &blocklessBitField)
 Construction from an unblocked bitfield. More...
 
 BitSetVector (int n)
 
 BitSetVector (int n, bool v)
 Constructor which initializes the field with true or false. More...
 
void clear ()
 Erases all of the elements. More...
 
void resize (int n, bool v=bool())
 Resize field. More...
 
size_type size () const
 Return the number of blocks. More...
 
void setAll ()
 Sets all entries to true More...
 
void unsetAll ()
 Sets all entries to false More...
 
reference operator[] (int i)
 Return reference to i-th block. More...
 
const_reference operator[] (int i) const
 Return const reference to i-th block. More...
 
reference back ()
 Return reference to last block. More...
 
const_reference back () const
 Return const reference to last block. More...
 
size_type count () const
 Returns the number of bits that are set. More...
 
size_type countmasked (int j) const
 Returns the number of set bits, while each block is masked with 1<<i. More...
 

Private Attributes

elements
 STL member. More...
 

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. More...
 

Detailed Description

template<int block_size, class Alloc>
class Dune::BitSetVector< block_size, Alloc >

A dynamic array of blocks of booleans.

Member Typedef Documentation

template<int block_size, class Alloc >
typedef Allocator Dune::BitSetVector< block_size, Alloc >::allocator_type

The type of the allocator.

template<int block_size, class Alloc >
typedef Dune::GenericIterator<const BitSetVector<block_size,Allocator>, const value_type, const_reference, std::ptrdiff_t, ForwardIteratorFacade> Dune::BitSetVector< block_size, Alloc >::const_iterator
template<int block_size, class Alloc >
typedef BitSetVectorConstReference<block_size,Allocator>* Dune::BitSetVector< block_size, Alloc >::const_pointer

Const pointer to a small block of bits.

template<int block_size, class Alloc >
typedef BitSetVectorConstReference<block_size,Allocator> Dune::BitSetVector< block_size, Alloc >::const_reference

Const reference to a small block of bits.

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

iterators

template<int block_size, class Alloc >
typedef BitSetVectorReference<block_size,Allocator>* Dune::BitSetVector< block_size, Alloc >::pointer

Pointer to a small block of bits.

template<int block_size, class Alloc >
typedef BitSetVectorReference<block_size,Allocator> Dune::BitSetVector< block_size, Alloc >::reference

Reference to a small block of bits.

template<int block_size, class Alloc >
typedef std::vector<bool, Allocator>::size_type Dune::BitSetVector< block_size, Alloc >::size_type

size type

template<int block_size, class Alloc >
typedef std::bitset<block_size> Dune::BitSetVector< block_size, Alloc >::value_type

Type of the values stored by the container.

container interface typedefs

Constructor & Destructor Documentation

template<int block_size, class Alloc >
Dune::BitSetVector< block_size, Alloc >::BitSetVector ( )
inline

Default constructor.

template<int block_size, class Alloc >
Dune::BitSetVector< block_size, Alloc >::BitSetVector ( const BlocklessBaseClass &  blocklessBitField)
inline

Construction from an unblocked bitfield.

References DUNE_THROW.

template<int block_size, class Alloc >
Dune::BitSetVector< block_size, Alloc >::BitSetVector ( int  n)
inlineexplicit

Constructor with a given length

Parameters
nNumber of blocks
template<int block_size, class Alloc >
Dune::BitSetVector< block_size, Alloc >::BitSetVector ( int  n,
bool  v 
)
inline

Constructor which initializes the field with true or false.

Member Function Documentation

template<int block_size, class Alloc >
reference Dune::BitSetVector< block_size, Alloc >::back ( )
inline

Return reference to last block.

References Dune::BitSetVector< block_size, Alloc >::size().

template<int block_size, class Alloc >
const_reference Dune::BitSetVector< block_size, Alloc >::back ( ) const
inline

Return const reference to last block.

References Dune::BitSetVector< block_size, Alloc >::size().

template<int block_size, class Alloc >
iterator Dune::BitSetVector< block_size, Alloc >::begin ( )
inline

Returns a iterator pointing to the beginning of the vector.

template<int block_size, class Alloc >
const_iterator Dune::BitSetVector< block_size, Alloc >::begin ( ) const
inline

Returns a const_iterator pointing to the beginning of the vector.

template<int block_size, class Alloc >
void Dune::BitSetVector< block_size, Alloc >::clear ( )
inline

Erases all of the elements.

template<int block_size, class Alloc >
size_type Dune::BitSetVector< block_size, Alloc >::count ( ) const
inline

Returns the number of bits that are set.

template<int block_size, class Alloc >
size_type Dune::BitSetVector< block_size, Alloc >::countmasked ( int  j) const
inline

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

References Dune::BitSetVector< block_size, Alloc >::size().

template<int block_size, class Alloc >
iterator Dune::BitSetVector< block_size, Alloc >::end ( )
inline

Returns an iterator pointing to the end of the vector.

References Dune::BitSetVector< block_size, Alloc >::size().

template<int block_size, class Alloc >
const_iterator Dune::BitSetVector< block_size, Alloc >::end ( ) const
inline

Returns a const_iterator pointing to the end of the vector.

References Dune::BitSetVector< block_size, Alloc >::size().

template<int block_size, class Alloc >
reference Dune::BitSetVector< block_size, Alloc >::operator[] ( int  i)
inline

Return reference to i-th block.

template<int block_size, class Alloc >
const_reference Dune::BitSetVector< block_size, Alloc >::operator[] ( int  i) const
inline

Return const reference to i-th block.

template<int block_size, class Alloc >
void Dune::BitSetVector< block_size, Alloc >::resize ( int  n,
bool  v = bool() 
)
inline

Resize field.

template<int block_size, class Alloc >
void Dune::BitSetVector< block_size, Alloc >::setAll ( )
inline

Sets all entries to true

template<int block_size, class Alloc >
size_type Dune::BitSetVector< block_size, Alloc >::size ( ) const
inline
template<int block_size, class Alloc >
void Dune::BitSetVector< block_size, Alloc >::unsetAll ( )
inline

Sets all entries to false

Friends And Related Function Documentation

template<int block_size, class Alloc >
friend class BitSetVectorConstReference< block_size, Allocator >
friend
template<int block_size, class Alloc >
friend class BitSetVectorReference< block_size, Allocator >
friend
template<int block_size, class Alloc >
std::ostream& operator<< ( std::ostream &  s,
const BitSetVector< block_size, Alloc > &  v 
)
friend

Send bitfield to an output stream.


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