84struct UninitAllocator : std::allocator< T >
89 using other = UninitAllocator< U >;
91 UninitAllocator(
void ) =
default;
93 UninitAllocator(
const UninitAllocator< U > & )
noexcept { }
95 void construct( U * p )
noexcept(
96 std::is_nothrow_default_constructible_v< U > ) {
97 ::new(
static_cast< void *
>( p ) ) U;
99 template<
class U ,
class... Args >
100 void construct( U * p , Args &&... args ) {
101 ::new(
static_cast< void *
>( p ) ) U( std::forward< Args >( args )... );
125 [[nodiscard]] std::size_t
size(
void )
const;
128 [[nodiscard]]
bool empty(
void )
const;
131 [[nodiscard]]
long dim(
void )
const;
159 [[nodiscard]] std::optional< long >
min(
void )
const;
174 [[nodiscard]] std::optional< long >
max(
void )
const;
202 static std::size_t
size(
const auto & o ) {
return( o.f_N ); }
204 static bool occupied(
const auto & o , std::size_t i ) {
205 return( ( o.f_W[ i / 64 ] >> ( i % 64 ) ) & 1 );
208 static auto read(
const auto & , std::size_t i ) {
return(
long( i ) ); }
236 [[nodiscard]]
bool counted(
void )
const;
257 std::vector< std::uint64_t , detail::UninitAllocator< std::uint64_t > > f_W;
259 std::size_t f_size = 0;
333#include "ADS/set/impl/BoolSet.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The iterators that the containers of the library have in common, beyond the book: they give a contain...
The vector kernels of ADS on Google Highway, with ADS_WITH_HIGHWAY: the loops over arrays that a stru...
a set of integers in as a boolean vector
Definition BoolSet.h:113
friend BoolSet setSymmetricDifference(const BoolSet &A, const BoolSet &B)
the symmetric difference, the items in exactly one of and , a set of dimension
std::optional< long > min(void) const
the smallest item, none if the set is empty, time
void remove(long x)
out of the set, by clearing its bit
const_iterator end(void) const
the iterator past the largest item
Definition BoolSet.h:225
bool empty(void) const
whether the set has no item
const_iterator begin(void) const
the iterator on the smallest item
Definition BoolSet.h:221
const_iterator cend(void) const
as end()
Definition BoolSet.h:231
friend BoolSet setIntersection(const BoolSet &A, const BoolSet &B)
the intersection, a set of dimension
void forEach(F &&f) const
f( x ) on the items in increasing order, time
SlotIterator< BoolSet, Places > const_iterator
the iterator, on the bits set in increasing order
Definition BoolSet.h:217
std::size_t size(void) const
the number of items, kept by the operations,
const_iterator iterator
the same, constant
Definition BoolSet.h:218
friend BoolSet setDifference(const BoolSet &A, const BoolSet &B)
the difference, a set of dimension A.dim()
long reference
an item, by value
Definition BoolSet.h:214
std::optional< long > max(void) const
the largest item, none if the set is empty, time
long value_type
the items
Definition BoolSet.h:211
std::ptrdiff_t difference_type
the distances
Definition BoolSet.h:213
void insert(long x)
into the set, by setting its bit
long const_reference
an item, by value
Definition BoolSet.h:215
const_iterator cbegin(void) const
as begin()
Definition BoolSet.h:229
long Item
the type of the items
Definition BoolSet.h:117
BoolSet(long N)
the empty set of the integers in , the Set( N ) of the book
friend BoolSet setUnion(const BoolSet &A, const BoolSet &B)
the union, a set of dimension
std::size_t size_type
the sizes
Definition BoolSet.h:212
long dim(void) const
the size of the vector
bool contains(long x) const
whether is in the set, false also for an out of , by reading its bit
a bidirectional iterator on the occupied places of the table O, by the policy P with the static funct...
Definition Iterators.h:691
BoolSet setIntersection(const BoolSet &A, const BoolSet &B)
the intersection, a set of dimension
BoolSet setUnion(const BoolSet &A, const BoolSet &B)
the union, a set of dimension
BoolSet setDifference(const BoolSet &A, const BoolSet &B)
the difference, a set of dimension A.dim()
BoolSet setSymmetricDifference(const BoolSet &A, const BoolSet &B)
the symmetric difference, the items in exactly one of and , a set of dimension
the places of the table, for SlotIterator
Definition BoolSet.h:200
static bool occupied(const auto &o, std::size_t i)
whether the bit is set
Definition BoolSet.h:204
static std::size_t size(const auto &o)
the places,
Definition BoolSet.h:202
static auto read(const auto &, std::size_t i)
the item of the place , itself
Definition BoolSet.h:208