From 64ff0a76657ed6e689c996d99c7b09e3a82629d3 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Sat, 24 Jan 2026 08:46:42 +0100 Subject: Order by smallest because we go through smallest first. --- charf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index cc75381..63ee0d8 100644 --- a/charf.c +++ b/charf.c @@ -169,7 +169,7 @@ int generate_each_charf(VALUETYPE* f, index_t i){ if(d>N) return -1; /*t starts with 1, then comes i-s and then 0.*/ - index_t t = (1UL << d-1) + ( (i-s) << 1 ); + index_t t = ( (i-s) << 1 ) + 1UL; /*Indicates if we want to consider this t.*/ bool is_representative = true; @@ -190,11 +190,11 @@ int generate_each_charf(VALUETYPE* f, index_t i){ /*Such t which may equal its translates have already been filtered out by the previous step because they are copies of at least two shorter functions.*/ index_t ones = 0; for(int o = 0; o>(d-n)) & ones) ) is_representative = false; + if(is_representative) for(int n=1; n= ( (t<>(d-n)) & ones) ) is_representative = false; /*Set f to the values encoded in bit string t which is a value between 1 and powd = (1<> (d-n-1)) & 1); + for(int n=0; n> n) & 1); return d; } else return 0; -- cgit v1.2.3