From 8026d05da941092a1f7522c9eb07d44cd17c7b61 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Tue, 20 Jan 2026 11:03:43 +0100 Subject: Fix first two function values to be 1 0. --- charf.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index 041cc39..ad2da3b 100644 --- a/charf.c +++ b/charf.c @@ -16,7 +16,7 @@ #define MODE DOUBLEMODE #endif -#define NUM_THREADS 6 +#define NUM_THREADS 7 #if MODE == DOUBLEERRORMODE #include "double-error.h" @@ -155,19 +155,21 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){ /*Generates all characteristic functions of length up N.*/ int generate_each_charf(VALUETYPE* f, int i){ int s=0; - int d=2; - while(d <= N){ + int d=0; + while(d+2 <= N){ /*number of strings of length d that are not all 0s or all 1s*/ - int powd = (1<= powd){ s += powd; d++; } else { - int t = i-s+1; + int t = i-s; /*Set f to the values encoded in bit string t which is a value between 1 and powd = (1<> n) & 1); - return d; + f[0] = int_to_valuetype(1); + f[1] = int_to_valuetype(0); + for(int n=0; n> n) & 1); + return d+2; } } return -1; -- cgit v1.2.3