public SamplingLongPrimitiveIterator(RandomWrapper random, IEnumerator <long> enumerator, double samplingRate) { if (enumerator == null) { throw new ArgumentException("enumerator"); } if ((samplingRate <= 0.0) || (samplingRate > 1.0)) { throw new ArgumentException("samplingRate"); } this.geometricDistribution = new PascalDistribution(random.getRandomGenerator(), 1, samplingRate); this.enumerator = enumerator; this.SkipNext(); }
public SamplinglongPrimitiveIterator(RandomWrapper random, IEnumerator <long> enumerator, double samplingRate) { if (enumerator == null) { throw new ArgumentException("enumerator"); } if (!(samplingRate > 0.0 && samplingRate <= 1.0)) { throw new ArgumentException("samplingRate"); } //Preconditions.checkArgument(samplingRate > 0.0 && samplingRate <= 1.0, "Must be: 0.0 < samplingRate <= 1.0"); // Geometric distribution is special case of negative binomial (aka Pascal) with r=1: geometricDistribution = new PascalDistribution(random.getRandomGenerator(), 1, samplingRate); this.enumerator = enumerator; SkipNext(); }