53 template<
typename dtype,
typename GeneratorType = std::mt19937>
56 uint32 randIdx = detail::randInt<uint32>(generator, inArray.
size());
57 return inArray[randIdx];
70 template<
typename dtype,
typename GeneratorType = std::mt19937>
84 [&generator, &inArray](dtype& value) ->
void { value = choice(generator, inArray); });
100 template<
typename dtype>
115 template<
typename dtype>
#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:4289
iterator end() noexcept
Definition: NdArrayCore.hpp:1479
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
A Class for slicing into NdArrays.
Definition: Slice.hpp:44
dtype choice(GeneratorType &generator, const NdArray< dtype > &inArray)
Definition: choice.hpp:54
NdArray< dtype > permutation(GeneratorType &generator, dtype inValue)
Definition: permutation.hpp:55
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:37
dtype choice(const NdArray< dtype > &inArray)
Definition: choice.hpp:101
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:227
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