51 template<
typename dtype>
54 uint32 randIdx = random::randInt<uint32>(0, inArray.
size());
55 return inArray[randIdx];
68 template<
typename dtype>
80 [&inArray](dtype& value) ->
void
82 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:4497
iterator end() noexcept
Definition: NdArrayCore.hpp:1558
iterator begin() noexcept
Definition: NdArrayCore.hpp:1214
A Class for slicing into NdArrays.
Definition: Slice.hpp:44
NdArray< dtype > permutation(dtype inValue)
Definition: permutation.hpp:52
dtype choice(const NdArray< dtype > &inArray)
Definition: choice.hpp:52
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