Lines Matching defs:heap

5602     // We build a heap of squared euclidean distances between current and last pointers
5607 PointerDistanceHeapElement heap[MAX_POINTERS * MAX_POINTERS];
5624 // Insert new element into the heap (sift up).
5625 heap[heapSize].currentPointerIndex = currentPointerIndex;
5626 heap[heapSize].lastPointerIndex = lastPointerIndex;
5627 heap[heapSize].distance = distance;
5643 && heap[childIndex + 1].distance < heap[childIndex].distance) {
5647 if (heap[parentIndex].distance <= heap[childIndex].distance) {
5651 swap(heap[parentIndex], heap[childIndex]);
5657 ALOGD("assignPointerIds - initial distance min-heap: size=%d", heapSize);
5659 ALOGD(" heap[%d]: cur=%d, last=%d, distance=%lld",
5660 i, heap[i].currentPointerIndex, heap[i].lastPointerIndex,
5661 heap[i].distance);
5677 // the heap (the one with smallest distance).
5680 // Previous iterations consumed the root element of the heap.
5681 // Pop root element off of the heap (sift down).
5682 heap[0] = heap[heapSize];
5690 && heap[childIndex + 1].distance < heap[childIndex].distance) {
5694 if (heap[parentIndex].distance <= heap[childIndex].distance) {
5698 swap(heap[parentIndex], heap[childIndex]);
5703 ALOGD("assignPointerIds - reduced distance min-heap: size=%d", heapSize);
5705 ALOGD(" heap[%d]: cur=%d, last=%d, distance=%lld",
5706 i, heap[i].currentPointerIndex, heap[i].lastPointerIndex,
5707 heap[i].distance);
5714 uint32_t currentPointerIndex = heap[0].currentPointerIndex;
5717 uint32_t lastPointerIndex = heap[0].lastPointerIndex;
5732 lastPointerIndex, currentPointerIndex, id, heap[0].distance);