1 write to _data
Microsoft.ML.Tokenizers (1)
Utils\PriorityQueue.cs (1)
21_data = new List<T>(capacity);
34 references to _data
Microsoft.ML.Tokenizers (34)
Utils\PriorityQueue.cs (34)
26_data.Add(item); 27int ci = _data.Count - 1; // child index; start at end 31if (_data[ci].CompareTo(_data[pi]) >= 0) break; // child item is larger than (or equal) parent so we're done 32T tmp = _data[ci]; _data[ci] = _data[pi]; _data[pi] = tmp; 40int li = _data.Count - 1; // last index (before removal) 41T frontItem = _data[0]; // fetch the front 42_data[0] = _data[li]; 43_data.RemoveAt(li); 52if (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 54if (_data[pi].CompareTo(_data[ci]) <= 0) break; // parent is smaller than (or equal to) smallest child so done 55T tmp = _data[pi]; _data[pi] = _data[ci]; _data[ci] = tmp; // swap parent and child 63T frontItem = _data[0]; 67public int Count => _data.Count; 72for (int i = 0; i < _data.Count; ++i) 73s += _data[i].ToString() + " "; 74s += "count = " + _data.Count; 78public void Clear() => _data.Clear(); 83if (_data.Count == 0) return true; 84int li = _data.Count - 1; // last index 85for (int pi = 0; pi < _data.Count; ++pi) // each parent index 90if (lci <= li && _data[pi].CompareTo(_data[lci]) > 0) return false; // if lc exists and it's greater than parent then bad. 91if (rci <= li && _data[pi].CompareTo(_data[rci]) > 0) return false; // check the right child too.