summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--charf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/charf.c b/charf.c
index 33220ea..e882863 100644
--- a/charf.c
+++ b/charf.c
@@ -184,9 +184,17 @@ int generate_triangle(VALUETYPE* f, int i){
else return -1;
}
+int generate_random(VALUETYPE* f, int i){
+ f[0] = int_to_valuetype(1);
+ f[1] = int_to_valuetype(0);
+ for(int n=2; n < N; n++) f[n] = int_to_valuetype(rand() % 2);
+ return N;
+}
+
/*Writes into f the values of the function indexed by i. Returns the size of the support of f, or -1 if there is no function with that index.*/
int generate_function(VALUETYPE* f, int i){
return generate_each_charf(f,i);
+ //return generate_random(f,i);
//return generate_triangle(f,i);
}