27#include <dynamic_bitset.h>
32#if defined( _MSC_VER )
37typedef SSIZE_T ssize_t;
53 bool operator*()
const {
return m_set->test( m_pos ); }
84 bool operator*()
const {
return m_set->test( m_pos ); }
110 BASE_SET(
size_t size = 64 ) : sul::dynamic_bitset<uint64_t>( size ) {}
118 sul::dynamic_bitset<uint64_t>::resize( pos + 1 );
120 sul::dynamic_bitset<uint64_t>::set(pos);
128 sul::dynamic_bitset<uint64_t>::resize( pos + 1 );
130 sul::dynamic_bitset<uint64_t>::set(pos, value);
137 sul::dynamic_bitset<uint64_t>::set();
145 sul::dynamic_bitset<uint64_t>::resize( pos + 1 );
147 sul::dynamic_bitset<uint64_t>::reset(pos);
154 sul::dynamic_bitset<uint64_t>::reset();
162 sul::dynamic_bitset<uint64_t>::resize( pos + 1 );
164 sul::dynamic_bitset<uint64_t>::flip(pos);
171 sul::dynamic_bitset<uint64_t>::flip();
188 sul::dynamic_bitset<uint64_t>::operator&=(other);
195 sul::dynamic_bitset<uint64_t>::operator|=(other);
202 sul::dynamic_bitset<uint64_t>::operator^=(other);
228 m_baseSet( baseSet ), m_index( index )
230 advance_to_next_set_bit();
238 advance_to_next_set_bit();
249 while( m_index < m_baseSet.size() && !m_baseSet.test( m_index ) )
268 m_baseSet( baseSet ), m_index( index )
270 advance_to_previous_set_bit();
278 advance_to_previous_set_bit();
284 return m_index != other.
m_index;
289 return m_index == other.
m_index;
295 while( m_index >= 0 && !m_baseSet.test( m_index ) )
349 for(
const auto& bit : bs )
350 hashVal = hashVal * 31 + std::hash<int>()( bit );
BASE_SET operator|(const BASE_SET &lhs, const BASE_SET &rhs)
BASE_SET operator^(const BASE_SET &lhs, const BASE_SET &rhs)
BASE_SET operator&(const BASE_SET &lhs, const BASE_SET &rhs)
auto operator<=>(const const_iterator &) const =default
std::random_access_iterator_tag iterator_category
const_iterator operator+(difference_type n) const
const_iterator(const BASE_SET *set, size_t pos)
difference_type operator-(const const_iterator &other) const
std::ptrdiff_t difference_type
const_iterator & operator++()
auto operator<=>(const iterator &) const =default
difference_type operator-(const iterator &other) const
iterator(BASE_SET *set, size_t pos)
std::ptrdiff_t difference_type
std::random_access_iterator_tag iterator_category
iterator operator+(difference_type n) const
set_bits_iterator & operator++()
void advance_to_next_set_bit()
std::forward_iterator_tag iterator_category
bool operator!=(const set_bits_iterator &other) const
bool operator==(const set_bits_iterator &other) const
const BASE_SET & m_baseSet
std::ptrdiff_t difference_type
set_bits_iterator(const BASE_SET &baseSet, size_t index)
std::ptrdiff_t difference_type
const ssize_t & reference
void advance_to_previous_set_bit()
const BASE_SET & m_baseSet
set_bits_reverse_iterator & operator++()
set_bits_reverse_iterator(const BASE_SET &baseSet, ssize_t index)
bool operator==(const set_bits_reverse_iterator &other) const
ssize_t operator*() const
std::bidirectional_iterator_tag iterator_category
bool operator!=(const set_bits_reverse_iterator &other) const
set_bits_reverse_iterator set_bits_rbegin() const
const_iterator end() const
bool operator<(const BASE_SET &other) const
set_bits_iterator set_bits_end() const
BASE_SET & reset(size_t pos)
BASE_SET & operator^=(const BASE_SET &other)
BASE_SET & flip(size_t pos)
BASE_SET & set(size_t pos, bool value)
BASE_SET operator~() const
set_bits_reverse_iterator set_bits_rend() const
int compare(const BASE_SET &other) const
BASE_SET & set(size_t pos)
const_iterator begin() const
set_bits_iterator set_bits_begin() const
BASE_SET & operator|=(const BASE_SET &other)
BASE_SET & operator&=(const BASE_SET &other)
int lexicographical_compare_three_way(Container1Iter aC1_first, Container1Iter aC1_last, Container2Iter aC2_first, Container2Iter aC2_last)
Compares two containers lexicographically.
size_t operator()(const BASE_SET &bs) const