@@ -183,7 +183,7 @@ void cpc_compressor<A>::uncompress(const compressed_state<A>& source, uncompress
183183template <typename A>
184184void cpc_compressor<A>::compress_sparse_flavor(const cpc_sketch_alloc<A>& source, compressed_state<A>& result) const {
185185 if (source.sliding_window .size () > 0 ) throw std::logic_error (" unexpected sliding window" );
186- vector_u32<A> pairs = source.surprising_value_table .unwrapping_get_items ();
186+ vector_u32 pairs = source.surprising_value_table .unwrapping_get_items ();
187187 u32_table<A>::introspective_insertion_sort (pairs.data (), 0 , pairs.size ());
188188 compress_surprising_values (pairs, source.get_lg_k (), result);
189189}
@@ -192,7 +192,7 @@ template<typename A>
192192void cpc_compressor<A>::uncompress_sparse_flavor(const compressed_state<A>& source, uncompressed_state<A>& target, uint8_t lg_k) const {
193193 if (source.window_data .size () > 0 ) throw std::logic_error (" unexpected sliding window" );
194194 if (source.table_data .size () == 0 ) throw std::logic_error (" table is expected" );
195- vector_u32<A> pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , source.table_num_entries ,
195+ vector_u32 pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , source.table_num_entries ,
196196 lg_k, source.table_data .get_allocator ());
197197 target.table = u32_table<A>::make_from_pairs (pairs.data (), source.table_num_entries , lg_k, pairs.get_allocator ());
198198}
@@ -204,12 +204,12 @@ void cpc_compressor<A>::compress_hybrid_flavor(const cpc_sketch_alloc<A>& source
204204 if (source.sliding_window .size () == 0 ) throw std::logic_error (" no sliding window" );
205205 if (source.window_offset != 0 ) throw std::logic_error (" window_offset != 0" );
206206 const uint32_t k = 1 << source.get_lg_k ();
207- vector_u32<A> pairs_from_table = source.surprising_value_table .unwrapping_get_items ();
207+ vector_u32 pairs_from_table = source.surprising_value_table .unwrapping_get_items ();
208208 const uint32_t num_pairs_from_table = static_cast <uint32_t >(pairs_from_table.size ());
209209 if (num_pairs_from_table > 0 ) u32_table<A>::introspective_insertion_sort (pairs_from_table.data (), 0 , num_pairs_from_table);
210210 const uint32_t num_pairs_from_window = source.get_num_coupons () - num_pairs_from_table; // because the window offset is zero
211211
212- vector_u32<A> all_pairs = tricky_get_pairs_from_window (source.sliding_window .data (), k, num_pairs_from_window, num_pairs_from_table, source.get_allocator ());
212+ vector_u32 all_pairs = tricky_get_pairs_from_window (source.sliding_window .data (), k, num_pairs_from_window, num_pairs_from_table, source.get_allocator ());
213213
214214 u32_table<A>::merge (
215215 pairs_from_table.data (), 0 , pairs_from_table.size (),
@@ -224,7 +224,7 @@ template<typename A>
224224void cpc_compressor<A>::uncompress_hybrid_flavor(const compressed_state<A>& source, uncompressed_state<A>& target, uint8_t lg_k) const {
225225 if (source.window_data .size () > 0 ) throw std::logic_error (" window is not expected" );
226226 if (source.table_data .size () == 0 ) throw std::logic_error (" table is expected" );
227- vector_u32<A> pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , source.table_num_entries ,
227+ vector_u32 pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , source.table_num_entries ,
228228 lg_k, source.table_data .get_allocator ());
229229
230230 // In the hybrid flavor, some of these pairs actually
@@ -250,7 +250,7 @@ void cpc_compressor<A>::uncompress_hybrid_flavor(const compressed_state<A>& sour
250250template <typename A>
251251void cpc_compressor<A>::compress_pinned_flavor(const cpc_sketch_alloc<A>& source, compressed_state<A>& result) const {
252252 compress_sliding_window (source.sliding_window .data (), source.get_lg_k (), source.get_num_coupons (), result);
253- vector_u32<A> pairs = source.surprising_value_table .unwrapping_get_items ();
253+ vector_u32 pairs = source.surprising_value_table .unwrapping_get_items ();
254254 if (pairs.size () > 0 ) {
255255 // Here we subtract 8 from the column indices. Because they are stored in the low 6 bits
256256 // of each row_col pair, and because no column index is less than 8 for a "Pinned" sketch,
@@ -277,7 +277,7 @@ void cpc_compressor<A>::uncompress_pinned_flavor(const compressed_state<A>& sour
277277 target.table = u32_table<A>(2 , 6 + lg_k, source.table_data .get_allocator ());
278278 } else {
279279 if (source.table_data .size () == 0 ) throw std::logic_error (" table is expected" );
280- vector_u32<A> pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , num_pairs,
280+ vector_u32 pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , num_pairs,
281281 lg_k, source.table_data .get_allocator ());
282282 // undo the compressor's 8-column shift
283283 for (uint32_t i = 0 ; i < num_pairs; i++) {
@@ -291,7 +291,7 @@ void cpc_compressor<A>::uncompress_pinned_flavor(const compressed_state<A>& sour
291291template <typename A>
292292void cpc_compressor<A>::compress_sliding_flavor(const cpc_sketch_alloc<A>& source, compressed_state<A>& result) const {
293293 compress_sliding_window (source.sliding_window .data (), source.get_lg_k (), source.get_num_coupons (), result);
294- vector_u32<A> pairs = source.surprising_value_table .unwrapping_get_items ();
294+ vector_u32 pairs = source.surprising_value_table .unwrapping_get_items ();
295295 if (pairs.size () > 0 ) {
296296 // Here we apply a complicated transformation to the column indices, which
297297 // changes the implied ordering of the pairs, so we must do it before sorting.
@@ -330,7 +330,7 @@ void cpc_compressor<A>::uncompress_sliding_flavor(const compressed_state<A>& sou
330330 target.table = u32_table<A>(2 , 6 + lg_k, source.table_data .get_allocator ());
331331 } else {
332332 if (source.table_data .size () == 0 ) throw std::logic_error (" table is expected" );
333- vector_u32<A> pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , num_pairs,
333+ vector_u32 pairs = uncompress_surprising_values (source.table_data .data (), source.table_data_words , num_pairs,
334334 lg_k, source.table_data .get_allocator ());
335335
336336 const uint8_t pseudo_phase = determine_pseudo_phase (lg_k, num_coupons);
@@ -356,7 +356,7 @@ void cpc_compressor<A>::uncompress_sliding_flavor(const compressed_state<A>& sou
356356}
357357
358358template <typename A>
359- void cpc_compressor<A>::compress_surprising_values(const vector_u32<A> & pairs, uint8_t lg_k, compressed_state<A>& result) const {
359+ void cpc_compressor<A>::compress_surprising_values(const vector_u32& pairs, uint8_t lg_k, compressed_state<A>& result) const {
360360 const uint32_t k = 1 << lg_k;
361361 const uint32_t num_pairs = static_cast <uint32_t >(pairs.size ());
362362 const uint8_t num_base_bits = golomb_choose_number_of_base_bits (k + num_pairs, num_pairs);
@@ -374,10 +374,10 @@ void cpc_compressor<A>::compress_surprising_values(const vector_u32<A>& pairs, u
374374}
375375
376376template <typename A>
377- vector_u32<A> cpc_compressor<A>::uncompress_surprising_values(const uint32_t * data, uint32_t data_words, uint32_t num_pairs,
378- uint8_t lg_k, const A& allocator) const {
377+ auto cpc_compressor<A>::uncompress_surprising_values(const uint32_t * data, uint32_t data_words, uint32_t num_pairs,
378+ uint8_t lg_k, const A& allocator) const -> vector_u32 {
379379 const uint32_t k = 1 << lg_k;
380- vector_u32<A> pairs (num_pairs, 0 , allocator);
380+ vector_u32 pairs (num_pairs, 0 , allocator);
381381 const uint8_t num_base_bits = golomb_choose_number_of_base_bits (k + num_pairs, num_pairs);
382382 low_level_uncompress_pairs (pairs.data (), num_pairs, num_base_bits, data, data_words);
383383 return pairs;
@@ -399,7 +399,7 @@ void cpc_compressor<A>::compress_sliding_window(const uint8_t* window, uint8_t l
399399}
400400
401401template <typename A>
402- void cpc_compressor<A>::uncompress_sliding_window(const uint32_t * data, uint32_t data_words, vector_u8<A> & window,
402+ void cpc_compressor<A>::uncompress_sliding_window(const uint32_t * data, uint32_t data_words, vector_bytes & window,
403403 uint8_t lg_k, uint32_t num_coupons) const {
404404 const uint32_t k = 1 << lg_k;
405405 window.resize (k); // zeroing not needed here (unlike the Hybrid Flavor)
@@ -722,10 +722,10 @@ void write_unary(
722722// The empty space that this leaves at the beginning of the output array
723723// will be filled in later by the caller.
724724template <typename A>
725- vector_u32<A> cpc_compressor<A>::tricky_get_pairs_from_window(const uint8_t * window, uint32_t k, uint32_t num_pairs_to_get,
726- uint32_t empty_space, const A& allocator) {
725+ auto cpc_compressor<A>::tricky_get_pairs_from_window(const uint8_t * window, uint32_t k, uint32_t num_pairs_to_get,
726+ uint32_t empty_space, const A& allocator) -> vector_u32 {
727727 const size_t output_length = empty_space + num_pairs_to_get;
728- vector_u32<A> pairs (output_length, 0 , allocator);
728+ vector_u32 pairs (output_length, 0 , allocator);
729729 size_t pair_index = empty_space;
730730 for (unsigned row_index = 0 ; row_index < k; row_index++) {
731731 uint8_t byte = window[row_index];
0 commit comments