Closed awage closed 2 years ago
Why so small ε though?
Nothing wrong with 1e-3. I was just annoyed by this behavior.
I solved the problem. There was a break statement in the loop once the attractor was found. The correct way to do is to return the label of the basin. For some reason the program was doing something else.
closes issue #238
Performances are smashing, for a 2000x2000 grid:
@time basins, att2 = basins_of_attraction(grid, ds; attractors = att, show_progress = true )
17.078572 seconds (19.98 M allocations: 862.074 MiB, 1.05% gc time)
On my old laptop.
I always wondered why that break
was there instead of return
and thought we do some kind of cleanup of the indexing, but guess it was just a mistake xD will merge and tag once tests pass
Fix to reduce the number of allocations in the second mode of operation in
basins_of_attraction
.Two new variables have been added to BasinsInfo.
New default value ε = 1e-5
Closes #238