SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
interleaved_bloom_filter.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <seqan3/std/algorithm>
16 #include <seqan3/std/bit>
17 
18 #include <sdsl/bit_vectors.hpp>
19 
22 
23 namespace seqan3
24 {
25 
30 enum data_layout : bool
31 {
33  compressed
34 };
35 
37 struct bin_count : public detail::strong_type<size_t, bin_count, detail::strong_type_skill::convert>
38 {
39  using detail::strong_type<size_t, bin_count, detail::strong_type_skill::convert>::strong_type;
40 };
41 
43 struct bin_size : public detail::strong_type<size_t, bin_size, detail::strong_type_skill::convert>
44 {
45  using detail::strong_type<size_t, bin_size, detail::strong_type_skill::convert>::strong_type;
46 };
47 
49 struct hash_function_count : public detail::strong_type<size_t, hash_function_count, detail::strong_type_skill::convert>
50 {
51  using detail::strong_type<size_t, hash_function_count, detail::strong_type_skill::convert>::strong_type;
52 };
53 
55 struct bin_index : public detail::strong_type<size_t, bin_index, detail::strong_type_skill::convert>
56 {
57  using detail::strong_type<size_t, bin_index, detail::strong_type_skill::convert>::strong_type;
58 };
59 
130 template <data_layout data_layout_mode_ = data_layout::uncompressed>
132 {
133 private:
135  template <data_layout data_layout_mode>
136  friend class interleaved_bloom_filter;
138 
140  using data_type = std::conditional_t<data_layout_mode_ == data_layout::uncompressed,
141  sdsl::bit_vector,
142  sdsl::sd_vector<>>;
143 
145  size_t bins{};
147  size_t technical_bins{};
149  size_t bin_size_{};
151  size_t hash_shift{};
153  size_t bin_words{};
155  size_t hash_funs{};
157  data_type data{};
159  static constexpr std::array<size_t, 5> hash_seeds{13572355802537770549ULL, // 2**64 / (e/2)
160  13043817825332782213ULL, // 2**64 / sqrt(2)
161  10650232656628343401ULL, // 2**64 / sqrt(3)
162  16499269484942379435ULL, // 2**64 / (sqrt(5)/2)
163  4893150838803335377ULL}; // 2**64 / (3*pi/5)
164 
172  inline constexpr size_t hash_and_fit(size_t h, size_t const seed) const
173  {
174  h *= seed;
175  assert(hash_shift < 64);
176  h ^= h >> hash_shift; // XOR and shift higher bits into lower bits
177  h *= 11400714819323198485ULL; // = 2^64 / golden_ration, to expand h to 64 bit range
178  // Use fastrange (integer modulo without division) if possible.
179 #ifdef __SIZEOF_INT128__
180  h = static_cast<uint64_t>((static_cast<__uint128_t>(h) * static_cast<__uint128_t>(bin_size_)) >> 64);
181 #else
182  h %= bin_size_;
183 #endif
184  h *= technical_bins;
185  return h;
186  }
187 
188 public:
190  static constexpr data_layout data_layout_mode = data_layout_mode_;
191 
192  class membership_agent; // documented upon definition below
193  template <std::integral value_t>
194  class counting_agent_type; // documented upon definition below
195 
205 
225  {
226  bins = bins_.get();
227  bin_size_ = size.get();
228  hash_funs = funs.get();
229 
230  if (bins == 0)
231  throw std::logic_error{"The number of bins must be > 0."};
232  if (hash_funs == 0 || hash_funs > 5)
233  throw std::logic_error{"The number of hash functions must be > 0 and <= 5."};
234  if (bin_size_ == 0)
235  throw std::logic_error{"The size of a bin must be > 0."};
236 
237  hash_shift = std::countl_zero(bin_size_);
238  bin_words = (bins + 63) >> 6; // = ceil(bins/64)
239  technical_bins = bin_words << 6; // = bin_words * 64
240  data = sdsl::bit_vector(technical_bins * bin_size_);
241  }
242 
258  {
259  std::tie(bins, technical_bins, bin_size_, hash_shift, bin_words, hash_funs) =
260  std::tie(ibf.bins, ibf.technical_bins, ibf.bin_size_, ibf.hash_shift, ibf.bin_words, ibf.hash_funs);
261 
262  data = sdsl::sd_vector<>{ibf.data};
263  }
265 
281  void emplace(size_t const value, bin_index const bin) noexcept
285  {
286  assert(bin.get() < bins);
287  for (size_t i = 0; i < hash_funs; ++i)
288  {
289  size_t idx = hash_and_fit(value, hash_seeds[i]);
290  idx += bin.get();
291  assert(idx < data.size());
292  data[idx] = 1;
293  };
294  }
295 
307  void clear(bin_index const bin) noexcept
311  {
312  assert(bin.get() < bins);
313  for (size_t idx = bin.get(), i = 0; i < bin_size_; idx += technical_bins, ++i)
314  data[idx] = 0;
315  }
316 
330  template <typename rng_t>
334  void clear(rng_t && bin_range) noexcept
335  {
336  static_assert(std::ranges::forward_range<rng_t>, "The range of bins to clear must model a forward_range.");
337  static_assert(std::same_as<std::remove_cvref_t<std::ranges::range_reference_t<rng_t>>, bin_index>,
338  "The reference type of the range to clear must be seqan3::bin_index.");
339 #ifndef NDEBUG
340  for (auto && bin : bin_range)
341  assert(bin.get() < bins);
342 #endif // NDEBUG
343 
344  for (size_t offset = 0, i = 0; i < bin_size_; offset += technical_bins, ++i)
345  for (auto && bin : bin_range)
346  data[bin.get() + offset] = 0;
347  }
348 
372  void increase_bin_number_to(bin_count const new_bins_)
376  {
377  size_t new_bins = new_bins_.get();
378 
379  if (new_bins < bins)
380  throw std::invalid_argument{"The number of new bins must be >= the current number of bins."};
381 
382  // Equivalent to ceil(new_bins / 64)
383  size_t new_bin_words = (new_bins + 63) >> 6;
384 
385  bins = new_bins;
386 
387  if (new_bin_words == bin_words) // No need for internal resize if bin_words does not change.
388  return;
389 
390  size_t new_technical_bins = new_bin_words << 6;
391  size_t new_bits = bin_size_ * new_technical_bins;
392 
393  size_t idx_{new_bits}, idx{data.size()};
394  size_t delta = new_technical_bins - technical_bins + 64;
395 
396  data.resize(new_bits);
397 
398  for (size_t i = idx_, j = idx; j > 0; i -= new_technical_bins, j -= technical_bins)
399  {
400  size_t stop = i - new_technical_bins;
401 
402  for (size_t ii = i - delta, jj = j - 64; stop && ii >= stop; ii -= 64, jj -= 64)
403  {
404  uint64_t old = data.get_int(jj);
405  data.set_int(jj, 0);
406  data.set_int(ii, old);
407  }
408  }
409 
410  bin_words = new_bin_words;
411  technical_bins = new_technical_bins;
412  }
414 
430  {
432  }
433 
445  template <typename value_t = uint16_t>
447  {
448  return counting_agent_type<value_t>{*this};
449  }
451 
458  size_t hash_function_count() const noexcept
459  {
460  return hash_funs;
461  }
462 
466  size_t bin_count() const noexcept
467  {
468  return bins;
469  }
470 
474  size_t bin_size() const noexcept
475  {
476  return bin_size_;
477  }
478 
482  size_t bit_size() const noexcept
483  {
484  return data.size();
485  }
487 
496  friend bool operator==(interleaved_bloom_filter const & lhs, interleaved_bloom_filter const & rhs) noexcept
497  {
498  return std::tie(lhs.bins, lhs.technical_bins, lhs.bin_size_, lhs.hash_shift, lhs.bin_words, lhs.hash_funs,
499  lhs.data) ==
500  std::tie(rhs.bins, rhs.technical_bins, rhs.bin_size_, rhs.hash_shift, rhs.bin_words, rhs.hash_funs,
501  rhs.data);
502  }
503 
509  friend bool operator!=(interleaved_bloom_filter const & lhs, interleaved_bloom_filter const & rhs) noexcept
510  {
511  return !(lhs == rhs);
512  }
514 
525  constexpr data_type & raw_data() noexcept
526  {
527  return data;
528  }
529 
531  constexpr data_type const & raw_data() const noexcept
532  {
533  return data;
534  }
536 
544  template <cereal_archive archive_t>
545  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
546  {
547  archive(bins);
548  archive(technical_bins);
549  archive(bin_size_);
550  archive(hash_shift);
551  archive(bin_words);
552  archive(hash_funs);
553  archive(data);
554  }
556 };
557 
568 template <data_layout data_layout_mode>
570 {
571 private:
574 
576  ibf_t const * ibf_ptr{nullptr};
577 
578 public:
579  class binning_bitvector;
580 
584  membership_agent() = default;
585  membership_agent(membership_agent const &) = default;
589  ~membership_agent() = default;
590 
595  explicit membership_agent(ibf_t const & ibf) :
596  ibf_ptr(std::addressof(ibf)), result_buffer(ibf.bin_count())
597  {}
599 
602 
623  [[nodiscard]] binning_bitvector const & bulk_contains(size_t const value) & noexcept
624  {
625  assert(ibf_ptr != nullptr);
626  assert(result_buffer.size() == ibf_ptr->bin_count());
627 
628  std::array<size_t, 5> bloom_filter_indices;
629  std::memcpy(&bloom_filter_indices, &ibf_ptr->hash_seeds, sizeof(size_t) * ibf_ptr->hash_funs);
630 
631  for (size_t i = 0; i < ibf_ptr->hash_funs; ++i)
632  bloom_filter_indices[i] = ibf_ptr->hash_and_fit(value, bloom_filter_indices[i]);
633 
634  for (size_t batch = 0; batch < ibf_ptr->bin_words; ++batch)
635  {
636  size_t tmp{-1ULL};
637  for (size_t i = 0; i < ibf_ptr->hash_funs; ++i)
638  {
639  assert(bloom_filter_indices[i] < ibf_ptr->data.size());
640  tmp &= ibf_ptr->data.get_int(bloom_filter_indices[i]);
641  bloom_filter_indices[i] += 64;
642  }
643 
644  result_buffer.data.set_int(batch << 6, tmp);
645  }
646 
647  return result_buffer;
648  }
649 
650  // `bulk_contains` cannot be called on a temporary, since the object the returned reference points to
651  // is immediately destroyed.
652  [[nodiscard]] binning_bitvector const & bulk_contains(size_t const value) && noexcept = delete;
654 
655 };
656 
658 template <data_layout data_layout_mode>
660 {
661 private:
663  using data_type = sdsl::bit_vector;
665  data_type data{};
666 
667  friend class membership_agent;
668 
669  template <std::integral value_t>
670  friend class counting_vector;
671 
672 public:
676  binning_bitvector() = default;
681  ~binning_bitvector() = default;
682 
684  explicit binning_bitvector(size_t const size) :
685  data(size)
686  {}
688 
690  size_t size() const noexcept
691  {
692  return data.size();
693  }
694 
699  auto begin() noexcept
700  {
701  return data.begin();
702  }
703 
705  auto begin() const noexcept
706  {
707  return data.begin();
708  }
709 
711  auto end() noexcept
712  {
713  return data.end();
714  }
715 
717  auto end() const noexcept
718  {
719  return data.end();
720  }
722 
727  friend bool operator==(binning_bitvector const & lhs, binning_bitvector const & rhs) noexcept
728  {
729  return lhs.data == rhs.data;
730  }
731 
733  friend bool operator!=(binning_bitvector const & lhs, binning_bitvector const & rhs) noexcept
734  {
735  return !(lhs == rhs);
736  }
737 
738 #ifdef SEQAN3_DEPRECATED_310
741  SEQAN3_DEPRECATED_310 friend bool operator==(binning_bitvector const & lhs, sdsl::bit_vector const & rhs) noexcept
742  {
743  return lhs.data == rhs;
744  }
745 
748  SEQAN3_DEPRECATED_310 friend bool operator==(sdsl::bit_vector const & lhs, binning_bitvector const & rhs) noexcept
749  {
750  return lhs == rhs.data;
751  }
752 
755  SEQAN3_DEPRECATED_310 friend bool operator!=(binning_bitvector const & lhs, sdsl::bit_vector const & rhs) noexcept
756  {
757  return !(lhs.data == rhs);
758  }
759 
762  SEQAN3_DEPRECATED_310 friend bool operator!=(sdsl::bit_vector const & lhs, binning_bitvector const & rhs) noexcept
763  {
764  return !(lhs == rhs.data);
765  }
766 #endif // SEQAN3_DEPRECATED_310
768 
773  auto operator[](size_t const i) noexcept
774  {
775  assert(i < size());
776  return data[i];
777  }
778 
780  auto operator[](size_t const i) const noexcept
781  {
782  assert(i < size());
783  return data[i];
784  }
785 
793  constexpr data_type & raw_data() noexcept
794  {
795  return data;
796  }
797 
799  constexpr data_type const & raw_data() const noexcept
800  {
801  return data;
802  }
804 };
805 
828 template <std::integral value_t>
829 class counting_vector : public std::vector<value_t>
830 {
831 private:
834 public:
838  counting_vector() = default;
839  counting_vector(counting_vector const &) = default;
843  ~counting_vector() = default;
844 
845  using base_t::base_t;
847 
860  template <typename rhs_t>
862  requires std::same_as<rhs_t,
864  ||
865  std::same_as<rhs_t,
868  counting_vector & operator+=(rhs_t const & rhs)
869  {
870  assert(this->size() >= rhs.size()); // The counting vector may be bigger than what we need.
871 
872  // Each iteration can handle 64 bits, so we need to iterate `((rhs.size() + 63) >> 6` many times
873  for (size_t batch = 0, bin = 0; batch < ((rhs.size() + 63) >> 6); bin = 64 * ++batch)
874  {
875  size_t tmp = rhs.data.get_int(batch * 64); // get 64 bits starting at position `batch * 64`
876  if (tmp ^ (1ULL<<63)) // This is a special case, because we would shift by 64 (UB) in the while loop.
877  {
878  while (tmp > 0)
879  {
880  // Jump to the next 1 and increment the corresponding vector entry.
881  uint8_t step = std::countr_zero(tmp);
882  bin += step++;
883  tmp >>= step;
884  ++(*this)[bin++];
885  }
886  }
887  else
888  {
889  ++(*this)[bin + 63];
890  }
891  }
892  return *this;
893  }
894 
906  {
907  assert(this->size() >= rhs.size()); // The counting vector may be bigger than what we need.
908 
909  std::transform(this->begin(), this->end(), rhs.begin(), this->begin(), std::plus<value_t>());
910 
911  return *this;
912  }
913 };
914 
924 template <data_layout data_layout_mode>
925 template <std::integral value_t>
927 {
928 private:
931 
933  ibf_t const * ibf_ptr{nullptr};
934 
937 
938 public:
942  counting_agent_type() = default;
947  ~counting_agent_type() = default;
948 
953  explicit counting_agent_type(ibf_t const & ibf) :
954  ibf_ptr(std::addressof(ibf)), membership_agent(ibf), result_buffer(ibf.bin_count())
955  {}
957 
960 
983  template <std::ranges::range value_range_t>
984  [[nodiscard]] counting_vector<value_t> const & bulk_count(value_range_t && values) & noexcept
985  {
986  assert(ibf_ptr != nullptr);
987  assert(result_buffer.size() == ibf_ptr->bin_count());
988 
989  static_assert(std::ranges::input_range<value_range_t>, "The values must model input_range.");
990  static_assert(std::unsigned_integral<std::ranges::range_value_t<value_range_t>>,
991  "An individual value must be an unsigned integral.");
992 
993  std::ranges::fill(result_buffer, 0);
994 
995  for (auto && value : values)
996  result_buffer += membership_agent.bulk_contains(value);
997 
998  return result_buffer;
999  }
1000 
1001  // `bulk_count` cannot be called on a temporary, since the object the returned reference points to
1002  // is immediately destroyed.
1003  template <std::ranges::range value_range_t>
1004  [[nodiscard]] counting_vector<value_t> const & bulk_count(value_range_t && values) && noexcept = delete;
1006 
1007 };
1008 
1010 
1011 } // namespace seqan3
Adaptations of algorithms from the Ranges TS.
Provides the C++20 <bit> header if it is not already available.
Adaptions of concepts from the Cereal library.
A data structure that behaves like a std::vector and can be used to consolidate the results of multip...
Definition: interleaved_bloom_filter.hpp:830
counting_vector & operator+=(rhs_t const &rhs)
Bin-wise adds the bits of a seqan3::interleaved_bloom_filter::membership_agent::binning_bitvector.
Definition: interleaved_bloom_filter.hpp:868
counting_vector(counting_vector const &)=default
Defaulted.
~counting_vector()=default
Defaulted.
counting_vector(counting_vector &&)=default
Defaulted.
counting_vector & operator=(counting_vector &&)=default
Defaulted.
counting_vector()=default
Defaulted.
counting_vector & operator=(counting_vector const &)=default
Defaulted.
counting_vector & operator+=(counting_vector const &rhs)
Bin-wise addition of two seqan3::counting_vectors.
Definition: interleaved_bloom_filter.hpp:905
Manages counting ranges of values for the seqan3::interleaved_bloom_filter.
Definition: interleaved_bloom_filter.hpp:927
counting_agent_type & operator=(counting_agent_type const &)=default
Defaulted.
counting_vector< value_t > const & bulk_count(value_range_t &&values) &noexcept
Counts the occurrences in each bin for all values in a range.
Definition: interleaved_bloom_filter.hpp:984
counting_agent_type(counting_agent_type &&)=default
Defaulted.
counting_agent_type(counting_agent_type const &)=default
Defaulted.
counting_agent_type & operator=(counting_agent_type &&)=default
Defaulted.
counting_vector< value_t > result_buffer
Stores the result of bulk_count().
Definition: interleaved_bloom_filter.hpp:959
A bitvector representing the result of a call to bulk_contains of the seqan3::interleaved_bloom_filte...
Definition: interleaved_bloom_filter.hpp:660
auto end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: interleaved_bloom_filter.hpp:711
auto end() const noexcept
Returns an iterator to the element following the last element of the container.
Definition: interleaved_bloom_filter.hpp:717
SEQAN3_DEPRECATED_310 friend bool operator==(binning_bitvector const &lhs, sdsl::bit_vector const &rhs) noexcept
Test for equality.
Definition: interleaved_bloom_filter.hpp:741
SEQAN3_DEPRECATED_310 friend bool operator!=(sdsl::bit_vector const &lhs, binning_bitvector const &rhs) noexcept
Test for inequality.
Definition: interleaved_bloom_filter.hpp:762
binning_bitvector & operator=(binning_bitvector const &)=default
Defaulted.
binning_bitvector(size_t const size)
Construct with given size.
Definition: interleaved_bloom_filter.hpp:684
SEQAN3_DEPRECATED_310 friend bool operator==(sdsl::bit_vector const &lhs, binning_bitvector const &rhs) noexcept
Test for equality.
Definition: interleaved_bloom_filter.hpp:748
auto operator[](size_t const i) const noexcept
Return the i-th element.
Definition: interleaved_bloom_filter.hpp:780
size_t size() const noexcept
Returns the number of elements.
Definition: interleaved_bloom_filter.hpp:690
auto begin() noexcept
Returns an iterator to the first element of the container.
Definition: interleaved_bloom_filter.hpp:699
constexpr data_type const & raw_data() const noexcept
Provides direct, unsafe access to the underlying data structure.
Definition: interleaved_bloom_filter.hpp:799
auto begin() const noexcept
Returns an iterator to the first element of the container.
Definition: interleaved_bloom_filter.hpp:705
constexpr data_type & raw_data() noexcept
Provides direct, unsafe access to the underlying data structure.
Definition: interleaved_bloom_filter.hpp:793
SEQAN3_DEPRECATED_310 friend bool operator!=(binning_bitvector const &lhs, sdsl::bit_vector const &rhs) noexcept
Test for inequality.
Definition: interleaved_bloom_filter.hpp:755
binning_bitvector & operator=(binning_bitvector &&)=default
Defaulted.
auto operator[](size_t const i) noexcept
Return the i-th element.
Definition: interleaved_bloom_filter.hpp:773
binning_bitvector(binning_bitvector const &)=default
Defaulted.
friend bool operator==(binning_bitvector const &lhs, binning_bitvector const &rhs) noexcept
Test for equality.
Definition: interleaved_bloom_filter.hpp:727
friend bool operator!=(binning_bitvector const &lhs, binning_bitvector const &rhs) noexcept
Test for inequality.
Definition: interleaved_bloom_filter.hpp:733
Manages membership queries for the seqan3::interleaved_bloom_filter.
Definition: interleaved_bloom_filter.hpp:570
membership_agent(membership_agent const &)=default
Defaulted.
membership_agent & operator=(membership_agent const &)=default
Defaulted.
binning_bitvector const & bulk_contains(size_t const value) &noexcept
Determines set membership of a given value.
Definition: interleaved_bloom_filter.hpp:623
membership_agent & operator=(membership_agent &&)=default
Defaulted.
membership_agent(membership_agent &&)=default
Defaulted.
binning_bitvector result_buffer
Stores the result of bulk_contains().
Definition: interleaved_bloom_filter.hpp:601
The IBF binning directory. A data structure that efficiently answers set-membership queries for multi...
Definition: interleaved_bloom_filter.hpp:132
interleaved_bloom_filter(seqan3::bin_count bins_, seqan3::bin_size size, seqan3::hash_function_count funs=seqan3::hash_function_count{2u})
Construct an uncompressed Interleaved Bloom Filter.
Definition: interleaved_bloom_filter.hpp:219
size_t hash_function_count() const noexcept
Returns the number of hash functions used in the Interleaved Bloom Filter.
Definition: interleaved_bloom_filter.hpp:458
constexpr data_type const & raw_data() const noexcept
Provides direct, unsafe access to the underlying data structure.
Definition: interleaved_bloom_filter.hpp:531
interleaved_bloom_filter & operator=(interleaved_bloom_filter const &)=default
Defaulted.
interleaved_bloom_filter()=default
Defaulted.
membership_agent membership_agent() const
Returns a seqan3::interleaved_bloom_filter::membership_agent to be used for lookup.
Definition: interleaved_bloom_filter.hpp:429
void emplace(size_t const value, bin_index const bin) noexcept
Inserts a value into a specific bin.
Definition: interleaved_bloom_filter.hpp:281
friend bool operator!=(interleaved_bloom_filter const &lhs, interleaved_bloom_filter const &rhs) noexcept
Test for inequality.
Definition: interleaved_bloom_filter.hpp:509
interleaved_bloom_filter(interleaved_bloom_filter &&)=default
Defaulted.
void clear(bin_index const bin) noexcept
Clears a specific bin.
Definition: interleaved_bloom_filter.hpp:307
size_t bin_count() const noexcept
Returns the number of bins that the Interleaved Bloom Filter manages.
Definition: interleaved_bloom_filter.hpp:466
size_t bin_size() const noexcept
Returns the size of a single bin that the Interleaved Bloom Filter manages.
Definition: interleaved_bloom_filter.hpp:474
size_t bit_size() const noexcept
Returns the size of the underlying bitvector.
Definition: interleaved_bloom_filter.hpp:482
interleaved_bloom_filter(interleaved_bloom_filter const &)=default
Defaulted.
~interleaved_bloom_filter()=default
Defaulted.
friend bool operator==(interleaved_bloom_filter const &lhs, interleaved_bloom_filter const &rhs) noexcept
Test for equality.
Definition: interleaved_bloom_filter.hpp:496
static constexpr data_layout data_layout_mode
Indicates whether the Interleaved Bloom Filter is compressed.
Definition: interleaved_bloom_filter.hpp:190
void increase_bin_number_to(bin_count const new_bins_)
Increases the number of bins stored in the Interleaved Bloom Filter.
Definition: interleaved_bloom_filter.hpp:372
interleaved_bloom_filter(interleaved_bloom_filter< data_layout::uncompressed > const &ibf)
Construct a compressed Interleaved Bloom Filter.
Definition: interleaved_bloom_filter.hpp:254
constexpr data_type & raw_data() noexcept
Provides direct, unsafe access to the underlying data structure.
Definition: interleaved_bloom_filter.hpp:525
counting_agent_type< value_t > counting_agent() const
Returns a seqan3::interleaved_bloom_filter::counting_agent_type to be used for counting.
Definition: interleaved_bloom_filter.hpp:446
interleaved_bloom_filter & operator=(interleaved_bloom_filter &&)=default
Defaulted.
T data(T... args)
constexpr int countl_zero(T x) noexcept
Returns the number of consecutive 0 bits in the value of x, starting from the most significant bit ("...
Definition: bit:181
constexpr int countr_zero(T x) noexcept
Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit (...
Definition: bit:199
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
data_layout
Determines if the Interleaved Bloom Filter is compressed.
Definition: interleaved_bloom_filter.hpp:31
@ uncompressed
The Interleaved Bloom Filter is uncompressed.
Definition: interleaved_bloom_filter.hpp:32
@ compressed
The Interleaved Bloom Filter is compressed.
Definition: interleaved_bloom_filter.hpp:33
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:151
T memcpy(T... args)
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:203
Provides basic data structure for strong types.
A strong type that represents the number of bins for the seqan3::interleaved_bloom_filter.
Definition: interleaved_bloom_filter.hpp:38
A strong type that represents the bin index for the seqan3::interleaved_bloom_filter.
Definition: interleaved_bloom_filter.hpp:56
A strong type that represents the number of bits for each bin in the seqan3::interleaved_bloom_filter...
Definition: interleaved_bloom_filter.hpp:44
A strong type that represents the number of hash functions for the seqan3::interleaved_bloom_filter.
Definition: interleaved_bloom_filter.hpp:50
strong_type for seed.
Definition: minimiser_hash.hpp:24
T tie(T... args)
T transform(T... args)