![]() |
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.
|
A HeadNode is a skip list. This is the single node leading to all other content Nodes. More...

Public Member Functions | |
| HeadNode (_Compare cmp=_Compare()) | |
| bool | has (const T &value) const |
| const T & | at (size_t index) const |
| void | at (size_t index, size_t count, std::vector< T > &dest) const |
| size_t | index (const T &value) const |
| size_t | size () const |
| void | insert (const T &value) |
| T | remove (const T &value) |
| size_t | height () const |
| size_t | height (size_t idx) const |
| size_t | width (size_t idx, size_t level) const |
| IntegrityCheck | lacksIntegrity () const |
| size_t | size_of () const |
| virtual | ~HeadNode () |
Protected Member Functions | |
| void | _adjRemoveRefs (size_t level, Node< T, _Compare > *pNode) |
| const Node< T, _Compare > * | _nodeAt (size_t idx) const |
| void | _throwValueErrorNotFound (const T &value) const |
| void | _throwIfValueDoesNotCompare (const T &value) const |
| IntegrityCheck | _lacksIntegrityCyclicReferences () const |
| IntegrityCheck | _lacksIntegrityWidthAccumulation () const |
| IntegrityCheck | _lacksIntegrityNodeReferencesNotInList () const |
| IntegrityCheck | _lacksIntegrityOrder () const |
Protected Attributes | |
| size_t | _count |
| Number of nodes in the list. | |
| SwappableNodeRefStack< T, _Compare > | _nodeRefs |
| My node references, the size of this is the largest height in the list. | |
| _Compare | _compare |
| Comparison function. | |
| Node< T, _Compare >::_Pool | _pool |
Private Member Functions | |
| HeadNode (const HeadNode &that) | |
| Prevent cctor and operator=. | |
| HeadNode & | operator= (const HeadNode &that) const |
A HeadNode is a skip list. This is the single node leading to all other content Nodes.
Example:
Created by Paul Ross on 03/12/2015.
Copyright (c) 2015-2023 Paul Ross. All rights reserved.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
|
inline |
Constructor for and Empty Skip List.
| cmp | The comparison function for comparing Node values. |

|
virtual |
Destructor. This deletes all Nodes.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |

| bool duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::has | ( | const T & | value | ) | const |
Returns true if the value is present in the skip list.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value | Value to check if it is in the Skip List. |

| const T & duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::at | ( | size_t | index | ) | const |
Returns the value at a particular index. Will throw an OrderedStructs::SkipList::IndexError if index out of range.
If SKIPLIST_THREAD_SUPPORT is defined this will block.
See _throw_exceeds_size() that does the throw.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| index | The index. |

| void duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::at | ( | size_t | index, |
| size_t | count, | ||
| std::vector< T > & | dest ) const |
Find the count number of value starting at index and write them to dest.
Will throw a OrderedStructs::SkipList::IndexError if any index out of range.
This is useful for rolling median on even length lists where the caller might want to implement the mean of two values.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| index | The index. |
| count | The number of values to retrieve. |
| dest | The vector of values |

| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::index | ( | const T & | value | ) | const |
Computes index of the first occurrence of a value Will throw a OrderedStructs::SkipList::ValueError if the value does not exist in the skip list Will throw a OrderedStructs::SkipList::FailedComparison if the value is not comparable.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value | The value to search for. |


| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::size | ( | ) | const |
Return the number of values in the Skip List.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| void duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::insert | ( | const T & | value | ) |
Insert a value.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value |

| T duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::remove | ( | const T & | value | ) |
Remove a Node with a value. May throw a ValueError if the value is not found.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value | The value in the Node to remove. |

| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::height | ( | ) | const |
| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::height | ( | size_t | idx | ) | const |
Return the number of linked lists that the node at index has.
Will throw a OrderedStructs::SkipList::IndexError if the index out of range.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| idx | The index of the Skip List node. |

| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::width | ( | size_t | idx, |
| size_t | level ) const |
The skip width of the Node at index has at the given level. Will throw an IndexError if the index is out of range.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| idx | The index. |
| level | The level. |


| IntegrityCheck duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::lacksIntegrity | ( | ) | const |
Full integrity check. This calls the other integrity check functions.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |

| size_t duckdb_skiplistlib::skip_list::HeadNode< T, _Compare >::size_of | ( | ) | const |
Returns an estimate of the memory usage of an instance.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |

|
protected |
Adjust references >= level for removal of the node pNode.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| level | Current level. |
| pNode | Node to swap references with. |


|
protected |
Find the Node at the given index. Will throw an IndexError if the index is out of range.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| idx | The index. |


|
protected |
Throw a ValueError in a consistent fashion.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value | The value to put into the ValueError. |

|
protected |
Checks that the value == value. This will throw a FailedComparison if that is not the case, for example NaN.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |
| value |

|
protected |
This tests that at every level >= 0 the sequence of node pointers at that level does not contain a cyclic reference.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |


|
protected |
This tests that at every level > 0 the node to node width is the same as the accumulated node to node widths at level - 1.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |


|
protected |
This tests the integrity of each Node.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |


|
protected |
Integrity check. Traverse the lowest level and check that the ordering is correct according to the compare function. The HeadNode checks that the Node(s) have correctly applied the compare function.
| T | Type of the values in the Skip List. |
| _Compare | Compare function. |

