Skip to content

Commit

Permalink
set max alfabet size to 2^28
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonVandeVyver committed Oct 22, 2024
1 parent 0ecb79e commit bba56bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libsais64-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ pub fn sais64(text: &Vec<u8>, sparseness_factor: u8) -> Result<Vec<i64>, &str> {
} else {
// bitpacked values do not fit in uint16_t, use 32-bit text
// set libsais_sparseness to highest sparseness factor fitting in 32-bit value and sparseness factor divisible by libsais sparseness
libsais_sparseness = 32 / BITS_PER_CHAR;
// max 28 out of 32 bits used, because a bucket is created for every element of the alfabet 8 * 2^28).
libsais_sparseness = 28 / BITS_PER_CHAR;
while sparseness_factor % libsais_sparseness != 0 && libsais_sparseness * BITS_PER_CHAR > 16 {
libsais_sparseness -= 1;
}
Expand Down

0 comments on commit bba56bb

Please sign in to comment.