51 template<
typename dtype,
typename GeneratorType = std::mt19937>
55 return inArray[randIdx];
68 template<
typename dtype,
typename GeneratorType = std::mt19937>
82 std::for_each(outArray.
begin(),
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:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:135
size_type size() const noexcept
Definition NdArrayCore.hpp:4600
iterator end() noexcept
Definition NdArrayCore.hpp:1619
iterator begin() noexcept
Definition NdArrayCore.hpp:1311
A Class for slicing into NdArrays.
Definition Slice.hpp:45
Definition Random/bernoulli.hpp:41
dtype choice(GeneratorType &generator, const NdArray< dtype > &inArray)
Definition choice.hpp:52
NdArray< dtype > permutation(GeneratorType &generator, dtype inValue)
Definition permutation.hpp:52
dtype randInt(GeneratorType &generator, dtype inLow, dtype inHigh=0)
Definition randInt.hpp:60
Definition Random/bernoulli.hpp:39
std::mt19937_64 generator_
generator function
Definition generator.hpp:35
dtype choice(const NdArray< dtype > &inArray)
Definition choice.hpp:101
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