Closed treeowl closed 8 years ago
I've commented those benchmarks out in #46 (adding Cabal benchmark integration), but they obviously need to be fixed.
A brief glance suggests that the problem is in the implementation, rather than the benchmarks themselves. Uh-oh.
This may have been caused by changes required for #14
(Though I can't see how as it would have failed before then as well, just with a different error.)
Actually, I think I may have an idea about where the issues arise:
Originally, newNodes
started creating new nodes from max_node_number + 1
, and max_node_number
defaulted to 0
. As such, 1
would have been the first node created here.
But now, if a graph is empty the initial node created is 0
(which is admittedly a regression I hadn't spotted). So I think this can be resolved by changing the 1
in insEdges'
to 0
(though this may affect other implicit assumptions, as I believe it assumed that insEdgeAVL 1
would create a singleton loop).
So the question is to whether to fix this regression (that no-one has complained about, and indeed I couldn't find anyone actually using nodeRange
manually when I attempted to fix the behaviour of how it was defined) or have insEdges'
do insEdge (0, n-1, ()) g
instead of insEdge (1, n, ()) g
(which is my preference).
Yup, that fixed it. I'll give the changes to make in #46.
We get
and