move bwt_invPsi() from bwt.h to bwt.c
This commit is contained in:
parent
fd67064207
commit
80e1137a6c
8
bwt.c
8
bwt.c
|
|
@ -45,6 +45,14 @@ void bwt_gen_cnt_table(bwt_t *bwt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bwtint_t bwt_invPsi(const bwt_t *bwt, bwtint_t k) // compute inverse CSA
|
||||||
|
{
|
||||||
|
bwtint_t x = k - (k > bwt->primary);
|
||||||
|
x = bwt_B0(bwt, x);
|
||||||
|
x = bwt->L2[x] + bwt_occ(bwt, k, x);
|
||||||
|
return k == bwt->primary? 0 : x;
|
||||||
|
}
|
||||||
|
|
||||||
// bwt->bwt and bwt->occ must be precalculated
|
// bwt->bwt and bwt->occ must be precalculated
|
||||||
void bwt_cal_sa(bwt_t *bwt, int intv)
|
void bwt_cal_sa(bwt_t *bwt, int intv)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
17
bwt.h
17
bwt.h
|
|
@ -124,21 +124,4 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// inverse Psi function
|
|
||||||
#if 0
|
|
||||||
#define bwt_invPsi(bwt, k) \
|
|
||||||
(((k) == (bwt)->primary)? 0 : \
|
|
||||||
((k) < (bwt)->primary)? \
|
|
||||||
(bwt)->L2[bwt_B0(bwt, k)] + bwt_occ(bwt, k, bwt_B0(bwt, k)) \
|
|
||||||
: (bwt)->L2[bwt_B0(bwt, (k)-1)] + bwt_occ(bwt, k, bwt_B0(bwt, (k)-1)))
|
|
||||||
#else
|
|
||||||
static inline bwtint_t bwt_invPsi(const bwt_t *bwt, bwtint_t k)
|
|
||||||
{
|
|
||||||
bwtint_t x = k - (k > bwt->primary);
|
|
||||||
x = bwt_B0(bwt, x);
|
|
||||||
x = bwt->L2[x] + bwt_occ(bwt, k, x);
|
|
||||||
return k == bwt->primary? 0 : x;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue