54 template<
typename dtype>
59 dtype maxValue = inArray.
max().
item();
69 "array values too large, will result in gigantic array that will take up alot of memory...");
72 const uint16 outArraySize = std::max(
static_cast<uint16>(maxValue + 1), inMinLength);
77 std::for_each(clippedArray.
cbegin(),
79 [&outArray](dtype value) noexcept ->
void { ++outArray[value]; });
104 template<
typename dtype>
114 dtype maxValue = inArray.
max().
item();
124 "array values too large, will result in gigantic array that will take up alot of memory...");
127 const uint16 outArraySize = std::max(
static_cast<uint16>(maxValue + 1), inMinLength);
133 std::for_each(clippedArray.
cbegin(),
135 [&outArray, &inWeights, &counter](dtype value) noexcept ->
void
136 { 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:135
self_type max(Axis inAxis=Axis::NONE) const
Definition NdArrayCore.hpp:3117
self_type & zeros() noexcept
Definition NdArrayCore.hpp:4977
const_iterator cbegin() const noexcept
Definition NdArrayCore.hpp:1361
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4587
const_iterator cend() const noexcept
Definition NdArrayCore.hpp:1669
value_type item() const
Definition NdArrayCore.hpp:3098
self_type clip(value_type inMin, value_type inMax) const
Definition NdArrayCore.hpp:2445
Definition Cartesian.hpp:39
NdArray< dtype > bincount(const NdArray< dtype > &inArray, uint16 inMinLength=1)
Definition bincount.hpp:55
std::uint16_t uint16
Definition Types.hpp:41
std::uint32_t uint32
Definition Types.hpp:40