Lines Matching refs:pos
173 for (int pos = _count; pos > 0; pos = pos/2) in HeapUp() local
175 if (pos/2 < 1) // pos == 1 peaked, 0 reserved. in HeapUp()
180 if (_list[pos]->HeapValueCmp(_list[pos/2]) < 0) in HeapUp()
182 HeapEntry* tmp = _list[pos/2]; in HeapUp()
183 _list[pos/2] = _list[pos]; in HeapUp()
184 _list[pos] = tmp; in HeapUp()
186 _list[pos]->SetIndex(pos); in HeapUp()
187 _list[pos/2]->SetIndex(pos/2); in HeapUp()
200 for (int pos = index; pos <= _count; pos = min_son) in HeapDown() local
202 if (pos*2 > _count) // pos is a leaf node. in HeapDown()
206 else if (pos*2 == _count) in HeapDown()
208 min_son = pos*2; in HeapDown()
212 if (_list[pos*2+1]->HeapValueCmp(_list[pos*2]) < 0) in HeapDown()
214 min_son = pos*2+1; in HeapDown()
218 min_son = pos*2; in HeapDown()
222 if (_list[pos]->HeapValueCmp(_list[min_son]) > 0) in HeapDown()
225 _list[min_son] = _list[pos]; in HeapDown()
226 _list[pos] = tmp; in HeapDown()
228 _list[pos]->SetIndex(pos); in HeapDown()
287 int pos = item->GetIndex() ; in HeapDelete() local
288 if ((pos > _count) ||(pos <= 0)) in HeapDelete()
294 HeapEntry* del = _list[pos]; in HeapDelete()
295 _list[pos] = _list[_count]; in HeapDelete()
296 _list[pos]->SetIndex(pos); in HeapDelete()
301 HeapDown(pos); in HeapDelete()
302 heap_assert(pos == del->GetIndex()); in HeapDelete()