Fix memory leak in variational optimiser, add small optimisations
This MR fixes a memory leak arising from temporary workspace being allocated with new
but then never delete
d. It also adds a couple of small optimisations:
-
for
loops useconst int
parameters to avoid reevaluating iterators etc at each loop iteration - memory is pre-allocated for each NodeOpti object -- note this does lead to higher memory usage
-
HypEl
has had itsnu
parameter reset to 0.4 to be consistent with the original publication andLinEl
-- we should probably add the option to be able to specify this