/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, and its memory requirements will be close to zero. */ public void clear() { super.clear(); this.beta=1.0; this.weHadMoreThanOneEmptyBuffer = false; //this.setSamplingRate(samplingRate,N); RandomSamplingAssistant assist = this.samplingAssistant; if (assist != null) { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator()); } } /**
/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, and its memory requirements will be close to zero. */ public void clear() { super.clear(); this.beta=1.0; this.weHadMoreThanOneEmptyBuffer = false; //this.setSamplingRate(samplingRate,N); RandomSamplingAssistant assist = this.samplingAssistant; if (assist != null) { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator()); } } /**
/** * Constructs an approximate quantile finder with b buffers, each having k elements. * @param b the number of buffers * @param k the number of elements per buffer * @param N the total number of elements over which quantiles are to be computed. * @param samplingRate 1.0 --> all elements are consumed. 10.0 --> Consumes one random element from successive blocks of 10 elements each. Etc. * @param generator a uniform random number generator. */ public KnownDoubleQuantileEstimator(int b, int k, long N, double samplingRate, RandomEngine generator) { this.samplingRate = samplingRate; this.N = N; if (this.samplingRate <= 1.0) { this.samplingAssistant = null; } else { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, generator); } setUp(b,k); this.clear(); } /**
/** * Constructs an approximate quantile finder with b buffers, each having k elements. * @param b the number of buffers * @param k the number of elements per buffer * @param N the total number of elements over which quantiles are to be computed. * @param samplingRate 1.0 --> all elements are consumed. 10.0 --> Consumes one random element from successive blocks of 10 elements each. Etc. * @param generator a uniform random number generator. */ public KnownDoubleQuantileEstimator(int b, int k, long N, double samplingRate, RandomEngine generator) { this.samplingRate = samplingRate; this.N = N; if (this.samplingRate <= 1.0) { this.samplingAssistant = null; } else { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, generator); } setUp(b,k); this.clear(); } /**