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_re2::Bitmap256 Class Reference

Public Member Functions

void Clear ()
bool Test (int c) const
void Set (int c)
int FindNextSetBit (int c) const

Static Private Member Functions

static int FindLSBSet (uint64_t n)

Private Attributes

uint64_t words_ [4]

Constructor & Destructor Documentation

◆ Bitmap256()

duckdb_re2::Bitmap256::Bitmap256 ( )
inline
458873 {
458874 Clear();
458875 }

Member Function Documentation

◆ Clear()

void duckdb_re2::Bitmap256::Clear ( )
inline
458878 {
458879 memset(words_, 0, sizeof words_);
458880 }

◆ Test()

bool duckdb_re2::Bitmap256::Test ( int c) const
inline
458883 {
458884 DCHECK_GE(c, 0);
458885 DCHECK_LE(c, 255);
458886
458887 return (words_[c / 64] & (uint64_t{1} << (c % 64))) != 0;
458888 }

◆ Set()

void duckdb_re2::Bitmap256::Set ( int c)
inline
458891 {
458892 DCHECK_GE(c, 0);
458893 DCHECK_LE(c, 255);
458894
458895 words_[c / 64] |= (uint64_t{1} << (c % 64));
458896 }
::uint64_t uint64_t

◆ FindNextSetBit()

int duckdb_re2::Bitmap256::FindNextSetBit ( int c) const
458952 {
458953 DCHECK_GE(c, 0);
458954 DCHECK_LE(c, 255);
458955
458956 // Check the word that contains the bit. Mask out any lower bits.
458957 int i = c / 64;
458958 uint64_t word = words_[i] & (~uint64_t{0} << (c % 64));
458959 if (word != 0)
458960 return (i * 64) + FindLSBSet(word);
458961
458962 // Check any following words.
458963 i++;
458964 switch (i) {
458965 case 1:
458966 if (words_[1] != 0)
458967 return (1 * 64) + FindLSBSet(words_[1]);
458968 FALLTHROUGH_INTENDED;
458969 case 2:
458970 if (words_[2] != 0)
458971 return (2 * 64) + FindLSBSet(words_[2]);
458972 FALLTHROUGH_INTENDED;
458973 case 3:
458974 if (words_[3] != 0)
458975 return (3 * 64) + FindLSBSet(words_[3]);
458976 FALLTHROUGH_INTENDED;
458977 default:
458978 return -1;
458979 }
458980}

◆ FindLSBSet()

int duckdb_re2::Bitmap256::FindLSBSet ( uint64_t n)
inlinestaticprivate
458904 {
458905 DCHECK_NE(n, 0);
458906#if defined(__GNUC__)
458907 return __builtin_ctzll(n);
458908#elif defined(_MSC_VER) && defined(_M_X64)
458909 unsigned long c;
458910 _BitScanForward64(&c, n);
458911 return static_cast<int>(c);
458912#elif defined(_MSC_VER) && defined(_M_IX86)
458913 unsigned long c;
458914 if (static_cast<uint32_t>(n) != 0) {
458915 _BitScanForward(&c, static_cast<uint32_t>(n));
458916 return static_cast<int>(c);
458917 } else {
458918 _BitScanForward(&c, static_cast<uint32_t>(n >> 32));
458919 return static_cast<int>(c) + 32;
458920 }
458921#else
458922 int c = 63;
458923 for (int shift = 1 << 5; shift != 0; shift >>= 1) {
458924 uint64_t word = n << shift;
458925 if (word != 0) {
458926 n = word;
458927 c -= shift;
458928 }
458929 }
458930 return c;
458931#endif
458932 }
::uint32_t uint32_t

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