 |
NumCpp
2.3.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
37 #include "boost/random/discrete_distribution.hpp"
55 template<
typename dtype>
60 boost::random::discrete_distribution<dtype> dist(inWeights.
cbegin(), inWeights.
cend());
77 template<
typename dtype>
84 boost::random::discrete_distribution<dtype> dist(inWeights.
cbegin(), inWeights.
cend());
87 [&dist](dtype& value) ->
void
89 value = dist(generator_);
#define STATIC_ASSERT_INTEGER(dtype)
Definition: StaticAsserts.hpp:40
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:213
dtype discrete(const NdArray< double > &inWeights)
Definition: discrete.hpp:56
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:40
iterator end() noexcept
Definition: NdArrayCore.hpp:1434
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1490
Definition: Coordinate.hpp:44
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:39
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1146
iterator begin() noexcept
Definition: NdArrayCore.hpp:1090