linbox
BitVector Class Reference

Binary constant defined both for 32 and 64 bits. More...

#include <bit-vector.h>

Data Structures

class  const_iterator
 
class  const_reference
 
class  iterator
 
class  reference
 

Public Types

typedef bool value_type
 
typedef size_t size_type
 
typedef long difference_type
 
typedef std::vector< unsignedlong >::iterator word_iterator
 
typedef std::vector< unsignedlong >::const_iterator const_word_iterator
 
typedef std::vector< unsignedlong >::reverse_iterator reverse_word_iterator
 
typedef std::vector< unsignedlong >::const_reverse_iterator const_reverse_word_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef iterator pointer
 
typedef const_iterator const_pointer
 

Public Member Functions

 BitVector ()
 
 BitVector (std::vector< bool > &v)
 
 BitVector (std::vector< unsigned long > &v)
 
 BitVector (size_t n, bool val=false)
 
template<class F2Field>
 BitVector (const F2Field &, std::vector< bool > &v)
 
template<class F2Field>
 BitVector (const F2Field &, std::vector< unsigned long > &v)
 
template<class F2Field>
 BitVector (const F2Field &, size_t n, bool val=false)
 
 BitVector (const BitVector &v)
 
 ~BitVector ()
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
const_reverse_iterator rbegin (void) const
 
reverse_iterator rend (void)
 
const_reverse_iterator rend (void) const
 
word_iterator wordBegin (void)
 
const_word_iterator wordBegin (void) const
 
word_iterator wordEnd (void)
 
const_word_iterator wordEnd (void) const
 
reverse_word_iterator wordRbegin (void)
 
const_reverse_word_iterator wordRbegin (void) const
 
reverse_word_iterator wordRend (void)
 
const_reverse_word_iterator wordRend (void) const
 
reference operator[] (size_type n)
 
const_reference operator[] (size_type n) const
 
reference at (size_type n)
 
const_reference at (size_type n) const
 
reference front (void)
 
const_reference front (void) const
 
reference back (void)
 
const_reference back (void) const
 
template<class Container>
BitVectoroperator= (const Container &x)
 
void resize (size_type new_size, bool val=false)
 
pointer data ()
 
size_type size (void) const
 
bool empty (void) const
 
size_type max_size (void) const
 
bool operator== (const BitVector &v) const
 

Protected Attributes

std::vector< unsigned long > _v
 
size_t _size
 

Detailed Description

Binary constant defined both for 32 and 64 bits.

A vector of boolean 0-1 values, stored compactly to save space.

BitVector provides an additional iterator, word_iterator, that gives the bits in compact 32-bit words, so that vector operations may be done in parallel. It is similar to the STL bit_vector except that it provides the aforementioned additional iterator.

Member Typedef Documentation

◆ value_type

typedef bool value_type

◆ size_type

typedef size_t size_type

◆ difference_type

typedef long difference_type

◆ word_iterator

typedef std::vector<unsignedlong>::iterator word_iterator

◆ const_word_iterator

typedef std::vector<unsignedlong>::const_iterator const_word_iterator

◆ reverse_word_iterator

typedef std::vector<unsignedlong>::reverse_iterator reverse_word_iterator

◆ const_reverse_word_iterator

typedef std::vector<unsignedlong>::const_reverse_iterator const_reverse_word_iterator

◆ reverse_iterator

typedef std::reverse_iterator<iterator> reverse_iterator

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> const_reverse_iterator

◆ pointer

typedef iterator pointer

◆ const_pointer

Constructor & Destructor Documentation

◆ BitVector() [1/8]

BitVector ( )
inline

◆ BitVector() [2/8]

BitVector ( std::vector< bool > & v)
inline

◆ BitVector() [3/8]

BitVector ( std::vector< unsigned long > & v)
inline

◆ BitVector() [4/8]

BitVector ( size_t n,
bool val = false )
inline

◆ BitVector() [5/8]

template<class F2Field>
BitVector ( const F2Field & ,
std::vector< bool > & v )
inline

◆ BitVector() [6/8]

template<class F2Field>
BitVector ( const F2Field & ,
std::vector< unsigned long > & v )
inline

◆ BitVector() [7/8]

template<class F2Field>
BitVector ( const F2Field & ,
size_t n,
bool val = false )
inline

◆ BitVector() [8/8]

BitVector ( const BitVector & v)
inline

◆ ~BitVector()

~BitVector ( )
inline

Member Function Documentation

◆ begin() [1/2]

BitVector::iterator begin ( void )
inline

◆ begin() [2/2]

BitVector::const_iterator begin ( void ) const
inline

◆ end() [1/2]

BitVector::iterator end ( void )
inline

◆ end() [2/2]

BitVector::const_iterator end ( void ) const
inline

◆ rbegin() [1/2]

BitVector::reverse_iterator rbegin ( void )
inline

◆ rbegin() [2/2]

BitVector::const_reverse_iterator rbegin ( void ) const
inline

◆ rend() [1/2]

BitVector::reverse_iterator rend ( void )
inline

◆ rend() [2/2]

BitVector::const_reverse_iterator rend ( void ) const
inline

◆ wordBegin() [1/2]

word_iterator wordBegin ( void )
inline

◆ wordBegin() [2/2]

const_word_iterator wordBegin ( void ) const
inline

◆ wordEnd() [1/2]

word_iterator wordEnd ( void )
inline

◆ wordEnd() [2/2]

const_word_iterator wordEnd ( void ) const
inline

◆ wordRbegin() [1/2]

reverse_word_iterator wordRbegin ( void )
inline

◆ wordRbegin() [2/2]

const_reverse_word_iterator wordRbegin ( void ) const
inline

◆ wordRend() [1/2]

reverse_word_iterator wordRend ( void )
inline

◆ wordRend() [2/2]

const_reverse_word_iterator wordRend ( void ) const
inline

◆ operator[]() [1/2]

◆ operator[]() [2/2]

BitVector::const_reference operator[] ( BitVector::size_type n) const
inline

◆ at() [1/2]

◆ at() [2/2]

◆ front() [1/2]

BitVector::reference front ( void )
inline

◆ front() [2/2]

BitVector::const_reference front ( void ) const
inline

◆ back() [1/2]

BitVector::reference back ( void )
inline

◆ back() [2/2]

BitVector::const_reference back ( void ) const
inline

◆ operator=()

template<class Container>
BitVector & operator= ( const Container & x)
inline

◆ resize()

void resize ( BitVector::size_type new_size,
bool val = false )
inline

◆ data()

BitVector::pointer data ( )
inline

◆ size()

size_type size ( void ) const
inline

◆ empty()

bool empty ( void ) const
inline

◆ max_size()

size_type max_size ( void ) const
inline

◆ operator==()

bool operator== ( const BitVector & v) const
inline

Field Documentation

◆ _v

std::vector<unsigned long> _v
protected

◆ _size

size_t _size
protected

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