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::FastMod< TYPE > Class Template Reference

Public Member Functions

 FastMod (TYPE divisor_p)
 
TYPE Div (const TYPE &val) const
 
TYPE Mod (const TYPE &val, const TYPE &quotient) const
 
TYPE Mod (const TYPE &val) const
 
const TYPEGetDivisor () const
 

Private Types

using NEXT_TYPE = typename NextUnsigned< TYPE >::type
 

Private Attributes

const TYPE divisor
 
const TYPE multiplier
 

Constructor & Destructor Documentation

◆ FastMod()

template<class TYPE >
duckdb::FastMod< TYPE >::FastMod ( TYPE  divisor_p)
inlineexplicit
3616 : divisor(divisor_p), multiplier((static_cast<TYPE>(-1) / divisor) + 1) {
3617 }
TYPE

Member Function Documentation

◆ Div()

template<class TYPE >
TYPE duckdb::FastMod< TYPE >::Div ( const TYPE val) const
inline
3619 {
3620 return static_cast<TYPE>((static_cast<NEXT_TYPE>(val) * multiplier) >> (sizeof(TYPE) * 8)); // NOLINT
3621 }

◆ Mod() [1/2]

template<class TYPE >
TYPE duckdb::FastMod< TYPE >::Mod ( const TYPE val,
const TYPE quotient 
) const
inline
3623 {
3624 return val - quotient * divisor;
3625 }

◆ Mod() [2/2]

template<class TYPE >
TYPE duckdb::FastMod< TYPE >::Mod ( const TYPE val) const
inline
3627 {
3628 return Mod(val, Div(val));
3629 }

◆ GetDivisor()

template<class TYPE >
const TYPE & duckdb::FastMod< TYPE >::GetDivisor ( ) const
inline
3631 {
3632 return divisor;
3633 }

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