| 1 | // This file is part of A2Amapper.cxx . . $ `<file>/atac-driver/libatac/atacMatchOrder.H`/ |
| 2 | // Copyright (c) 2005 J. Craig Venter Institute |
| 3 | // Author: Brian Walenz |
| 4 | // |
| 5 | // This program is free software; you can redistribute it and/or modify |
| 6 | // it under the terms of the GNU General Public License as published by |
| 7 | // the Free Software Foundation; either version 2 of the License, or |
| 8 | // (at your option) any later version. |
| 9 | // |
| 10 | // This program is distributed in the hope that it will be useful, |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | // GNU General Public License for more details. |
| 14 | // |
| 15 | // You should have received (LICENSE.txt) a copy of the GNU General Public |
| 16 | // License along with this program; if not, write to the Free Software |
| 17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | |
| 19 | #ifndef ATAC_MATCHORDER_H |
| 20 | #define ATAC_MATCHORDER_Hcxx . . $ `atac-driver/libatac/atacMatchOrder.H:20:9`! |
| 21 | |
| 22 | #include <string> |
| 23 | #include <map> |
| 24 | using namespace std; |
| 25 | |
| 26 | #include "bio++.H"cxx . . $ `<file>/libbio/bio++.H`/ |
| 27 | |
| 28 | |
| 29 | class atacMatchOrdercxx . . $ atacMatchOrder# { |
| 30 | private: |
| 31 | void initializecxx . . $ atacMatchOrder#initialize(9e1ee8e080742efe).(atacMatchListcxx . . $ atacMatchList# *ML) { |
| 32 | _matchesLencxx . . $ atacMatchOrder#_matchesLen. = ML->numberOfMatchescxx . . $ atacMatchList#numberOfMatches(db52760e79bf9054).(); |
| 33 | _matchesMaxcxx . . $ atacMatchOrder#_matchesMax. = ML->numberOfMatchescxx . . $ atacMatchList#numberOfMatches(db52760e79bf9054).(); |
| 34 | _matchescxx . . $ atacMatchOrder#_matches. = new atacMatchcxx . . $ atacMatch# * [_matchesLencxx . . $ atacMatchOrder#_matchesLen.]; |
| 35 | _matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx. = new uint32cxx . . $ uint32# [_matchesLencxx . . $ atacMatchOrder#_matchesLen.]; |
| 36 | for (uint32cxx . . $ uint32# i=0; i<_matchesLencxx . . $ atacMatchOrder#_matchesLen.; i++) { |
| 37 | _matchescxx . . $ atacMatchOrder#_matches.[i] = ML->getMatchcxx . . $ atacMatchList#getMatch(4b949e4d42dbfd78).(i); |
| 38 | _matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx.[i] = ~uint32ZEROcxx . . $ `libutil/util.h:60:10`!; |
| 39 | } |
| 40 | }; |
| 41 | public: |
| 42 | atacMatchOrdercxx . . $ atacMatchOrder#atacMatchOrder(9e1ee8e080742efe).(atacMatchListcxx . . $ atacMatchList# *ML) { |
| 43 | initializecxx . . $ atacMatchOrder#initialize(9e1ee8e080742efe).(ML); |
| 44 | }; |
| 45 | atacMatchOrdercxx . . $ atacMatchOrder#atacMatchOrder(f3ef1525738b52af).(atacMatchListcxx . . $ atacMatchList# &ML) { |
| 46 | initializecxx . . $ atacMatchOrder#initialize(9e1ee8e080742efe).(&ML); |
| 47 | }; |
| 48 | ~cxx . . $ atacMatchOrder#`~atacMatchOrder`(ced63f7c635d850d).atacMatchOrdercxx . . $ atacMatchOrder#() { |
| 49 | delete [] _matchescxx . . $ atacMatchOrder#_matches.; |
| 50 | }; |
| 51 | |
| 52 | uint32cxx . . $ uint32# numMatchescxx . . $ atacMatchOrder#numMatches(db52760e79bf9054).(void) { return(_matchesLencxx . . $ atacMatchOrder#_matchesLen.); }; |
| 53 | uint32cxx . . $ uint32# numberOfMatchescxx . . $ atacMatchOrder#numberOfMatches(db52760e79bf9054).(void) { return(_matchesLencxx . . $ atacMatchOrder#_matchesLen.); }; |
| 54 | |
| 55 | // Return match i in our list. Common usage would be |
| 56 | // getMatch(index(iid) + 1) // return the match after the one we have |
| 57 | // getMatch(index(iid) - 1) |
| 58 | // |
| 59 | atacMatchcxx . . $ atacMatch# *getMatchcxx . . $ atacMatchOrder#getMatch(4b949e4d42dbfd78).(uint32cxx . . $ uint32# i) { |
| 60 | return(_matchescxx . . $ atacMatchOrder#_matches.[i]); |
| 61 | }; |
| 62 | atacMatchcxx . . $ atacMatch# *operatorcxx . . $ atacMatchOrder#`operator[]`(4b949e4d42dbfd78).[](uint32cxx . . $ uint32# i) { |
| 63 | return(_matchescxx . . $ atacMatchOrder#_matches.[i]); |
| 64 | }; |
| 65 | |
| 66 | // Return the index, in our sorted list, of the matchiid supplied. |
| 67 | // |
| 68 | uint32cxx . . $ uint32# indexcxx . . $ atacMatchOrder#index(2141b656ce2cc063).(uint32cxx . . $ uint32# matchiid) { |
| 69 | return(_matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx.[matchiid]); |
| 70 | }; |
| 71 | |
| 72 | // Merge the r match into the l match. The l match gets the result. |
| 73 | void mergeMatchescxx . . $ atacMatchOrder#mergeMatches(72ed48fc4fc66ee8).(atacMatchcxx . . $ atacMatch# *l, atacMatchcxx . . $ atacMatch# *r, uint32cxx . . $ uint32# mergeuid); |
| 74 | |
| 75 | void sortAcxx . . $ atacMatchOrder#sortA(b4d55b1286ff73e8).(uint32cxx . . $ uint32# first=0, uint32cxx . . $ uint32# len=0); |
| 76 | void sortBcxx . . $ atacMatchOrder#sortB(b4d55b1286ff73e8).(uint32cxx . . $ uint32# first=0, uint32cxx . . $ uint32# len=0); |
| 77 | void sortDiagonalcxx . . $ atacMatchOrder#sortDiagonal(b4d55b1286ff73e8).(uint32cxx . . $ uint32# first=0, uint32cxx . . $ uint32# len=0); |
| 78 | void sortMatchUIDcxx . . $ atacMatchOrder#sortMatchUID(b4d55b1286ff73e8).(uint32cxx . . $ uint32# first=0, uint32cxx . . $ uint32# len=0); |
| 79 | void sortParentUIDcxx . . $ atacMatchOrder#sortParentUID(b4d55b1286ff73e8).(uint32cxx . . $ uint32# first=0, uint32cxx . . $ uint32# len=0); |
| 80 | |
| 81 | private: |
| 82 | uint32cxx . . $ uint32# _matchesLencxx . . $ atacMatchOrder#_matchesLen.; |
| 83 | uint32cxx . . $ uint32# _matchesMaxcxx . . $ atacMatchOrder#_matchesMax.; |
| 84 | atacMatchcxx . . $ atacMatch# **_matchescxx . . $ atacMatchOrder#_matches.; |
| 85 | |
| 86 | atacMatchListcxx . . $ atacMatchList# *_MLcxx . . $ atacMatchOrder#_ML.; |
| 87 | |
| 88 | void updateIndexcxx . . $ atacMatchOrder#updateIndex(49f6e7a06ebc5aa8).(void) { |
| 89 | for (uint32cxx . . $ uint32# i=0; i<_matchesLencxx . . $ atacMatchOrder#_matchesLen.; i++) |
| 90 | _matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx.[i] = ~uint32ZEROcxx . . $ `libutil/util.h:60:10`!; |
| 91 | for (uint32cxx . . $ uint32# i=0; i<_matchesLencxx . . $ atacMatchOrder#_matchesLen.; i++) |
| 92 | _matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx.[_matchescxx . . $ atacMatchOrder#_matches.[i]->matchiidcxx . . $ atacMatch#matchiid.] = i; |
| 93 | }; |
| 94 | |
| 95 | uint32cxx . . $ uint32# *_matchIIDtoIdxcxx . . $ atacMatchOrder#_matchIIDtoIdx.; |
| 96 | }; |
| 97 | |
| 98 | |
| 99 | #endif // ATAC_MATCHORDER_H |