On Saturday, 6 April 2019 at 18:08:31 UTC, Mek101 wrote:
On Saturday, 6 April 2019 at 17:44:25 UTC, Nicholas Wilson
wrote:
Hmm,
import std.traits;
class WeightedRandom(T, W = float) if(isNumeric!W)
{
// Fields
private W[T] _pairs;
// The total sum of all the weights;
On Saturday, 6 April 2019 at 17:44:25 UTC, Nicholas Wilson wrote:
Hmm,
import std.traits;
class WeightedRandom(T, W = float) if(isNumeric!W)
{
// Fields
private W[T] _pairs;
// The total sum of all the weights;
private W _probabilities;
/// Code...
On Saturday, 6 April 2019 at 17:30:45 UTC, Mek101 wrote:
I'm rewriting from C# a small library of mine to practice with
D.
I have a class:
class WeightedRandom(T, W = float) if(isNumeric!W)
{
// Fields
private W[T] _pairs;
// The total sum of all the weights;