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::SelectionVector Struct Reference
Collaboration diagram for duckdb::SelectionVector:

Public Member Functions

 SelectionVector (sel_t *sel)
 
 SelectionVector (idx_t count)
 
 SelectionVector (idx_t start, idx_t count)
 
 SelectionVector (const SelectionVector &sel_vector)
 
 SelectionVector (buffer_ptr< SelectionData > data)
 
SelectionVectoroperator= (SelectionVector &&other) noexcept
 
void Initialize (sel_t *sel)
 
void Initialize (idx_t count=STANDARD_VECTOR_SIZE)
 
void Initialize (buffer_ptr< SelectionData > data)
 
void Initialize (const SelectionVector &other)
 
void set_index (idx_t idx, idx_t loc)
 
void swap (idx_t i, idx_t j)
 
idx_t get_index (idx_t idx) const
 
idx_t get_index_unsafe (idx_t idx) const
 
sel_tdata ()
 
const sel_tdata () const
 
buffer_ptr< SelectionDatasel_data ()
 
buffer_ptr< SelectionDataSlice (const SelectionVector &sel, idx_t count) const
 
idx_t SliceInPlace (const SelectionVector &sel, idx_t count)
 
string ToString (idx_t count=0) const
 
void Print (idx_t count=0) const
 
const sel_toperator[] (idx_t index) const
 
sel_toperator[] (idx_t index)
 
bool IsSet () const
 
void Verify (idx_t count, idx_t vector_size) const
 
void Sort (idx_t count)
 

Static Public Member Functions

static idx_t Inverted (const SelectionVector &src, SelectionVector &dst, idx_t source_size, idx_t count)
 

Private Attributes

sel_tsel_vector
 
buffer_ptr< SelectionDataselection_data
 

Constructor & Destructor Documentation

◆ SelectionVector() [1/6]

duckdb::SelectionVector::SelectionVector ( )
inline
8772 : sel_vector(nullptr) {
8773 }

◆ SelectionVector() [2/6]

duckdb::SelectionVector::SelectionVector ( sel_t sel)
inlineexplicit
8774 {
8775 Initialize(sel);
8776 }

◆ SelectionVector() [3/6]

duckdb::SelectionVector::SelectionVector ( idx_t  count)
inlineexplicit
8777 {
8778 Initialize(count);
8779 }

◆ SelectionVector() [4/6]

duckdb::SelectionVector::SelectionVector ( idx_t  start,
idx_t  count 
)
inline
8780 {
8781 Initialize(MaxValue<idx_t>(count, STANDARD_VECTOR_SIZE));
8782 for (idx_t i = 0; i < count; i++) {
8783 set_index(i, start + i);
8784 }
8785 }

◆ SelectionVector() [5/6]

duckdb::SelectionVector::SelectionVector ( const SelectionVector sel_vector)
inline
8786 {
8787 Initialize(sel_vector);
8788 }

◆ SelectionVector() [6/6]

duckdb::SelectionVector::SelectionVector ( buffer_ptr< SelectionData data)
inlineexplicit
8789 {
8790 Initialize(std::move(data));
8791 }

Member Function Documentation

◆ operator=()

SelectionVector & duckdb::SelectionVector::operator= ( SelectionVector &&  other)
inlinenoexcept
8792 {
8793 sel_vector = other.sel_vector;
8794 other.sel_vector = nullptr;
8795 selection_data = std::move(other.selection_data);
8796 return *this;
8797 }

◆ Inverted()

static idx_t duckdb::SelectionVector::Inverted ( const SelectionVector src,
SelectionVector dst,
idx_t  source_size,
idx_t  count 
)
inlinestatic
8800 {
8801 idx_t src_idx = 0;
8802 idx_t dst_idx = 0;
8803 for (idx_t i = 0; i < count; i++) {
8804 if (src_idx < source_size && src.get_index(src_idx) == i) {
8805 src_idx++;
8806 // This index is selected by 'src', skip it in 'dst'
8807 continue;
8808 }
8809 // This index does not exist in 'src', add it to the selection of 'dst'
8810 dst.set_index(dst_idx++, i);
8811 }
8812 return dst_idx;
8813 }

◆ Initialize() [1/4]

void duckdb::SelectionVector::Initialize ( sel_t sel)
inline
8815 {
8816 selection_data.reset();
8817 sel_vector = sel;
8818 }

◆ Initialize() [2/4]

void duckdb::SelectionVector::Initialize ( idx_t  count = STANDARD_VECTOR_SIZE)
inline
8819 {
8820 selection_data = make_shared_ptr<SelectionData>(count);
8821 sel_vector = reinterpret_cast<sel_t *>(selection_data->owned_data.get());
8822 }

◆ Initialize() [3/4]

void duckdb::SelectionVector::Initialize ( buffer_ptr< SelectionData data)
inline
8823 {
8824 selection_data = std::move(data);
8825 sel_vector = reinterpret_cast<sel_t *>(selection_data->owned_data.get());
8826 }

◆ Initialize() [4/4]

void duckdb::SelectionVector::Initialize ( const SelectionVector other)
inline
8827 {
8828 selection_data = other.selection_data;
8829 sel_vector = other.sel_vector;
8830 }

◆ set_index()

void duckdb::SelectionVector::set_index ( idx_t  idx,
idx_t  loc 
)
inline
8832 { // NOLINT: allow casing for legacy reasons
8833 sel_vector[idx] = UnsafeNumericCast<sel_t>(loc);
8834 }

◆ swap()

void duckdb::SelectionVector::swap ( idx_t  i,
idx_t  j 
)
inline
8835 { // NOLINT: allow casing for legacy reasons
8836 sel_t tmp = sel_vector[i];
8837 sel_vector[i] = sel_vector[j];
8838 sel_vector[j] = tmp;
8839 }

◆ get_index()

idx_t duckdb::SelectionVector::get_index ( idx_t  idx) const
inline
8840 { // NOLINT: allow casing for legacy reasons
8841 return sel_vector ? get_index_unsafe(idx) : idx;
8842 }

◆ get_index_unsafe()

idx_t duckdb::SelectionVector::get_index_unsafe ( idx_t  idx) const
inline
8843 { // NOLINT: allow casing for legacy reasons
8844 return sel_vector[idx];
8845 }

◆ data() [1/2]

sel_t * duckdb::SelectionVector::data ( )
inline
8846 { // NOLINT: allow casing for legacy reasons
8847 return sel_vector;
8848 }

◆ data() [2/2]

const sel_t * duckdb::SelectionVector::data ( ) const
inline
8849 { // NOLINT: allow casing for legacy reasons
8850 return sel_vector;
8851 }

◆ sel_data()

buffer_ptr< SelectionData > duckdb::SelectionVector::sel_data ( )
inline
8852 { // NOLINT: allow casing for legacy reasons
8853 return selection_data;
8854 }

◆ operator[]() [1/2]

const sel_t & duckdb::SelectionVector::operator[] ( idx_t  index) const
inline
8861 {
8862 return sel_vector[index];
8863 }
index

◆ operator[]() [2/2]

sel_t & duckdb::SelectionVector::operator[] ( idx_t  index)
inline
8864 {
8865 return sel_vector[index];
8866 }

◆ IsSet()

bool duckdb::SelectionVector::IsSet ( ) const
inline
8867 {
8868 return sel_vector;
8869 }

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