Merge branch 'master' of github.com:lh3/bwa
This commit is contained in:
commit
fa51f029b9
8
bwt.c
8
bwt.c
|
|
@ -95,7 +95,7 @@ static inline int __occ_aux(uint64_t y, int c)
|
||||||
return ((y + (y >> 4)) & 0xf0f0f0f0f0f0f0full) * 0x101010101010101ull >> 56;
|
return ((y + (y >> 4)) & 0xf0f0f0f0f0f0f0full) * 0x101010101010101ull >> 56;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c)
|
bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c)
|
||||||
{
|
{
|
||||||
bwtint_t n, l, j;
|
bwtint_t n, l, j;
|
||||||
uint32_t *p;
|
uint32_t *p;
|
||||||
|
|
@ -121,7 +121,7 @@ inline bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// an analogy to bwt_occ() but more efficient, requiring k <= l
|
// an analogy to bwt_occ() but more efficient, requiring k <= l
|
||||||
inline void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol)
|
void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol)
|
||||||
{
|
{
|
||||||
bwtint_t _k, _l;
|
bwtint_t _k, _l;
|
||||||
_k = (k >= bwt->primary)? k-1 : k;
|
_k = (k >= bwt->primary)? k-1 : k;
|
||||||
|
|
@ -158,7 +158,7 @@ inline void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint
|
||||||
((bwt)->cnt_table[(b)&0xff] + (bwt)->cnt_table[(b)>>8&0xff] \
|
((bwt)->cnt_table[(b)&0xff] + (bwt)->cnt_table[(b)>>8&0xff] \
|
||||||
+ (bwt)->cnt_table[(b)>>16&0xff] + (bwt)->cnt_table[(b)>>24])
|
+ (bwt)->cnt_table[(b)>>16&0xff] + (bwt)->cnt_table[(b)>>24])
|
||||||
|
|
||||||
inline void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4])
|
void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4])
|
||||||
{
|
{
|
||||||
bwtint_t l, j, x;
|
bwtint_t l, j, x;
|
||||||
uint32_t *p;
|
uint32_t *p;
|
||||||
|
|
@ -178,7 +178,7 @@ inline void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4])
|
||||||
}
|
}
|
||||||
|
|
||||||
// an analogy to bwt_occ4() but more efficient, requiring k <= l
|
// an analogy to bwt_occ4() but more efficient, requiring k <= l
|
||||||
inline void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4])
|
void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4])
|
||||||
{
|
{
|
||||||
bwtint_t _k, _l;
|
bwtint_t _k, _l;
|
||||||
_k = (k >= bwt->primary)? k-1 : k;
|
_k = (k >= bwt->primary)? k-1 : k;
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ inline uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c)
|
||||||
if (c == 0) n -= 15 - (k&15); // corrected for the masked bits
|
if (c == 0) n -= 15 - (k&15); // corrected for the masked bits
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
inline void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4])
|
void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4])
|
||||||
{
|
{
|
||||||
uint32_t x, b;
|
uint32_t x, b;
|
||||||
if (k == (uint32_t)(-1)) {
|
if (k == (uint32_t)(-1)) {
|
||||||
|
|
@ -80,7 +80,7 @@ inline void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4])
|
||||||
x -= 15 - (k&15);
|
x -= 15 - (k&15);
|
||||||
cnt[0] += x&0xff; cnt[1] += x>>8&0xff; cnt[2] += x>>16&0xff; cnt[3] += x>>24;
|
cnt[0] += x&0xff; cnt[1] += x>>8&0xff; cnt[2] += x>>16&0xff; cnt[3] += x>>24;
|
||||||
}
|
}
|
||||||
inline void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4])
|
void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4])
|
||||||
{
|
{
|
||||||
bwtl_occ4(bwt, k, cntk);
|
bwtl_occ4(bwt, k, cntk);
|
||||||
bwtl_occ4(bwt, l, cntl);
|
bwtl_occ4(bwt, l, cntl);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue