From 1215648b1ba3c592bd9d97b871349673d1702e44 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 13 Dec 2021 20:40:18 +0100 Subject: Faster optimal solver. This is a pretty big one, but unfortunately performance only improved by about 5%. I implemented one of the main ideas of nxopt, that is switching to the inverse scramble on the fly if it gives a lower branching factor. On the one hand it makes sense that it does not have such a huge impact, since it only rarely happens that we do have a lower branching factor on inverse, but on the other hand I am quite sad that the improvement is barely noticeable :-( Maybe the problem is that I have introduced a lot of new overhead and I can improve that in the future. Or maybe I am just overlooking something stupid. --- src/utils.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 1c829c4..e0d3268 100644 --- a/src/utils.c +++ b/src/utils.c @@ -272,7 +272,17 @@ swap(int *a, int *b) int aux; aux = *a; - *a = *b; - *b = aux; + *a = *b; + *b = aux; +} + +void +swapu64(uint64_t *a, uint64_t *b) +{ + uint64_t aux; + + aux = *a; + *a = *b; + *b = aux; } -- cgit v1.3