#ifndef COMMON_H_ #define COMMON_H_ #define OCC_INTV_SHIFT 5 #define OCC_INTERVAL (1LL << OCC_INTV_SHIFT) #define OCC_INTV_MASK (OCC_INTERVAL - 1) #define bwt_B00(b, k) ((b)->bwt[(k) >> 4] >> ((~(k) & 0xf) << 1) & 3) /* retrieve a character from the $-removed BWT string. Note that * bwt_t::bwt is not exactly the BWT string and therefore this macro is * called bwt_B0 instead of bwt_B */ #define bwt_B0(b, k) (bwt_bwt(b, k) >> ((~(k) & 0xf) << 1) & 3) #define bwt_set_intv(bwt, c, ik) ((ik).x[0] = (bwt)->L2[(int)(c)] + 1, (ik).x[2] = (bwt)->L2[(int)(c) + 1] - (bwt)->L2[(int)(c)], (ik).x[1] = (bwt)->L2[3 - (c)] + 1, (ik).info = 0) #define SA_BYTES_33(n_sa) ((((33 * (n_sa) + 7) / 8) & (~7L)) + 8) #define SA_BYTES_40(n_sa) ((((40 * (n_sa) + 7) / 8) & (~7L)) + 8) #define xassert(cond, msg) \ if ((cond) == 0) \ _err_fatal_simple_core(__func__, msg) typedef uint64_t bwtint_t; double realtime(void); void bwt_set_sa_33(uint8_t *sa_arr, bwtint_t k, bwtint_t val); bwtint_t bwt_get_sa_33(uint8_t *sa_arr, bwtint_t k); int main_sa(int argc, char **argv); int main_fmtidx(int argc, char **argv); #endif