20#include <cereal/access.hpp>
21#include <cereal/cereal.hpp>
23#include <hibf/contrib/aligned_allocator.hpp>
26namespace seqan::hibf::sketch
60 void add(uint64_t
const value);
116 for (
size_t i = 0; i < 61; ++i)
117 result[i] = 1.0f / (1ULL << i);
126 uint64_t rank_mask{};
128 double normalization_factor{};
132 friend class cereal::access;
134 template <
typename archive_t>
135 void serialize(archive_t & archive)
138 archive(CEREAL_NVP(version));
140 archive(CEREAL_NVP(bits));
141 archive(CEREAL_NVP(size));
142 archive(CEREAL_NVP(rank_mask));
143 archive(CEREAL_NVP(normalization_factor));
144 archive(CEREAL_NVP(data));
HyperLogLog estimates.
Definition hyperloglog.hpp:36
double merge_and_estimate(hyperloglog const &other)
Merges another hyperloglog and returns the new estimate.
hyperloglog & operator=(hyperloglog const &)=default
Defaulted.
uint64_t data_size() const
Returns size of the internal data.
Definition hyperloglog.hpp:94
hyperloglog(hyperloglog &&)=default
Defaulted.
double estimate() const
Estimates cardinality value.
hyperloglog(hyperloglog const &)=default
Defaulted.
hyperloglog(uint8_t const num_bits=5u)
Default constructor.
~hyperloglog()=default
Defaulted.
void add(uint64_t const value)
Adds a value.
void reset()
Clears added values. The size is unaffected.
void load(std::istream &is)
Loads the hyperloglog from a stream.
hyperloglog & operator=(hyperloglog &&)=default
Defaulted.
void store(std::ostream &os) const
Write the hyperloglog to a stream.
void merge(hyperloglog const &other)
Merges another hyperloglog into this object.