 |
NumCpp
1.0
A C++ implementation of the Python Numpy library
|
Go to the documentation of this file.
38 #include "boost/random/discrete_distribution.hpp"
56 template<
typename dtype>
61 boost::random::discrete_distribution<dtype> dist(inWeights.
cbegin(), inWeights.
cend());
78 template<
typename dtype>
85 boost::random::discrete_distribution<dtype> dist(inWeights.
cbegin(), inWeights.
cend());
88 [&dist](dtype& value) ->
void
90 value = dist(generator_);
#define STATIC_ASSERT_INTEGER(dtype)
Definition: StaticAsserts.hpp:41
void for_each(InputIt first, InputIt last, UnaryFunction f) noexcept
Definition: StlAlgorithms.hpp:214
dtype discrete(const NdArray< double > &inWeights)
Definition: discrete.hpp:57
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
iterator end() noexcept
Definition: NdArrayCore.hpp:1435
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
Definition: Coordinate.hpp:45
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:40
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1147
iterator begin() noexcept
Definition: NdArrayCore.hpp:1091