16#ifndef RANS_INTERNAL_CONTAINERS_RENORMEDHISTOGRAM_H_
17#define RANS_INTERNAL_CONTAINERS_RENORMEDHISTOGRAM_H_
20#include <fairlogger/Logger.h>
28template <
class container_T>
31 using base_type = container_T;
41 using pointer =
typename base_type::pointer;
49 this->mContainer = std::move(frequencies);
53 size_t nSamples = std::accumulate(this->begin(), this->
end(), 0, [](
const auto&
a,
const auto&
b) {
54 if constexpr (std::is_integral_v<std::remove_reference_t<
decltype(
b)>>) {
60 nSamples += this->mNIncompressible;
62 assert(nSamples == this->mNSamples);
78template <
typename source_T>
81template <
typename source_T>
84template <
typename source_T>
87template <
typename container_T>
90 return std::count_if(histogram.begin(), histogram.end(),
92 return v != typename RenormedHistogramConcept<container_T>::value_type{};
Abstract container class that defines and implements basic properties shared by histograms and lookup...
Non-owning, lightweight structure for histogram manipulation.
RenormedHistogramConcept(container_type frequencies, size_t renormingBits, value_type nIncompressible)
typename base_type::value_type value_type
bool isRenormedTo(size_t nBits) const noexcept
typename base_type::reference reference
typename base_type::size_type size_type
typename base_type::const_iterator const_iterator
value_type getIncompressibleSymbolFrequency() const noexcept
typename base_type::pointer pointer
size_t getRenormingBits() const noexcept
RenormedHistogramConcept()
typename base_type::container_type container_type
typename base_type::const_pointer const_pointer
typename base_type::source_type source_type
typename base_type::difference_type difference_type
bool hasIncompressibleSymbol() const noexcept
typename base_type::const_reference const_reference
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
constexpr bool isPow2(T x) noexcept
constexpr size_t pow2(size_t n) noexcept
constexpr T log2UInt(T x) noexcept
RenormedHistogramConcept< internal::SparseVectorContainer< source_T, uint32_t > > RenormedAdaptiveHistogram
RenormedHistogramConcept< internal::VectorContainer< source_T, uint32_t > > RenormedDenseHistogram
size_t countNUsedAlphabetSymbols(const AdaptiveHistogram< source_T > &histogram)
RenormedHistogramConcept< internal::SetContainer< source_T, uint32_t > > RenormedSparseHistogram