50 template<
typename dtype>
53 uint32 randIdx = random::randInt<uint32>(0, inArray.
size());
54 return inArray[randIdx];
66 template<
typename dtype>
78 [&inArray](dtype& value) ->
void
80 value = choice(inArray);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
size_type size() const noexcept
Definition: NdArrayCore.hpp:4296
iterator end() noexcept
Definition: NdArrayCore.hpp:1474
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
A Class for slicing into NdArrays.
Definition: Slice.hpp:44
NdArray< dtype > permutation(dtype inValue)
Definition: permutation.hpp:50
dtype choice(const NdArray< dtype > &inArray)
Definition: choice.hpp:51
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:213
Definition: Coordinate.hpp:45
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40