Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an interval package instead of rolling our own intervals #8

Open
Ratfink opened this issue Oct 31, 2022 · 2 comments · May be fixed by #25
Open

Use an interval package instead of rolling our own intervals #8

Ratfink opened this issue Oct 31, 2022 · 2 comments · May be fixed by #25

Comments

@Ratfink
Copy link
Owner

Ratfink commented Oct 31, 2022

Since this was the first semi-substantial piece of Julia code I ever wrote, I did a few unidiomatic things early on. One of these, perhaps, is not making much use of the wide array of packages out there to help me. One of the most glaring places this shows up is the untyped implementation of intervals that I wrote. It might be reasonable in something like C++, but Julia has nice packages like IntervalArithmetic.jl that could make the job way easier. Since this package supports arithmetic on interval types, it might even reduce the need for a lot of type checks to see if we have a single vector or interval. It would be good to try porting ControlTimingSafety.jl to use IntervalArithmetic.jl and see if there's any performance hit. If not, or if it's not very big, it might be advantageous to make the switch.

@Ratfink
Copy link
Owner Author

Ratfink commented Mar 28, 2023

I think IntervalArithmetic is the right package to use here. We can use its IntervalBox type for reachable sets, which support matrix-IntervalBox multiplication just like vectors, and a hull function to compute the very kind of hull we use. Seems like switching to this package could simplify our code significantly.

@Ratfink
Copy link
Owner Author

Ratfink commented Mar 29, 2023

I'm working on making this change now. It looks like despite doing a lot more memory allocations, it's giving a 2–3× speedup, which is very impressive. More testing is still needed before I think about opening a PR for it though.

@Ratfink Ratfink linked a pull request Apr 3, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant