52 template<
typename dtype,
typename GeneratorType = std::mt19937>
55 uint32 randIdx = detail::randInt<uint32>(generator, inArray.
size());
56 return inArray[randIdx];
69 template<
typename dtype,
typename GeneratorType = std::mt19937>
85 [&generator, &inArray](dtype& value) ->
void { value = choice(generator, inArray); });
101 template<
typename dtype>
116 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:139
size_type size() const noexcept
Definition: NdArrayCore.hpp:4524
iterator end() noexcept
Definition: NdArrayCore.hpp:1623
iterator begin() noexcept
Definition: NdArrayCore.hpp:1315
A Class for slicing into NdArrays.
Definition: Slice.hpp:45
dtype choice(GeneratorType &generator, const NdArray< dtype > &inArray)
Definition: choice.hpp:53
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:102
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:225
Replace
Replace boolean.
Definition: Enums.hpp:101
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40