Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::patas::PatasCompression< EXACT_TYPE, EMPTY > Struct Template Reference

Public Types

using State = PatasCompressionState<EXACT_TYPE, EMPTY>

Static Public Member Functions

static void Store (EXACT_TYPE value, State &state)
static void StoreFirst (EXACT_TYPE value, State &state)
static void StoreCompressed (EXACT_TYPE value, State &state)

Static Public Attributes

static constexpr uint8_t EXACT_TYPE_BITSIZE = sizeof(EXACT_TYPE) * 8

Member Function Documentation

◆ Store()

template<class EXACT_TYPE, bool EMPTY>
void duckdb::patas::PatasCompression< EXACT_TYPE, EMPTY >::Store ( EXACT_TYPE value,
State & state )
inlinestatic
392430 {
392431 if (state.first) {
392432 StoreFirst(value, state);
392433 } else {
392434 StoreCompressed(value, state);
392435 }
392436 }
Definition duckdb.cpp:392426

◆ StoreFirst()

template<class EXACT_TYPE, bool EMPTY>
void duckdb::patas::PatasCompression< EXACT_TYPE, EMPTY >::StoreFirst ( EXACT_TYPE value,
State & state )
inlinestatic
392438 {
392439 // write first value, uncompressed
392440 state.ring_buffer.template Insert<true>(value);
392442 state.first = false;
392443 state.UpdateMetadata(0, sizeof(EXACT_TYPE), 0);
392444 }

◆ StoreCompressed()

template<class EXACT_TYPE, bool EMPTY>
void duckdb::patas::PatasCompression< EXACT_TYPE, EMPTY >::StoreCompressed ( EXACT_TYPE value,
State & state )
inlinestatic
392446 {
392447 auto key = state.ring_buffer.Key(value);
392448 uint64_t reference_index = state.ring_buffer.IndexOf(key);
392449
392450 // Find the reference value to use when compressing the current value
392451 const bool exceeds_highest_index = reference_index > state.ring_buffer.Size();
392452 const bool difference_too_big =
392453 ((state.ring_buffer.Size() + 1) - reference_index) >= ChimpConstants::BUFFER_SIZE;
392455 // Reference index is not in range, use the directly previous value
392456 reference_index = state.ring_buffer.Size();
392457 }
392458 const auto reference_value = state.ring_buffer.Value(reference_index % ChimpConstants::BUFFER_SIZE);
392459
392460 // XOR with previous value
392462
392463 // Figure out the trailing zeros (max 6 bits)
392466
392467 const bool is_equal = xor_result == 0;
392468
392469 // Figure out the significant bytes (max 3 bits)
392470 const uint8_t significant_bits = !is_equal * (EXACT_TYPE_BITSIZE - trailing_zero - leading_zero);
392471 const uint8_t significant_bytes = (significant_bits >> 3) + ((significant_bits & 7) != 0);
392472
392473 // Avoid an invalid shift error when xor_result is 0
392475
392476 state.ring_buffer.Insert(value);
392477 const uint8_t index_difference = state.ring_buffer.Size() - reference_index;
392479 }

The documentation for this struct was generated from the following file: