16#ifndef RANS_INTERNAL_PACK_DICTCOMPRESSION_H_
17#define RANS_INTERNAL_PACK_DICTCOMPRESSION_H_
30template <
typename buffer_IT>
36 for (buffer_IT iter =
end; iter-- != begin;) {
37 auto value =
static_cast<value_type
>(*iter);
49 assert(iter >= begin);
55template <
typename source_T>
65 template <
typename buffer_IT>
69 [[nodiscard]]
bool hasNext()
const;
74 template <
typename buffer_IT>
75 [[nodiscard]]
BitPtr seekStreamEnd(buffer_IT begin, buffer_IT
end)
const;
85template <
typename source_T>
86template <
typename buffer_IT>
89 static_assert(std::is_pointer_v<buffer_IT>,
"can only deserialize from raw pointers");
93 throw ParsingError{
"failed to read renormed dictionary: could not find end of data stream"};
95 if (decodeNext() != 1) {
96 throw ParsingError{
"failed to read renormed dictionary: could not find end of stream delimiter"};
98 mIncompressibleSymbolFrequency = decodeNext() - 1;
101template <
typename source_T>
102template <
typename buffer_IT>
106 assert(
end >= begin);
108 for (buffer_IT iter =
end; iter-- != begin;) {
109 auto value =
static_cast<value_type
>(*iter);
119template <
typename source_T>
120[[nodiscard]]
inline auto DictionaryStreamParser<source_T>::decodeNext() -> count_type
122 assert(mPos >= mEnd);
124 return eliasDeltaDecode<count_type>(mPos, delta);
127template <
typename source_T>
130 return mIncompressibleSymbolFrequency;
133template <
typename source_T>
136 assert(mPos >= mEnd);
140template <
typename source_T>
147 frequency = decodeNext();
150 const auto offset = decodeNext();
151 frequency = decodeNext();
154 return {mIndex, frequency};
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
common helper classes and functions
DictionaryStreamParser(buffer_IT begin, buffer_IT end, source_type max)
source_type getIndex() const noexcept
std::ptrdiff_t difference_type
count_type getIncompressibleSymbolFrequency() const
std::pair< source_type, count_type > value_type
compress data stream using Elias-Delta coding.
GLsizei const GLfloat * value
constexpr intptr_t getEliasDeltaOffset(BitPtr begin, BitPtr iter)
constexpr BitPtr seekEliasDeltaEnd(buffer_IT begin, buffer_IT end)
constexpr size_t EliasDeltaDecodeMaxBits