From 13d3fd69bc37eb35ccbb6122522c7848a7234245 Mon Sep 17 00:00:00 2001 From: Mendes Oulamara Date: Wed, 4 Dec 2013 16:47:33 +0100 Subject: Add heuritic to bitsets --- set_bitsets.c | 15 +++++++++++++++ sets.h | 1 + 2 files changed, 16 insertions(+) diff --git a/set_bitsets.c b/set_bitsets.c index 30e4dc9..53af83a 100644 --- a/set_bitsets.c +++ b/set_bitsets.c @@ -129,6 +129,21 @@ int elt_of_set(const set s){ assert(false); } +int elt_of_set_heur(const set s, int h){ + int N=nbCells(s.N), i; + + if(s.tab[h/SCOD]>>(h%SCOD+1) !=0) + return h + dyadic_val(s.tab[h/SCOD]>>(h%SCOD+1)) + 1; + + for(i=0; i Date: Wed, 4 Dec 2013 16:49:00 +0100 Subject: Add heuritic to linked lists --- set_linked_lists.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/set_linked_lists.c b/set_linked_lists.c index 8cc77c4..e865b95 100644 --- a/set_linked_lists.c +++ b/set_linked_lists.c @@ -239,6 +239,10 @@ int elt_of_set(const set s) { return -1; // should raise exception... hope this will be handled properly } +int elt_of_set_heur(const set s, int h) { + return elt_of_set(s); +} + void set_add_ip(int x, set s) { element prev, iter, e; -- cgit v1.2.3