Speclib  0.1.2
The library for writing better CUDA libraries
sp::DenseIntegerSet< Start, Ints > Class Template Reference

A compile-time set of integers, backed by a bitset. More...

#include <DenseIntegerSet.hpp>

Public Types

using ThisType = DenseIntegerSet< Start, Ints >
 
template<typename OtherSet >
using unionWith = decltype(unionHelper(OtherSet{}))
 Union this set with another. More...
 
template<typename OtherSet >
using intersectionWith = decltype(intersectHelper(OtherSet{}))
 Intersect this set with another. More...
 
template<typename OtherSet >
using subtract = decltype(subtractHelper(OtherSet{}.template trimToRange< Start, Max >().template padToRange< Start, Max >()))
 Subtract another set from this one. More...
 
template<int I>
using add = decltype(insertHelper< I >())
 Add an element to the set. More...
 
template<int I>
using remove = decltype(removeHelper< I >())
 Remove an element from the set. More...
 
template<int X>
using addOffset = decltype(offsetHelper< X >())
 Add a constant offset to all members of the set. More...
 

Static Public Member Functions

template<int NewStart, int NewMax>
static constexpr auto padToRange ()
 
template<int NewStart, int NewMax>
static constexpr auto trimToRange ()
 
static constexpr auto trim ()
 
static constexpr int Size ()
 
static constexpr bool Empty ()
 
template<int I>
static constexpr bool contains ()
 

Static Public Attributes

constexpr static int NumValues = Ints::Size
 
constexpr static int Max = Start + (64 * NumValues) - 1
 The maximum value that can possibly be in this set. More...
 

Detailed Description

template<int Start, typename Ints>
class sp::DenseIntegerSet< Start, Ints >

A compile-time set of integers, backed by a bitset.

Template Parameters
StartThe value represented by the lsb of the first stored int.
IntsAn sp::integer_sequence of uint64_t, where each bit represents if the corresponding value is in the set.

Member Typedef Documentation

◆ add

template<int Start, typename Ints >
template<int I>
using sp::DenseIntegerSet< Start, Ints >::add = decltype(insertHelper<I>())

Add an element to the set.

◆ addOffset

template<int Start, typename Ints >
template<int X>
using sp::DenseIntegerSet< Start, Ints >::addOffset = decltype(offsetHelper<X>())

Add a constant offset to all members of the set.

◆ intersectionWith

template<int Start, typename Ints >
template<typename OtherSet >
using sp::DenseIntegerSet< Start, Ints >::intersectionWith = decltype(intersectHelper(OtherSet{}))

Intersect this set with another.

◆ remove

template<int Start, typename Ints >
template<int I>
using sp::DenseIntegerSet< Start, Ints >::remove = decltype(removeHelper<I>())

Remove an element from the set.

◆ subtract

template<int Start, typename Ints >
template<typename OtherSet >
using sp::DenseIntegerSet< Start, Ints >::subtract = decltype(subtractHelper(OtherSet{}.template trimToRange<Start, Max>().template padToRange<Start, Max>()))

Subtract another set from this one.

◆ unionWith

template<int Start, typename Ints >
template<typename OtherSet >
using sp::DenseIntegerSet< Start, Ints >::unionWith = decltype(unionHelper(OtherSet{}))

Union this set with another.

Member Data Documentation

◆ Max

template<int Start, typename Ints >
constexpr static int sp::DenseIntegerSet< Start, Ints >::Max = Start + (64 * NumValues) - 1
staticconstexpr

The maximum value that can possibly be in this set.