50 template<
typename dtype1,
typename dtype2>
53 const auto uniqueBins =
unique(bins);
57 typename decltype(result)::size_type idx{ 0 };
60 [&uniqueBins, &result, &idx](
const auto value)
62 const auto upperBin = std::upper_bound(uniqueBins.begin(), uniqueBins.end(), value);
63 result[idx++] = static_cast<uint32>(std::distance(uniqueBins.begin(), upperBin));
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
size_type size() const noexcept
Definition: NdArrayCore.hpp:4524
iterator end() noexcept
Definition: NdArrayCore.hpp:1623
iterator begin() noexcept
Definition: NdArrayCore.hpp:1315
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:225
Definition: Cartesian.hpp:40
NdArray< uint32 > digitize(const NdArray< dtype1 > &x, const NdArray< dtype2 > &bins)
Definition: digitize.hpp:51
NdArray< dtype > unique(const NdArray< dtype > &inArray)
Definition: unique.hpp:53