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::roaring::RunContainerScanState Struct Reference

RUN Container. More...

Inheritance diagram for duckdb::roaring::RunContainerScanState:
Collaboration diagram for duckdb::roaring::RunContainerScanState:

Public Member Functions

 RunContainerScanState (idx_t container_index, idx_t container_size, idx_t count, data_ptr_t data_p)
 RunContainer.
void ScanPartial (Vector &result, idx_t result_offset, idx_t to_scan) override
void Skip (idx_t to_skip) override
void Verify () const override
Public Member Functions inherited from duckdb::roaring::ContainerScanState
 ContainerScanState (idx_t container_index_p, idx_t container_size)

Protected Member Functions

virtual void LoadNextRun ()

Protected Attributes

RunContainerRLEPair run
bool finished = false
idx_t run_index = 0
idx_t count
data_ptr_t data

Additional Inherited Members

Public Attributes inherited from duckdb::roaring::ContainerScanState
idx_t container_index
 The index of the container.
idx_t container_size
 The size of the container (how many values does it hold).
idx_t scanned_count = 0
 How much of the container is already consumed.

Detailed Description

RUN Container.

Constructor & Destructor Documentation

◆ RunContainerScanState()

duckdb::roaring::RunContainerScanState::RunContainerScanState ( idx_t container_index,
idx_t container_size,
idx_t count,
data_ptr_t data_p )

RunContainer.

405304 : ContainerScanState(container_index, container_size), count(count), data(data_p) {
405305}
idx_t container_index
The index of the container.
Definition duckdb.cpp:403494
idx_t container_size
The size of the container (how many values does it hold).
Definition duckdb.cpp:403496
Here is the caller graph for this function:

Member Function Documentation

◆ ScanPartial()

void duckdb::roaring::RunContainerScanState::ScanPartial ( Vector & result,
idx_t result_offset,
idx_t to_scan )
overridevirtual

Implements duckdb::roaring::ContainerScanState.

405307 {
405308 auto &result_mask = FlatVector::Validity(result);
405309
405310 // This method assumes that the validity mask starts off as having all bits set for the entries that are being
405311 // scanned.
405312
405313 idx_t result_idx = 0;
405314 if (!run_index) {
405315 LoadNextRun();
405316 }
405317 while (!finished && result_idx < to_scan) {
405318 // Either we are already inside a run, then 'start_of_run' will be scanned_count
405319 // or we're skipping values until the run begins
405320 auto start_of_run =
405321 MaxValue<idx_t>(MinValue<idx_t>(run.start, scanned_count + to_scan), scanned_count + result_idx);
405322 result_idx = start_of_run - scanned_count;
405323
405324 // How much of the run are we covering?
405325 idx_t run_end = run.start + 1 + run.length;
405326 auto run_or_scan_end = MinValue<idx_t>(run_end, scanned_count + to_scan);
405327
405328 // Process the run
405329 D_ASSERT(run_or_scan_end >= start_of_run);
405330 if (run_or_scan_end > start_of_run) {
405331 idx_t amount = run_or_scan_end - start_of_run;
405332 idx_t start = result_offset + result_idx;
405333 idx_t end = start + amount;
405334 SetInvalidRange(result_mask, start, end);
405335 }
405336
405337 result_idx += run_or_scan_end - start_of_run;
405338 if (scanned_count + result_idx == run_end) {
405339 // Fully processed the current run
405340 LoadNextRun();
405341 }
405342 }
405343 scanned_count += to_scan;
405344}
void SetInvalidRange(ValidityMask &result, idx_t start, idx_t end)
This can be increased, but requires additional changes beyond just changing the constant.
Definition duckdb.cpp:404211
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
idx_t scanned_count
How much of the container is already consumed.
Definition duckdb.cpp:403498

◆ Skip()

void duckdb::roaring::RunContainerScanState::Skip ( idx_t to_skip)
overridevirtual

Implements duckdb::roaring::ContainerScanState.

405346 {
405347 idx_t end = scanned_count + to_skip;
405348 if (!run_index) {
405349 LoadNextRun();
405350 }
405351 while (scanned_count < end && !finished) {
405352 idx_t run_end = run.start + 1 + run.length;
405353 scanned_count = MinValue<idx_t>(run_end, end);
405354 if (scanned_count == run_end) {
405355 LoadNextRun();
405356 }
405357 }
405358 // In case run_index has already reached count
405359 scanned_count = end;
405360}

◆ Verify()

void duckdb::roaring::RunContainerScanState::Verify ( ) const
overridevirtual

Implements duckdb::roaring::ContainerScanState.

405362 {
405363#ifdef DEBUG
405364 uint16_t index = 0;
405365 for (idx_t i = 0; i < count; i++) {
405366 auto run = reinterpret_cast<RunContainerRLEPair *>(data)[i];
405367 D_ASSERT(run.start >= index);
405368 index = run.start + 1 + run.length;
405369 }
405370#endif
405371}
index
::uint16_t uint16_t

◆ LoadNextRun()

void duckdb::roaring::RunContainerScanState::LoadNextRun ( )
protectedvirtual
405373 {
405374 if (run_index >= count) {
405375 finished = true;
405376 return;
405377 }
405378 run = reinterpret_cast<RunContainerRLEPair *>(data)[run_index];
405379 run_index++;
405380}

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