51 template<
typename dtype,
typename GeneratorType = std::mt19937>
54 uint32 randIdx = detail::randInt<uint32>(generator, inArray.
size());
55 return inArray[randIdx];
68 template<
typename dtype,
typename GeneratorType = std::mt19937>
82 [&generator, &inArray](dtype& value) ->
void { value = choice(generator, inArray); });
98 template<
typename dtype>
113 template<
typename dtype>
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:138
size_type size() const noexcept
Definition: NdArrayCore.hpp:4477
iterator end() noexcept
Definition: NdArrayCore.hpp:1576
iterator begin() noexcept
Definition: NdArrayCore.hpp:1268
A Class for slicing into NdArrays.
Definition: Slice.hpp:45
dtype choice(GeneratorType &generator, const NdArray< dtype > &inArray)
Definition: choice.hpp:52
NdArray< dtype > permutation(GeneratorType &generator, dtype inValue)
Definition: permutation.hpp:52
Definition: Random/bernoulli.hpp:41
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:35
dtype choice(const NdArray< dtype > &inArray)
Definition: choice.hpp:99
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:225
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40