MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ weighted_pick() [1/2]

size_t MayaFlux::Kinesis::Stochastic::Weights::weighted_pick ( size_t  row_index,
Stochastic &  generator 
) const
inline

Weighted random draw over one row of this table.

Parameters
row_indexRow index, unchecked
generatorEntropy source for the draw
Returns
Index into the row, or cols() when every weight in the row is zero or negative

Definition at line 281 of file Weights.hpp.

282 {
283 return weighted_pick(row(row_index), generator);
284 }
std::span< const double > row(size_t row) const noexcept
Non-atomic view of one row.
Definition Weights.hpp:150
static size_t weighted_pick(std::span< const double > weights, Stochastic &generator)
Weighted random draw over a row of nonnegative weights.
Definition Weights.hpp:252

References row(), and weighted_pick().

+ Here is the call graph for this function: