![]() |
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.
|
The Bignum class is a static class that holds helper functions for the Bignum type. More...
Static Public Member Functions | |
| static DUCKDB_API void | Verify (const bignum_t &input) |
| static DUCKDB_API void | SetHeader (char *blob, uint64_t number_of_bytes, bool is_negative) |
| static DUCKDB_API bignum_t | InitializeBignumZero (Vector &result) |
| Initializes and returns a blob with value 0, allocated in Vector& result. | |
| static DUCKDB_API string | InitializeBignumZero () |
| static DUCKDB_API BoundCastInfo | NumericToBignumCastSwitch (const LogicalType &source) |
| Switch Case of To Bignum Convertion. | |
| static DUCKDB_API bool | VarcharFormatting (const string_t &value, idx_t &start_pos, idx_t &end_pos, bool &is_negative, bool &is_zero) |
| static DUCKDB_API int | CharToDigit (char c) |
| Converts a char to a Digit. | |
| static DUCKDB_API char | DigitToChar (int digit) |
| Converts a Digit to a char. | |
| static DUCKDB_API void | GetByteArray (vector< uint8_t > &byte_array, bool &is_negative, const string_t &blob) |
| Function to convert a string_t into a vector of bytes. | |
| static DUCKDB_API string | FromByteArray (uint8_t *data, idx_t size, bool is_negative) |
| Function to create a BIGNUM blob from a byte array containing the absolute value, plus an is_negative bool. | |
| static DUCKDB_API string | BignumToVarchar (const bignum_t &blob) |
| Function to convert BIGNUM blob to a VARCHAR. | |
| static DUCKDB_API string | VarcharToBignum (const string_t &value) |
| Function to convert Varchar to BIGNUM blob. | |
| static DUCKDB_API bool | BignumToDouble (const bignum_t &blob, double &result, bool &strict) |
| --------------------------------— Double Cast --------------------------------— // | |
| template<class T > | |
| static bool | BignumToInt (const bignum_t &blob, T &result, bool &strict) |
Static Public Attributes | |
| static DUCKDB_API constexpr uint32_t | MAX_DATA_SIZE = 8388607 |
| static DUCKDB_API constexpr uint8_t | BIGNUM_HEADER_SIZE = 3 |
| Header size of a Bignum is always 3 bytes. | |
| static DUCKDB_API constexpr uint8_t | DECIMAL_SHIFT = 9 |
| Max(e such that 10**e fits in a digit_t) | |
| static DUCKDB_API constexpr digit_t | DECIMAL_BASE = 1000000000 |
| 10 ** DECIMAL_SHIFT | |
| static DUCKDB_API constexpr uint8_t | DIGIT_BYTES = sizeof(digit_t) |
| Bytes of a digit_t. | |
| static DUCKDB_API constexpr uint8_t | DIGIT_BITS = DIGIT_BYTES * 8 |
| Bits of a digit_t. | |
Verifies if a Bignum is valid. i.e., if it has 3 header bytes. The header correctly represents the number of data bytes, and the data bytes has no leading zero bytes.
|
static |
Sets the header of a bignum (i.e., char* blob), depending on the number of bytes that bignum needs and if it's a negative number

|
inlinestatic |
This is the maximum number of bytes a BIGNUM can have on it's data size i.e., 2^(8*3-1) - 1.