|
Blender V5.0
|
Classes | |
| struct | UIntF |
| struct | IntF |
| struct | DoubleUIntType |
| struct | DoubleUIntType< uint8_t > |
| struct | DoubleUIntType< uint16_t > |
| struct | DoubleUIntType< uint32_t > |
| struct | DoubleUIntType< uint64_t > |
Typedefs | |
| template<typename T> | |
| using | double_uint_type = typename DoubleUIntType<T>::type |
| using | UInt64_8 = UIntF<uint8_t, 8> |
| using | UInt64_16 = UIntF<uint16_t, 4> |
| using | UInt64_32 = UIntF<uint32_t, 2> |
| using | Int64_8 = IntF<uint8_t, 8> |
| using | Int64_16 = IntF<uint16_t, 4> |
| using | Int64_32 = IntF<uint32_t, 2> |
| using | UInt128_8 = UIntF<uint8_t, 16> |
| using | UInt128_16 = UIntF<uint16_t, 8> |
| using | UInt128_32 = UIntF<uint32_t, 4> |
| using | UInt128_64 = UIntF<uint64_t, 2> |
| using | UInt256_8 = UIntF<uint8_t, 32> |
| using | UInt256_16 = UIntF<uint16_t, 16> |
| using | UInt256_32 = UIntF<uint32_t, 8> |
| using | UInt256_64 = UIntF<uint64_t, 4> |
| using | Int128_8 = IntF<uint8_t, 16> |
| using | Int128_16 = IntF<uint16_t, 8> |
| using | Int128_32 = IntF<uint32_t, 4> |
| using | Int128_64 = IntF<uint64_t, 2> |
| using | Int256_8 = IntF<uint8_t, 32> |
| using | Int256_16 = IntF<uint16_t, 16> |
| using | Int256_32 = IntF<uint32_t, 8> |
| using | Int256_64 = IntF<uint64_t, 4> |
| using | UInt128 = UInt128_64 |
| using | UInt256 = UInt256_64 |
| using | Int128 = Int128_64 |
| using | Int256 = Int256_64 |
Functions | |
| template<typename T, typename T2, int S> | |
| void | generic_add (T *__restrict dst, const T *a, const T *b) |
| template<typename T, typename T2, int S> | |
| void | generic_sub (T *__restrict dst, const T *a, const T *b) |
| template<typename T, typename T2, int S> | |
| void | generic_unsigned_mul (T *__restrict dst, const T *a, const T *b) |
| template<typename T, int Size, BLI_ENABLE_IF((!std::is_void_v< double_uint_type< T > >))> | |
| UIntF< T, Size > | operator+ (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size, BLI_ENABLE_IF((!std::is_void_v< double_uint_type< T > >))> | |
| IntF< T, Size > | operator+ (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| UIntF< T, Size > | operator- (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| IntF< T, Size > | operator- (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size, BLI_ENABLE_IF((!std::is_void_v< double_uint_type< T > >))> | |
| UIntF< T, Size > | operator* (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | is_negative (const IntF< T, Size > &a) |
| template<typename T, int Size> | |
| bool | is_zero (const UIntF< T, Size > &a) |
| template<typename T, int Size> | |
| bool | is_zero (const IntF< T, Size > &a) |
| template<typename T, int Size, BLI_ENABLE_IF((!std::is_void_v< double_uint_type< T > >))> | |
| IntF< T, Size > | operator* (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| IntF< T, Size > | operator- (const IntF< T, Size > &a) |
| template<typename T, int Size> | |
| void | operator+= (UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| void | operator+= (IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| void | operator-= (UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| void | operator-= (IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| void | operator*= (UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| void | operator*= (IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator== (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator== (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator!= (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator!= (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, size_t Size> | |
| int | compare_reversed_order (const std::array< T, Size > &a, const std::array< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator< (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator<= (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator> (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator>= (const IntF< T, Size > &a, const IntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator< (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator<= (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator> (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| template<typename T, int Size> | |
| bool | operator>= (const UIntF< T, Size > &a, const UIntF< T, Size > &b) |
| using blender::fixed_width_int::double_uint_type = typename DoubleUIntType<T>::type |
Maps unsigned integer types to a type that's twice the size. E.g. uint16_t to uint32_t.
Definition at line 127 of file BLI_fixed_width_int.hh.
Definition at line 165 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int128_16 = IntF<uint16_t, 8> |
Definition at line 148 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int128_32 = IntF<uint32_t, 4> |
Definition at line 149 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int128_64 = IntF<uint64_t, 2> |
Definition at line 150 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int128_8 = IntF<uint8_t, 16> |
Definition at line 147 of file BLI_fixed_width_int.hh.
Definition at line 166 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int256_16 = IntF<uint16_t, 16> |
Definition at line 153 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int256_32 = IntF<uint32_t, 8> |
Definition at line 154 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int256_64 = IntF<uint64_t, 4> |
Definition at line 155 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int256_8 = IntF<uint8_t, 32> |
Definition at line 152 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int64_16 = IntF<uint16_t, 4> |
Definition at line 134 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int64_32 = IntF<uint32_t, 2> |
Definition at line 135 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::Int64_8 = IntF<uint8_t, 8> |
Definition at line 133 of file BLI_fixed_width_int.hh.
Definition at line 163 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt128_16 = UIntF<uint16_t, 8> |
Definition at line 138 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt128_32 = UIntF<uint32_t, 4> |
Definition at line 139 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt128_64 = UIntF<uint64_t, 2> |
Definition at line 140 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt128_8 = UIntF<uint8_t, 16> |
Definition at line 137 of file BLI_fixed_width_int.hh.
Definition at line 164 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt256_16 = UIntF<uint16_t, 16> |
Definition at line 143 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt256_32 = UIntF<uint32_t, 8> |
Definition at line 144 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt256_64 = UIntF<uint64_t, 4> |
Definition at line 145 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt256_8 = UIntF<uint8_t, 32> |
Definition at line 142 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt64_16 = UIntF<uint16_t, 4> |
Definition at line 130 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt64_32 = UIntF<uint32_t, 2> |
Definition at line 131 of file BLI_fixed_width_int.hh.
| using blender::fixed_width_int::UInt64_8 = UIntF<uint8_t, 8> |
Definition at line 129 of file BLI_fixed_width_int.hh.
|
inline |
Definition at line 488 of file BLI_fixed_width_int.hh.
Referenced by operator<(), operator<(), operator<=(), operator<=(), operator>(), operator>(), operator>=(), and operator>=().
Adds two fixed-width-integer together using the standard addition with carry algorithm taught in schools. The main difference is that the digits here are not 0 to 9, but 0 to max(T).
Due to the design of two's-complement numbers, this works for signed and unsigned fixed-width-integer. The overflow behavior is wrap-around.
| T | Type for individual digits. |
| T2 | Integer type that is twice as large as T. |
| S | Number of digits of type T in each fixed-width-integer. |
Definition at line 285 of file BLI_fixed_width_int.hh.
References b, i, T, T2, and blender::unroll().
Referenced by operator+(), and operator+().
Similar to generic_add, but for subtraction.
Definition at line 302 of file BLI_fixed_width_int.hh.
References b, i, T, T2, and blender::unroll().
Referenced by operator-(), and operator-().
|
inline |
Similar to generic_add, but for unsigned multiplication.
Definition at line 316 of file BLI_fixed_width_int.hh.
Referenced by operator*().
| bool blender::fixed_width_int::is_negative | ( | const IntF< T, Size > & | a | ) |
Using this function is faster than using the comparison operator. Only a single bit has to be checked to determine if the value is negative.
Definition at line 384 of file BLI_fixed_width_int.hh.
References T, and blender::fixed_width_int::IntF< T, S >::v.
Referenced by blender::fixed_width_int::IntF< T, S >::operator double(), operator*(), operator<(), operator<=(), operator>(), and operator>=().
|
inline |
Definition at line 396 of file BLI_fixed_width_int.hh.
References i, result, blender::unroll(), and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 389 of file BLI_fixed_width_int.hh.
References i, result, blender::unroll(), and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 476 of file BLI_fixed_width_int.hh.
References b, and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 482 of file BLI_fixed_width_int.hh.
References b, and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 404 of file BLI_fixed_width_int.hh.
References b, and is_negative().
|
inline |
Definition at line 373 of file BLI_fixed_width_int.hh.
References b, generic_unsigned_mul(), result, and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 458 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 453 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 349 of file BLI_fixed_width_int.hh.
References b, generic_add(), result, and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 341 of file BLI_fixed_width_int.hh.
References b, generic_add(), result, and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 438 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 433 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 424 of file BLI_fixed_width_int.hh.
|
inline |
Definition at line 365 of file BLI_fixed_width_int.hh.
References b, generic_sub(), result, and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 357 of file BLI_fixed_width_int.hh.
References b, generic_sub(), result, and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 448 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 443 of file BLI_fixed_width_int.hh.
References b.
|
inline |
Definition at line 502 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), is_negative(), and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 546 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 513 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), is_negative(), and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 552 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 464 of file BLI_fixed_width_int.hh.
References b, and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 470 of file BLI_fixed_width_int.hh.
References b, and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 524 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), is_negative(), and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 558 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), and blender::fixed_width_int::UIntF< T, S >::v.
|
inline |
Definition at line 535 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), is_negative(), and blender::fixed_width_int::IntF< T, S >::v.
|
inline |
Definition at line 564 of file BLI_fixed_width_int.hh.
References b, compare_reversed_order(), and blender::fixed_width_int::UIntF< T, S >::v.