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
hugeint_t Struct Reference

Public Member Functions

DUCKDB_API hugeint_t (int64_t value)
constexpr hugeint_t (int64_t upper, uint64_t lower)
constexpr hugeint_t (const hugeint_t &rhs)=default
constexpr hugeint_t (hugeint_t &&rhs)=default
hugeint_t & operator= (const hugeint_t &rhs)=default
hugeint_t & operator= (hugeint_t &&rhs)=default
DUCKDB_API string ToString () const
DUCKDB_API bool operator== (const hugeint_t &rhs) const
DUCKDB_API bool operator!= (const hugeint_t &rhs) const
DUCKDB_API bool operator<= (const hugeint_t &rhs) const
DUCKDB_API bool operator< (const hugeint_t &rhs) const
DUCKDB_API bool operator> (const hugeint_t &rhs) const
DUCKDB_API bool operator>= (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator+ (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator- (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator- () const
DUCKDB_API hugeint_t operator* (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator/ (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator% (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator>> (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator<< (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator& (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator| (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator^ (const hugeint_t &rhs) const
DUCKDB_API hugeint_t operator~ () const
DUCKDB_API hugeint_t & operator+= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator-= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator*= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator/= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator%= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator>>= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator<<= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator&= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator|= (const hugeint_t &rhs)
DUCKDB_API hugeint_t & operator^= (const hugeint_t &rhs)
DUCKDB_API operator bool () const
DUCKDB_API bool operator! () const
DUCKDB_API operator uint8_t () const
DUCKDB_API operator uint16_t () const
DUCKDB_API operator uint32_t () const
DUCKDB_API operator uint64_t () const
DUCKDB_API operator int8_t () const
DUCKDB_API operator int16_t () const
DUCKDB_API operator int32_t () const
DUCKDB_API operator int64_t () const
DUCKDB_API operator uhugeint_t () const

Public Attributes

uint64_t lower
int64_t upper

Constructor & Destructor Documentation

◆ hugeint_t() [1/2]

duckdb::hugeint_t::hugeint_t ( int64_t value)
122533 {
122534 auto result = Hugeint::Convert(value);
122535 this->lower = result.lower;
122536 this->upper = result.upper;
122537}

◆ hugeint_t() [2/2]

duckdb::hugeint_t::hugeint_t ( int64_t upper,
uint64_t lower )
inlineconstexpr
319 : lower(lower), upper(upper) {
320 }

Member Function Documentation

◆ ToString()

string duckdb::hugeint_t::ToString ( ) const
122751 {
122752 return Hugeint::ToString(*this);
122753}
static string ToString(hugeint_t input)
Convert a hugeint object to a string.
Definition duckdb.cpp:121920

◆ operator==()

bool duckdb::hugeint_t::operator== ( const hugeint_t & rhs) const
122539 {
122540 return Hugeint::Equals(*this, rhs);
122541}

◆ operator!=()

bool duckdb::hugeint_t::operator!= ( const hugeint_t & rhs) const
122543 {
122544 return Hugeint::NotEquals(*this, rhs);
122545}

◆ operator<=()

bool duckdb::hugeint_t::operator<= ( const hugeint_t & rhs) const
122551 {
122552 return Hugeint::LessThanEquals(*this, rhs);
122553}

◆ operator<()

bool duckdb::hugeint_t::operator< ( const hugeint_t & rhs) const
122547 {
122548 return Hugeint::LessThan(*this, rhs);
122549}

◆ operator>()

bool duckdb::hugeint_t::operator> ( const hugeint_t & rhs) const
122555 {
122556 return Hugeint::GreaterThan(*this, rhs);
122557}

◆ operator>=()

bool duckdb::hugeint_t::operator>= ( const hugeint_t & rhs) const
122559 {
122560 return Hugeint::GreaterThanEquals(*this, rhs);
122561}

◆ operator+()

hugeint_t duckdb::hugeint_t::operator+ ( const hugeint_t & rhs) const
122563 {
122564 return hugeint_t(upper + rhs.upper + ((lower + rhs.lower) < lower), lower + rhs.lower);
122565}

◆ operator-() [1/2]

hugeint_t duckdb::hugeint_t::operator- ( const hugeint_t & rhs) const
122567 {
122568 return hugeint_t(upper - rhs.upper - ((lower - rhs.lower) > lower), lower - rhs.lower);
122569}

◆ operator-() [2/2]

hugeint_t duckdb::hugeint_t::operator- ( ) const
122585 {
122586 return Hugeint::Negate<false>(*this);
122587}

◆ operator*()

hugeint_t duckdb::hugeint_t::operator* ( const hugeint_t & rhs) const
122571 {
122572 hugeint_t result = *this;
122573 result *= rhs;
122574 return result;
122575}

◆ operator/()

hugeint_t duckdb::hugeint_t::operator/ ( const hugeint_t & rhs) const
122577 {
122578 return Hugeint::Divide<false>(*this, rhs);
122579}

◆ operator%()

hugeint_t duckdb::hugeint_t::operator% ( const hugeint_t & rhs) const
122581 {
122582 return Hugeint::Modulo<false>(*this, rhs);
122583}

◆ operator>>()

hugeint_t duckdb::hugeint_t::operator>> ( const hugeint_t & rhs) const
122589 {
122590 hugeint_t result;
122591 uint64_t shift = rhs.lower;
122592 if (rhs.upper != 0 || shift >= 128) {
122593 return hugeint_t(0);
122594 } else if (shift == 0) {
122595 return *this;
122596 } else if (shift == 64) {
122597 result.upper = (upper < 0) ? -1 : 0;
122598 result.lower = uint64_t(upper);
122599 } else if (shift < 64) {
122600 // perform lower shift in unsigned integer, and mask away the most significant bit
122601 result.lower = (uint64_t(upper) << (64 - shift)) | (lower >> shift);
122602 result.upper = upper >> shift;
122603 } else {
122604 D_ASSERT(shift < 128);
122605 result.lower = uint64_t(upper >> (shift - 64));
122606 result.upper = (upper < 0) ? -1 : 0;
122607 }
122608 return result;
122609}
::uint64_t uint64_t

◆ operator<<()

hugeint_t duckdb::hugeint_t::operator<< ( const hugeint_t & rhs) const
122611 {
122612 if (upper < 0) {
122613 return hugeint_t(0);
122614 }
122615 hugeint_t result;
122616 uint64_t shift = rhs.lower;
122617 if (rhs.upper != 0 || shift >= 128) {
122618 return hugeint_t(0);
122619 } else if (shift == 64) {
122620 result.upper = int64_t(lower);
122621 result.lower = 0;
122622 } else if (shift == 0) {
122623 return *this;
122624 } else if (shift < 64) {
122625 // perform upper shift in unsigned integer, and mask away the most significant bit
122626 uint64_t upper_shift = ((uint64_t(upper) << shift) + (lower >> (64 - shift))) & 0x7FFFFFFFFFFFFFFF;
122627 result.lower = lower << shift;
122628 result.upper = int64_t(upper_shift);
122629 } else {
122630 D_ASSERT(shift < 128);
122631 result.lower = 0;
122632 result.upper = UnsafeNumericCast<int64_t>((lower << (shift - 64)) & 0x7FFFFFFFFFFFFFFF);
122633 }
122634 return result;
122635}
::int64_t int64_t

◆ operator&()

hugeint_t duckdb::hugeint_t::operator& ( const hugeint_t & rhs) const
122637 {
122638 hugeint_t result;
122639 result.lower = lower & rhs.lower;
122640 result.upper = upper & rhs.upper;
122641 return result;
122642}

◆ operator|()

hugeint_t duckdb::hugeint_t::operator| ( const hugeint_t & rhs) const
122644 {
122645 hugeint_t result;
122646 result.lower = lower | rhs.lower;
122647 result.upper = upper | rhs.upper;
122648 return result;
122649}

◆ operator^()

hugeint_t duckdb::hugeint_t::operator^ ( const hugeint_t & rhs) const
122651 {
122652 hugeint_t result;
122653 result.lower = lower ^ rhs.lower;
122654 result.upper = upper ^ rhs.upper;
122655 return result;
122656}

◆ operator~()

hugeint_t duckdb::hugeint_t::operator~ ( ) const
122658 {
122659 hugeint_t result;
122660 result.lower = ~lower;
122661 result.upper = ~upper;
122662 return result;
122663}

◆ operator+=()

hugeint_t & duckdb::hugeint_t::operator+= ( const hugeint_t & rhs)
122665 {
122666 *this = *this + rhs;
122667 return *this;
122668}

◆ operator-=()

hugeint_t & duckdb::hugeint_t::operator-= ( const hugeint_t & rhs)
122669 {
122670 *this = *this - rhs;
122671 return *this;
122672}

◆ operator*=()

hugeint_t & duckdb::hugeint_t::operator*= ( const hugeint_t & rhs)
122673 {
122674 *this = Hugeint::Multiply<false>(*this, rhs);
122675 return *this;
122676}

◆ operator/=()

hugeint_t & duckdb::hugeint_t::operator/= ( const hugeint_t & rhs)
122677 {
122678 *this = Hugeint::Divide<false>(*this, rhs);
122679 return *this;
122680}

◆ operator%=()

hugeint_t & duckdb::hugeint_t::operator%= ( const hugeint_t & rhs)
122681 {
122682 *this = Hugeint::Modulo<false>(*this, rhs);
122683 return *this;
122684}

◆ operator>>=()

hugeint_t & duckdb::hugeint_t::operator>>= ( const hugeint_t & rhs)
122685 {
122686 *this = *this >> rhs;
122687 return *this;
122688}

◆ operator<<=()

hugeint_t & duckdb::hugeint_t::operator<<= ( const hugeint_t & rhs)
122689 {
122690 *this = *this << rhs;
122691 return *this;
122692}

◆ operator&=()

hugeint_t & duckdb::hugeint_t::operator&= ( const hugeint_t & rhs)
122693 {
122694 lower &= rhs.lower;
122695 upper &= rhs.upper;
122696 return *this;
122697}

◆ operator|=()

hugeint_t & duckdb::hugeint_t::operator|= ( const hugeint_t & rhs)
122698 {
122699 lower |= rhs.lower;
122700 upper |= rhs.upper;
122701 return *this;
122702}

◆ operator^=()

hugeint_t & duckdb::hugeint_t::operator^= ( const hugeint_t & rhs)
122703 {
122704 lower ^= rhs.lower;
122705 upper ^= rhs.upper;
122706 return *this;
122707}

◆ operator bool()

duckdb::hugeint_t::operator bool ( ) const
explicit
122713 {
122714 return *this != 0;
122715}

◆ operator!()

bool duckdb::hugeint_t::operator! ( ) const
122709 {
122710 return *this == 0;
122711}

◆ operator uint8_t()

duckdb::hugeint_t::operator uint8_t ( ) const
explicit
122723 {
122724 return NarrowCast<uint8_t>(*this);
122725}

◆ operator uint16_t()

duckdb::hugeint_t::operator uint16_t ( ) const
explicit
122726 {
122727 return NarrowCast<uint16_t>(*this);
122728}

◆ operator uint32_t()

duckdb::hugeint_t::operator uint32_t ( ) const
explicit
122729 {
122730 return NarrowCast<uint32_t>(*this);
122731}

◆ operator uint64_t()

duckdb::hugeint_t::operator uint64_t ( ) const
explicit
122732 {
122733 return NarrowCast<uint64_t>(*this);
122734}

◆ operator int8_t()

duckdb::hugeint_t::operator int8_t ( ) const
explicit
122735 {
122736 return NarrowCast<int8_t>(*this);
122737}

◆ operator int16_t()

duckdb::hugeint_t::operator int16_t ( ) const
explicit
122738 {
122739 return NarrowCast<int16_t>(*this);
122740}

◆ operator int32_t()

duckdb::hugeint_t::operator int32_t ( ) const
explicit
122741 {
122742 return NarrowCast<int32_t>(*this);
122743}

◆ operator int64_t()

duckdb::hugeint_t::operator int64_t ( ) const
explicit
122744 {
122745 return NarrowCast<int64_t>(*this);
122746}

◆ operator uhugeint_t()

duckdb::hugeint_t::operator uhugeint_t ( ) const
explicit
122747 {
122748 return {static_cast<uint64_t>(this->upper), this->lower};
122749}

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