DUNE-ACFEM (unstable)
findbit.hh
24 template<class T, T val, bool isZero = val == 0, std::size_t N = std::numeric_limits<T>::digits/2, class SFINAE = void>
29 struct FindMostSignificantBitHelper<T, val, isZero, N, std::enable_if_t<!isZero && (N > 0) && 0 == (val & (std::numeric_limits<T>::max() << N))> >
36 struct FindMostSignificantBitHelper<T, val, isZero, N, std::enable_if_t<!isZero && (N > 0) && 0 != (val & (std::numeric_limits<T>::max() << N))> >
38 static constexpr std::size_t value = N + FindMostSignificantBitHelper<T, (val >> N), (val >> N) == 0, N/2>::value;
70 using FindMostSignificantBit = IndexConstant<FindMostSignificantBitHelper<std::size_t, mask>::value>;
73 template<class T, T val, bool isZero = val == 0, std::size_t N = std::numeric_limits<T>::digits/2, class = void>
78 struct FindLeastSignificantBitHelper<T, val, isZero, N, std::enable_if_t<!isZero && (N > 0) && 0 != (val & ~(std::numeric_limits<T>::max() << N))> >
80 static constexpr std::size_t value = FindLeastSignificantBitHelper<T, val, val == 0, N/2>::value;
85 struct FindLeastSignificantBitHelper<T, val, isZero, N, std::enable_if_t<!isZero && (N > 0) && 0 == (val & ~(std::numeric_limits<T>::max() << N))> >
87 static constexpr std::size_t value = N + FindLeastSignificantBitHelper<T, (val >> N), (val >> N) == 0, N/2>::value;
119 using FindLeastSignificantBit = IndexConstant<FindLeastSignificantBitHelper<std::size_t, mask>::value>;
134 using FindFirstZeroBit = IndexConstant<FindLeastSignificantBitHelper<std::size_t, ~mask>::value>;
constexpr std::size_t findMostSignificantBit(Constant< T, V > &&)
Template-algorithm which returns the the index of the most significant bit in an integer-constant.
Definition: findbit.hh:61
IndexConstant< FindLeastSignificantBitHelper< std::size_t, ~mask >::value > FindFirstZeroBit
Template-algorithm which defines the index of the first 0-bit as a std::index_constant.
Definition: findbit.hh:134
IndexConstant< FindLeastSignificantBitHelper< std::size_t, mask >::value > FindLeastSignificantBit
Template-algorithm which defines the index of the least significant bit as a std::index_constant.
Definition: findbit.hh:119
constexpr std::size_t findFirstZeroBit(Constant< T, V > &&)
Template-algorithm which returns the the index of the first 0-bit in an integer-constant.
Definition: findbit.hh:125
IndexConstant< FindMostSignificantBitHelper< std::size_t, mask >::value > FindMostSignificantBit
Template-algorithm which defines the index of the most significant bit as a std::index_constant.
Definition: findbit.hh:70
constexpr std::size_t findLeastSignificantBit(Constant< T, V > &&)
Template-algorithm which returns the the index of the least significant bit in an integer-constant.
Definition: findbit.hh:110
integral_constant< T, V > Constant
Short-cut for any integral constant.
Definition: types.hh:40
Constant< std::size_t, V > IndexConstant
Short-cut for integral constant of type std::size_t.
Definition: types.hh:44
constexpr bool isZero
Shortcut identifying a zero model.
Definition: modeltraits.hh:642
STL namespace.
|
Legal Statements / Impressum |
Hosted by TU Dresden & Uni Heidelberg |
generated with Hugo v0.111.3
(Jun 19, 23:17, 2026)