1 write to _data
Microsoft.ML.Tokenizers (1)
Utils\PriorityQueue.cs (1)
17_data = new List<T>(capacity);
34 references to _data
Microsoft.ML.Tokenizers (34)
Utils\PriorityQueue.cs (34)
22_data.Add(item); 23int ci = _data.Count - 1; // child index; start at end 27if (_data[ci].CompareTo(_data[pi]) >= 0) break; // child item is larger than (or equal) parent so we're done 28T tmp = _data[ci]; _data[ci] = _data[pi]; _data[pi] = tmp; 36int li = _data.Count - 1; // last index (before removal) 37T frontItem = _data[0]; // fetch the front 38_data[0] = _data[li]; 39_data.RemoveAt(li); 48if (rc <= li && _data[rc].CompareTo(_data[ci]) < 0) // if there is a rc (ci + 1), and it is smaller than left child, use the rc instead 50if (_data[pi].CompareTo(_data[ci]) <= 0) break; // parent is smaller than (or equal to) smallest child so done 51T tmp = _data[pi]; _data[pi] = _data[ci]; _data[ci] = tmp; // swap parent and child 59T frontItem = _data[0]; 63public int Count => _data.Count; 68for (int i = 0; i < _data.Count; ++i) 69s += _data[i].ToString() + " "; 70s += "count = " + _data.Count; 74public void Clear() => _data.Clear(); 79if (_data.Count == 0) return true; 80int li = _data.Count - 1; // last index 81for (int pi = 0; pi < _data.Count; ++pi) // each parent index 86if (lci <= li && _data[pi].CompareTo(_data[lci]) > 0) return false; // if lc exists and it's greater than parent then bad. 87if (rci <= li && _data[pi].CompareTo(_data[rci]) > 0) return false; // check the right child too.