31#include <unordered_set>
52 template<
typename dtype>
57 auto repeats = std::unordered_set<dtype>{};
58 auto count = std::unordered_set<dtype>{};
60 for (
const auto& value : inArray)
62 if (
count.count(value) > 0)
64 repeats.insert(value);
87 template<
typename dtype>
95 for (
const auto& value : inArray)
97 if (
count.count(value) > 0)
99 repeats.insert(value);
107 return sort(
NdArray<std::complex<dtype>>{ repeats.
begin(), repeats.end() });
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
iterator begin() noexcept
Definition: NdArrayCore.hpp:1315
std::iterator_traits< InputIt >::difference_type count(InputIt first, InputIt last, const T &value) noexcept
Definition: StlAlgorithms.hpp:120
Definition: Cartesian.hpp:40
NdArray< dtype > find_duplicates(const NdArray< dtype > &inArray)
Definition: find_duplicates.hpp:53
NdArray< dtype > sort(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: sort.hpp:46
Definition: StdComplexOperators.hpp:125