1 write to _reservoir
Microsoft.ML.Core (1)
Utilities\ReservoirSampler.cs (1)
158
_reservoir
= new int[size];
20 references to _reservoir
Microsoft.ML.Core (20)
Utilities\ReservoirSampler.cs (20)
178
_reservoir
[i] = _rnd.Next(_cache.Length);
179
_counts[
_reservoir
[i]]++;
190
int ind = _rnd.Next(
_reservoir
.Length);
193
if (_counts[
_reservoir
[ind]] > 1)
197
_counts[
_reservoir
[ind]]--;
198
_reservoir
[ind] = tmp.Value;
201
else if (_counts[
_reservoir
[ind]] == 0)
202
_counts[
_reservoir
[ind]]++;
203
_getter(ref _cache[
_reservoir
[ind]]);
207
var next = _rnd.Next(
_reservoir
.Length);
208
if (
_reservoir
[next] ==
_reservoir
[ind])
210
_counts[
_reservoir
[next]]--;
211
_reservoir
[next] =
_reservoir
[ind];
212
_counts[
_reservoir
[next]]++;
230
if (!_locked && _numSampled <
_reservoir
.Length)
235
_reservoir
[i] = _rnd.Next((int)_numSampled);
236
_counts[
_reservoir
[i]]++;
250
foreach (var ind in
_reservoir
)