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

Avoid broadcast over Q in tests #128

Merged
merged 2 commits into from
Sep 24, 2022
Merged

Avoid broadcast over Q in tests #128

merged 2 commits into from
Sep 24, 2022

Conversation

dkarrasch
Copy link
Contributor

PR description

Shouldn't my proposal yield the same result? I'm proposing this since broadcast over a Q matrix that has rather expensive getindex is somewhat an "abuse" of the fact that AbstractQ <: AbstractMatrix, see JuliaLang/julia#46196. This popped up in a nanosoldier run. I'm sure this is just a quick convenience usage here, in real-life code this would be horribly slow.

In case it matters if you interval-lify before the product, one could replace this line by

A = Symmetric(IA.Interval.(Matrix(Q)) * D * IA.Interval.(Matrix(Q')))

Shouldn't my proposal yield the same result? I'm proposing this since broadcast over a `Q` matrix that has rather expensive `getindex` is somewhat an "abuse" of the fact that `AbstractQ <: AbstractMatrix`, see JuliaLang/julia#46196. This popped up in a nanosoldier run. I'm sure this is just a quick convenience usage here, in real-life code this would be horribly slow.

In case it matters if you interval-lify before the product, one could replace this line by

```julia
A = Symmetric(IA.Interval.(Matrix(Q)) * D * IA.Interval.(Matrix(Q')))
```
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2022

Codecov Report

Merging #128 (c304a0e) into main (82bfa81) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #128   +/-   ##
=======================================
  Coverage   97.19%   97.19%           
=======================================
  Files          17       17           
  Lines         642      642           
=======================================
  Hits          624      624           
  Misses         18       18           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lucaferranti
Copy link
Member

Thank you for the PR! Yes, I think you need to intervallify before taking the product, otherwise you couldn't ensure that the starting D, Q are actually included in the corresponding interval version of A. (Now that I relook at the code, I think in principle it would be enough to convert D to matrix of intervals, but that's tangential to the issue).

@lucaferranti
Copy link
Member

(now there seem to be some probably unrelated compatibility issues with ModelingToolKit, I'll try to have a look at those)

@dkarrasch dkarrasch closed this Sep 12, 2022
@dkarrasch dkarrasch reopened this Sep 12, 2022
@dkarrasch
Copy link
Contributor Author

Gentle bump. CI failures appear only on windows, independently from the Julia version used.

@lucaferranti
Copy link
Member

yes you are right, the failures seem unrelated. I'm merging this and I'll address that in a separate PR.

@lucaferranti lucaferranti merged commit fe87dd4 into JuliaIntervals:main Sep 24, 2022
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 this pull request may close these issues.

3 participants