52 template<
typename dtype,
typename GeneratorType = std::mt19937>
56 return inArray[randIdx];
69 template<
typename dtype,
typename GeneratorType = std::mt19937>
83 std::for_each(outArray.
begin(),
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:4604
iterator end() noexcept
Definition NdArrayCore.hpp:1623
iterator begin() noexcept
Definition NdArrayCore.hpp:1315
A Class for slicing into NdArrays.
Definition Slice.hpp:45
Definition Random/bernoulli.hpp:43
dtype choice(GeneratorType &generator, const NdArray< dtype > &inArray)
Definition choice.hpp:53
NdArray< dtype > permutation(GeneratorType &generator, dtype inValue)
Definition permutation.hpp:52
dtype randInt(GeneratorType &generator, dtype inLow, dtype inHigh=0)
Definition randInt.hpp:61
Definition Random/bernoulli.hpp:41
std::mt19937_64 generator_
generator function
Definition generator.hpp:35
dtype choice(const NdArray< dtype > &inArray)
Definition choice.hpp:102
Replace
Replace boolean.
Definition Enums.hpp:101
@ YES
Definition Enums.hpp:102
@ NO
Definition Enums.hpp:103
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition replace.hpp:45
std::uint32_t uint32
Definition Types.hpp:40