Zip and Skip Tries
Loading...
Searching...
No Matches
Classes | Functions | Variables
BitString.cuh File Reference

Defines the BitString class for compact character string storage and comparison. More...

#include <array>
#include <bit>
#include <compare>
#include <cstddef>
#include <cstdint>
#include <numeric>
#include <vector>
#include <algorithm>
#include <fstream>
#include <stdexcept>
#include <string>
#include <iostream>
#include "msw.cuh"
#include "cuda_utils.cuh"
Include dependency graph for BitString.cuh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BitString< CHAR_T, CHAR_SIZE_BITS >
 A class to store strings compactly into integers, packing multiple characters into a single word. More...
 
struct  BitString< CHAR_T, CHAR_SIZE_BITS >::ResultLCP
 Structure to hold the result of a comparison, including the ordering and the length of the common prefix. More...
 
class  BitString< CHAR_T, CHAR_SIZE_BITS >::Iterator
 An iterator class for traversing the characters within a BitString. More...
 

Functions

template<typename CHAR_T , unsigned CHAR_SIZE_BITS>
std::ostreamoperator<< (std::ostream &os, const BitString< CHAR_T, CHAR_SIZE_BITS > &bs)
 Overloaded stream insertion operator for printing BitString content.
 

Variables

static constexpr size_t MIN_PAR_COMPARE_WORD_SIZE = 1
 Minimum number of words required to trigger parallel comparison.
 

Detailed Description

Defines the BitString class for compact character string storage and comparison.

This file contains the definition of the BitString template class, which provides mechanisms for storing sequences of characters efficiently by packing them into integer words. It also includes methods for comparing BitString objects, including sequential and parallel (CUDA-based) comparison routines.

Definition in file BitString.cuh.

Function Documentation

◆ operator<<()

template<typename CHAR_T , unsigned CHAR_SIZE_BITS>
std::ostream & operator<< ( std::ostream os,
const BitString< CHAR_T, CHAR_SIZE_BITS > &  bs 
)

Overloaded stream insertion operator for printing BitString content.

Iterates through the BitString using its iterators and prints each character.

Template Parameters
CHAR_TCharacter type.
CHAR_SIZE_BITSBits per character.
Parameters
osThe output stream (e.g., std::cout).
bsThe BitString object to print.
Returns
std::ostream& Reference to the output stream.

Definition at line 710 of file BitString.cuh.

711{
712 for (CHAR_T c : bs)
713 {
714 os << c;
715 }
716 return os;
717}
T * alloc_to_device(size_t size)
Allocates memory on the CUDA device.

Variable Documentation

◆ MIN_PAR_COMPARE_WORD_SIZE

constexpr size_t MIN_PAR_COMPARE_WORD_SIZE = 1
staticconstexpr

Minimum number of words required to trigger parallel comparison.

Note
If the number of words to compare is less than or equal to this value, sequential comparison (seq_k_compare) will be used instead of parallel comparison (par_k_compare). Set to 1 to always prefer parallel comparison when applicable.
Warning
Should not be set to 0.

Definition at line 40 of file BitString.cuh.