| 1 | // This file is part of A2Amapper.cxx . . $ `<file>/atac-driver/alignOverlap/overlap-sort.C`/ |
| 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 | #include "overlap.H"cxx . . $ `<file>/atac-driver/alignOverlap/overlap.H`/ |
| 20 | |
| 21 | int |
| 22 | sortMatches1cxx . . $ sortMatches1(9148c8c3ff42c9d8).(const void *a, const void *b) { |
| 23 | const atacMatchcxx . . $ atacMatch# *A = *((const atacMatchcxx . . $ atacMatch# * const *)a); |
| 24 | const atacMatchcxx . . $ atacMatch# *B = *((const atacMatchcxx . . $ atacMatch# * const *)b); |
| 25 | |
| 26 | if (A->iid1cxx . . $ atacMatch#iid1. < B->iid1cxx . . $ atacMatch#iid1.) return(-1); |
| 27 | if (A->iid1cxx . . $ atacMatch#iid1. > B->iid1cxx . . $ atacMatch#iid1.) return(1); |
| 28 | if (A->pos1cxx . . $ atacMatch#pos1. < B->pos1cxx . . $ atacMatch#pos1.) return(-1); |
| 29 | if (A->pos1cxx . . $ atacMatch#pos1. > B->pos1cxx . . $ atacMatch#pos1.) return(1); |
| 30 | if (A->len1cxx . . $ atacMatch#len1. > B->len1cxx . . $ atacMatch#len1.) return(-1); |
| 31 | if (A->len1cxx . . $ atacMatch#len1. < B->len1cxx . . $ atacMatch#len1.) return(1); |
| 32 | if (A->fwd1cxx . . $ atacMatch#fwd1. > B->fwd1cxx . . $ atacMatch#fwd1.) return(-1); |
| 33 | if (A->fwd1cxx . . $ atacMatch#fwd1. < B->fwd1cxx . . $ atacMatch#fwd1.) return(1); |
| 34 | return(0); |
| 35 | } |
| 36 | |
| 37 | int |
| 38 | sortMatches2cxx . . $ sortMatches2(9148c8c3ff42c9d8).(const void *a, const void *b) { |
| 39 | const atacMatchcxx . . $ atacMatch# *A = *((const atacMatchcxx . . $ atacMatch# * const *)a); |
| 40 | const atacMatchcxx . . $ atacMatch# *B = *((const atacMatchcxx . . $ atacMatch# * const *)b); |
| 41 | |
| 42 | if (A->iid2cxx . . $ atacMatch#iid2. < B->iid2cxx . . $ atacMatch#iid2.) return(-1); |
| 43 | if (A->iid2cxx . . $ atacMatch#iid2. > B->iid2cxx . . $ atacMatch#iid2.) return(1); |
| 44 | if (A->pos2cxx . . $ atacMatch#pos2. < B->pos2cxx . . $ atacMatch#pos2.) return(-1); |
| 45 | if (A->pos2cxx . . $ atacMatch#pos2. > B->pos2cxx . . $ atacMatch#pos2.) return(1); |
| 46 | if (A->len2cxx . . $ atacMatch#len2. > B->len2cxx . . $ atacMatch#len2.) return(-1); |
| 47 | if (A->len2cxx . . $ atacMatch#len2. < B->len2cxx . . $ atacMatch#len2.) return(1); |
| 48 | if (A->fwd2cxx . . $ atacMatch#fwd2. > B->fwd2cxx . . $ atacMatch#fwd2.) return(-1); |
| 49 | if (A->fwd2cxx . . $ atacMatch#fwd2. < B->fwd2cxx . . $ atacMatch#fwd2.) return(1); |
| 50 | return(0); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | |
| 55 | int |
| 56 | spanComparecxx . . $ spanCompare(9148c8c3ff42c9d8).(const void *a, const void *b) { |
| 57 | const span_tcxx . . $ span_t# *A = *((const span_tcxx . . $ span_t# * const *)a); |
| 58 | const span_tcxx . . $ span_t# *B = *((const span_tcxx . . $ span_t# * const *)b); |
| 59 | |
| 60 | if (A->_iidcxx . . $ span_t#_iid. < B->_iidcxx . . $ span_t#_iid.) return(-1); |
| 61 | if (A->_iidcxx . . $ span_t#_iid. > B->_iidcxx . . $ span_t#_iid.) return(1); |
| 62 | if (A->_begcxx . . $ span_t#_beg. < B->_begcxx . . $ span_t#_beg.) return(-1); |
| 63 | if (A->_begcxx . . $ span_t#_beg. > B->_begcxx . . $ span_t#_beg.) return(1); |
| 64 | return(0); |
| 65 | } |