38 template <
typename StreamIterator>
43 if (n == 1) SA[1] = 0;
46 return saisxx( T, SA+1,
int32(n), 4 );
51 template <
typename StreamIterator>
56 for (i = 0; i <= n; ++i)
58 if (SA[i] == 0) primary = i;
59 else bwt[i] = T[SA[i] - 1];
61 for (i = primary; i < n; ++i) bwt[i] = bwt[i + 1];
67 template <
typename StreamIterator>
70 return saisxx_bwt( T, bwt, buffer,
int32(n), 4 );
75 template <
typename StreamIterator>
78 return saisxx_bwt( T, bwt, buffer,
int64(n),
int64(4) );
89 for (
int i = 0; i != 256; ++i)
92 for (
int j = 0; j != 4; ++j)
93 x |= (((i&3) == j) + ((i>>2&3) == j) + ((i>>4&3) == j) + (i>>6 == j)) << (j<<3);