Cuda battery library
Loading...
Searching...
No Matches
battery::bitset< N, Mem, T > Class Template Reference

#include <bitset.hpp>

Public Types

using this_type = bitset<N, Mem, T>
 
using memory_type = Mem
 

Public Member Functions

CUDA constexpr bitset ()
 
CUDA constexpr bitset (const this_type &other)
 
template<class Mem2 >
CUDA constexpr bitset (const bitset< N, Mem2, T > &other)
 
CUDA bitset (size_t start, size_t end)
 
CUDA constexpr bitset (const char *bit_str)
 
CUDA constexpr bool test (size_t pos) const
 
CUDA constexpr bool all () const
 
CUDA constexpr bool any () const
 
CUDA constexpr bool none () const
 
CUDA constexpr size_t size () const
 
CUDA constexpr size_t count () const
 
CUDA constexpr bitsetset ()
 
CUDA constexpr bitsetset (size_t pos)
 
CUDA constexpr bitsetset (size_t pos, bool value)
 
CUDA constexpr bitsetreset ()
 
CUDA constexpr bitsetreset (size_t pos)
 
CUDA constexpr bitsetflip ()
 
CUDA constexpr bitsetflip (size_t pos)
 
template<class Mem2 >
CUDA constexpr bool is_subset_of (const bitset< N, Mem2, T > &other) const
 
template<class Mem2 >
CUDA constexpr bool is_proper_subset_of (const bitset< N, Mem2, T > &other) const
 
CUDA constexpr bitset operator~ () const
 
template<class Mem2 >
CUDA constexpr bool operator== (const bitset< N, Mem2, T > &other) const
 
CUDA constexpr int countl_zero () const
 
CUDA constexpr int countl_one () const
 
CUDA constexpr int countr_zero () const
 
CUDA constexpr int countr_one () const
 
CUDA constexpr void print () const
 
template<class Allocator >
CUDA string< Allocator > to_string (Allocator allocator=Allocator()) const
 

Static Public Member Functions

static CUDA constexpr bitset zeroes ()
 
static CUDA constexpr bitset ones ()
 

Friends

template<size_t N2, class Mem2 , class T2 >
class bitset
 

Detailed Description

template<size_t N, class Mem, class T = unsigned long long>
class battery::bitset< N, Mem, T >
Template Parameters
`N`is the number of bits in the bitset.
`Mem`is a memory consistency, for instance local_memory, see memory.hpp.
`T`is the underlying type defining the blocks of the bitset.

Member Typedef Documentation

◆ this_type

template<size_t N, class Mem , class T = unsigned long long>
using battery::bitset< N, Mem, T >::this_type = bitset<N, Mem, T>

◆ memory_type

template<size_t N, class Mem , class T = unsigned long long>
using battery::bitset< N, Mem, T >::memory_type = Mem

Constructor & Destructor Documentation

◆ bitset() [1/5]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr battery::bitset< N, Mem, T >::bitset ( )
inlineconstexpr

◆ bitset() [2/5]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr battery::bitset< N, Mem, T >::bitset ( const this_type & other)
inlineconstexpr

◆ bitset() [3/5]

template<size_t N, class Mem , class T = unsigned long long>
template<class Mem2 >
CUDA constexpr battery::bitset< N, Mem, T >::bitset ( const bitset< N, Mem2, T > & other)
inlineconstexpr

◆ bitset() [4/5]

template<size_t N, class Mem , class T = unsigned long long>
CUDA battery::bitset< N, Mem, T >::bitset ( size_t start,
size_t end )
inline

Create a bitset which is the intersection between bitset().set() and [start..end] (all bits set between start and end). end >= start.

◆ bitset() [5/5]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr battery::bitset< N, Mem, T >::bitset ( const char * bit_str)
inlineconstexpr

Member Function Documentation

◆ zeroes()

template<size_t N, class Mem , class T = unsigned long long>
static CUDA constexpr bitset battery::bitset< N, Mem, T >::zeroes ( )
inlinestaticconstexpr

◆ ones()

template<size_t N, class Mem , class T = unsigned long long>
static CUDA constexpr bitset battery::bitset< N, Mem, T >::ones ( )
inlinestaticconstexpr

◆ test()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bool battery::bitset< N, Mem, T >::test ( size_t pos) const
inlineconstexpr

◆ all()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bool battery::bitset< N, Mem, T >::all ( ) const
inlineconstexpr

◆ any()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bool battery::bitset< N, Mem, T >::any ( ) const
inlineconstexpr

◆ none()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bool battery::bitset< N, Mem, T >::none ( ) const
inlineconstexpr

◆ size()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr size_t battery::bitset< N, Mem, T >::size ( ) const
inlineconstexpr

◆ count()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr size_t battery::bitset< N, Mem, T >::count ( ) const
inlineconstexpr

◆ set() [1/3]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::set ( )
inlineconstexpr

◆ set() [2/3]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::set ( size_t pos)
inlineconstexpr

◆ set() [3/3]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::set ( size_t pos,
bool value )
inlineconstexpr

◆ reset() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::reset ( )
inlineconstexpr

◆ reset() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::reset ( size_t pos)
inlineconstexpr

◆ flip() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::flip ( )
inlineconstexpr

◆ flip() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset & battery::bitset< N, Mem, T >::flip ( size_t pos)
inlineconstexpr

◆ is_subset_of()

template<size_t N, class Mem , class T = unsigned long long>
template<class Mem2 >
CUDA constexpr bool battery::bitset< N, Mem, T >::is_subset_of ( const bitset< N, Mem2, T > & other) const
inlineconstexpr

◆ is_proper_subset_of()

template<size_t N, class Mem , class T = unsigned long long>
template<class Mem2 >
CUDA constexpr bool battery::bitset< N, Mem, T >::is_proper_subset_of ( const bitset< N, Mem2, T > & other) const
inlineconstexpr

◆ operator~()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr bitset battery::bitset< N, Mem, T >::operator~ ( ) const
inlineconstexpr

◆ operator==()

template<size_t N, class Mem , class T = unsigned long long>
template<class Mem2 >
CUDA constexpr bool battery::bitset< N, Mem, T >::operator== ( const bitset< N, Mem2, T > & other) const
inlineconstexpr

◆ countl_zero()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr int battery::bitset< N, Mem, T >::countl_zero ( ) const
inlineconstexpr

◆ countl_one()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr int battery::bitset< N, Mem, T >::countl_one ( ) const
inlineconstexpr

◆ countr_zero()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr int battery::bitset< N, Mem, T >::countr_zero ( ) const
inlineconstexpr

◆ countr_one()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr int battery::bitset< N, Mem, T >::countr_one ( ) const
inlineconstexpr

◆ print()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr void battery::bitset< N, Mem, T >::print ( ) const
inlineconstexpr

◆ to_string()

template<size_t N, class Mem , class T = unsigned long long>
template<class Allocator >
CUDA string< Allocator > battery::bitset< N, Mem, T >::to_string ( Allocator allocator = Allocator()) const
inline

Friends And Related Symbol Documentation

◆ bitset

template<size_t N, class Mem , class T = unsigned long long>
template<size_t N2, class Mem2 , class T2 >
friend class bitset
friend

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