diff options
| author | Julian Weigt <juw@posteo.de> | 2026-01-23 17:48:51 +0100 |
|---|---|---|
| committer | Julian Weigt <juw@posteo.de> | 2026-02-04 15:57:00 +0100 |
| commit | 7107fc45c5316c2521165ea56d9d370860f0a905 (patch) | |
| tree | 7d741ef4b16cb4880f54d25c8e69493da8dc157f | |
| parent | 2d1d2bb2cbb6eb0702e6f7a17f8e867bc1de227d (diff) | |
Only consider strings that end in 0.
| -rw-r--r-- | charf.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -158,9 +158,8 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){ int generate_each_charf(VALUETYPE* f, index_t i){ index_t s=0; int d=2; - /*number of strings of length d that begin with 1*/ - index_t powd = 1UL << d-1; - /*number of strings of length d that begin with 1 but are not all 1*/ + /*number of strings of length d that begin with 1 and end with 0*/ + index_t powd = 1UL << d-2; while(i-s >= powd-1){ s += powd-1; d++; @@ -169,8 +168,8 @@ int generate_each_charf(VALUETYPE* f, index_t i){ if(d>N) return -1; - /*t starts with 1 and then comes i-s.*/ - index_t t = (1UL << d-1) + i-s; + /*t starts with 1, then comes i-s and then 0.*/ + index_t t = (1UL << d-1) + ( (i-s) << 1 ); /*Indicates if we want to consider this t.*/ bool is_representative = true; |
