32#include <unordered_map>
54 template<
typename dtype,
typename HashFunction = std::hash<dtype>>
60 std::unordered_map<dtype, int, HashFunction>
counts{};
65 const auto& value = *
iter;
67 if (
counts.count(value) > 0)
69 auto& count =
counts[value];
79 counts.insert({ value, 1 });
126 template<
typename dtype>
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Custom const_iterator for NdArray.
Definition NdArrayIterators.hpp:41
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
Definition Cartesian.hpp:40
NdArray< dtype > mode(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition mode.hpp:55
Axis
Enum To describe an axis.
Definition Enums.hpp:36
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::uint32_t uint32
Definition Types.hpp:40
Definition StdComplexOperators.hpp:125