13 unsigned GetLength() const
\r
16 Die("HSP::GetLength(): Leni %u, Lenj %u, Loi %u, Loj %u, Score %.1f",
\r
17 Leni, Lenj, Loi, Loj, Score);
\r
22 unsigned GetHii() const
\r
25 return Loi + Leni - 1;
\r
28 unsigned GetHij() const
\r
31 return Loj + Lenj - 1;
\r
44 bool RightA(unsigned LA) const
\r
46 return Loi + Leni == LA;
\r
49 bool RightB(unsigned LB) const
\r
51 return Loj + Lenj == LB;
\r
54 unsigned GetIdCount(const byte *A, const byte *B) const
\r
57 unsigned K = GetLength();
\r
58 for (unsigned k = 0; k < K; ++k)
\r
62 if (toupper(a) == toupper(b))
\r
68 double OverlapFract(const HSPData &HSP) const
\r
70 if (Leni == 0 || Lenj == 0)
\r
73 unsigned MaxLoi = max(Loi, HSP.Loi);
\r
74 unsigned MaxLoj = max(Loj, HSP.Loj);
\r
75 unsigned MinHii = min(GetHii(), HSP.GetHii());
\r
76 unsigned MinHij = min(GetHij(), HSP.GetHij());
\r
78 unsigned Ovi = (MinHii < MaxLoi) ? 0 : MinHii - MaxLoi;
\r
79 unsigned Ovj = (MinHij < MaxLoj) ? 0 : MinHij - MaxLoj;
\r
81 asserta(Ovi <= Leni && Ovj <= Lenj);
\r
82 return double(Ovi*Ovj)/double(Leni*Lenj);
\r
85 bool operator<(const HSPData &rhs) const
\r
87 return Loi < rhs.Loi;
\r
92 Log("Loi=%u Loj=%u Li=%u Lj=%u Score=%.1f\n", Loi, Loj, Leni, Lenj, Score);
\r
97 Log("(%u-%u,%u-%u/%.1f)", Loi, GetHii(), Loj, GetHij(), Score);
\r
110 Log("BP%s Pos %u Ix %u", (IsLo ? "lo" : "hi"), Pos, Index);
\r