44 template<
typename dtype>
50 for (
int bit = 0; bit < DtypeInfo<dtype>::bits(); ++bit)
52 count += (inValue & (dtype{ 1 } << bit)) >> bit;
65 template<
typename dtype>
73 [](dtype inValue) noexcept ->
int { return bit_count(inValue); });
#define STATIC_ASSERT_UNSIGNED_INTEGER(dtype)
Definition: StaticAsserts.hpp:42
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1221
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4092
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1529
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
std::iterator_traits< InputIt >::difference_type count(InputIt first, InputIt last, const T &value) noexcept
Definition: StlAlgorithms.hpp:121
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:784
Definition: Coordinate.hpp:45
constexpr int bit_count(dtype inValue) noexcept
Definition: bit_count.hpp:45