57 template<
typename dtype>
62 dtype maxValue = inArray.
max().
item();
72 "array values too large, will result in gigantic array that will take up alot of memory...");
75 const uint16 outArraySize = std::max(
static_cast<uint16>(maxValue + 1), inMinLength);
80 std::for_each(clippedArray.
cbegin(),
82 [&outArray](dtype value) noexcept ->
void { ++outArray[value]; });
107 template<
typename dtype>
117 dtype maxValue = inArray.
max().
item();
127 "array values too large, will result in gigantic array that will take up alot of memory...");
130 const uint16 outArraySize = std::max(
static_cast<uint16>(maxValue + 1), inMinLength);
136 std::for_each(clippedArray.
cbegin(),
138 [&outArray, &inWeights, &counter](dtype value) noexcept ->
void
139 { outArray[value] += inWeights[counter++]; });
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
#define STATIC_ASSERT_INTEGER(dtype)
Definition StaticAsserts.hpp:43
static constexpr dtype max() noexcept
Definition DtypeInfo.hpp:110
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
self_type max(Axis inAxis=Axis::NONE) const
Definition NdArrayCore.hpp:3121
self_type & zeros() noexcept
Definition NdArrayCore.hpp:4981
const_iterator cbegin() const noexcept
Definition NdArrayCore.hpp:1365
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
const_iterator cend() const noexcept
Definition NdArrayCore.hpp:1673
value_type item() const
Definition NdArrayCore.hpp:3102
self_type clip(value_type inMin, value_type inMax) const
Definition NdArrayCore.hpp:2449
Definition Cartesian.hpp:40
NdArray< dtype > bincount(const NdArray< dtype > &inArray, uint16 inMinLength=1)
Definition bincount.hpp:58
std::uint16_t uint16
Definition Types.hpp:41
std::uint32_t uint32
Definition Types.hpp:40