Store UPOs in a set & test possibly wrong #334
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously UPOs in
periodicorbits
anddavidchacklai
algorithms were stored in aRBTree
. This worked OK, however I noticed that sometimes duplicates occur even though they shouldn't. I could not trace down the bug, it seemed that rarely the equality==
in theRBTree
implementation just didn't work. I was testing and benchmarking other alternatives and my best solution is to useSet
with linear search for duplicates. It's not ideal but it benchmarks better than before both in time and number of allocations. Furthermore it's more readable and clean than the previous code withVectorWithEpsRadius
.Also, I noticed that in this test file:
ChaosTools.jl/test/periodicity/periodicorbits.jl
Lines 1 to 10 in 850e1f4
the publication fixed points might be incomplete. I found 2 more for period 2 and 3 more for period 3.
The test can stay like this for now, but I think that it is needed to find some analytically know UPOs in literature and introduce some systematic testing for all the UPO algorithms.