| 1 | #cxx . . $ `<file>/seagen/hitMatrix-sort.C`/include "hitMatrix.H"cxx . . $ `<file>/seagen/hitMatrix.H`/ |
| 2 | |
| 3 | // Sort by dsPos |
| 4 | |
| 5 | inline |
| 6 | void |
| 7 | adjustHeap_dsPoscxx . . $ adjustHeap_dsPos(f2f016f97abe3246).(diagonalLinecxx . . $ diagonalLine# *L, uint32cxx . . $ uint32# p, uint32cxx . . $ uint32# n) { |
| 8 | uint32cxx . . $ uint32# q = L[p]._qsPoscxx . . $ diagonalLine#_qsPos.; |
| 9 | uint32cxx . . $ uint32# d = L[p]._dsPoscxx . . $ diagonalLine#_dsPos.; |
| 10 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 11 | uint32 l = L[p]._diagonalID; |
| 12 | #endif |
| 13 | uint32cxx . . $ uint32# c = (p << 1) + 1; // let c be the left child of p |
| 14 | |
| 15 | while (c < n) { |
| 16 | |
| 17 | // Find the larger of the two children |
| 18 | // |
| 19 | if ((c+1 < n) && (L[c]._dsPoscxx . . $ diagonalLine#_dsPos. < L[c+1]._dsPoscxx . . $ diagonalLine#_dsPos.)) |
| 20 | c++; |
| 21 | |
| 22 | // Does the node in question fit here? |
| 23 | // |
| 24 | if (d >= L[c]._dsPoscxx . . $ diagonalLine#_dsPos.) |
| 25 | break; |
| 26 | |
| 27 | // Else, swap the parent and the child |
| 28 | // |
| 29 | L[p]._qsPoscxx . . $ diagonalLine#_qsPos. = L[c]._qsPoscxx . . $ diagonalLine#_qsPos.; |
| 30 | L[p]._dsPoscxx . . $ diagonalLine#_dsPos. = L[c]._dsPoscxx . . $ diagonalLine#_dsPos.; |
| 31 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 32 | L[p]._diagonalID = L[c]._diagonalID; |
| 33 | #endif |
| 34 | |
| 35 | // Move down the tree |
| 36 | // |
| 37 | p = c; |
| 38 | c = (p << 1) + 1; |
| 39 | } |
| 40 | |
| 41 | L[p]._qsPoscxx . . $ diagonalLine#_qsPos. = q; |
| 42 | L[p]._dsPoscxx . . $ diagonalLine#_dsPos. = d; |
| 43 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 44 | L[p]._diagonalID = l; |
| 45 | #endif |
| 46 | } |
| 47 | |
| 48 | void |
| 49 | hitMatrixcxx . . $ hitMatrix#::sort_dsPoscxx . . $ hitMatrix#sort_dsPos(49f6e7a06ebc5aa8).(void) { |
| 50 | |
| 51 | if (_hitsLencxx . . $ hitMatrix#_hitsLen. > 1) { |
| 52 | |
| 53 | // Create the heap of lines. |
| 54 | // |
| 55 | for (uint32cxx . . $ uint32# i=_hitsLencxx . . $ hitMatrix#_hitsLen./2; i--; ) |
| 56 | adjustHeap_dsPoscxx . . $ adjustHeap_dsPos(f2f016f97abe3246).(_hitscxx . . $ hitMatrix#_hits., i, _hitsLencxx . . $ hitMatrix#_hitsLen.); |
| 57 | |
| 58 | // Interchange the new maximum with the element at the end of the tree |
| 59 | // |
| 60 | for (uint32cxx . . $ uint32# i=_hitsLencxx . . $ hitMatrix#_hitsLen.-1; i>0; i--) { |
| 61 | uint32cxx . . $ uint32# q = _hitscxx . . $ hitMatrix#_hits.[i]._qsPoscxx . . $ diagonalLine#_qsPos.; |
| 62 | uint32cxx . . $ uint32# d = _hitscxx . . $ hitMatrix#_hits.[i]._dsPoscxx . . $ diagonalLine#_dsPos.; |
| 63 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 64 | uint32 l = _hits[i]._diagonalID; |
| 65 | #endif |
| 66 | |
| 67 | _hitscxx . . $ hitMatrix#_hits.[i]._qsPoscxx . . $ diagonalLine#_qsPos. = _hitscxx . . $ hitMatrix#_hits.[0]._qsPoscxx . . $ diagonalLine#_qsPos.; |
| 68 | _hitscxx . . $ hitMatrix#_hits.[i]._dsPoscxx . . $ diagonalLine#_dsPos. = _hitscxx . . $ hitMatrix#_hits.[0]._dsPoscxx . . $ diagonalLine#_dsPos.; |
| 69 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 70 | _hits[i]._diagonalID = _hits[0]._diagonalID; |
| 71 | #endif |
| 72 | |
| 73 | _hitscxx . . $ hitMatrix#_hits.[0]._qsPoscxx . . $ diagonalLine#_qsPos. = q; |
| 74 | _hitscxx . . $ hitMatrix#_hits.[0]._dsPoscxx . . $ diagonalLine#_dsPos. = d; |
| 75 | #ifndef WITHOUT_DIAGONALIDcxx . . $ `seagen/hitMatrix.H:28:9`! |
| 76 | _hits[0]._diagonalID = l; |
| 77 | #endif |
| 78 | |
| 79 | adjustHeap_dsPoscxx . . $ adjustHeap_dsPos(f2f016f97abe3246).(_hitscxx . . $ hitMatrix#_hits., 0, i); |
| 80 | } |
| 81 | } |
| 82 | } |