Skip to content

Use scale for linear map with IdentityMultiple #892

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schillic
Copy link
Member

@schillic schillic commented Jan 11, 2025

This fixes an issue uncovered in #889.

The proposed change assumes that scale is available for the input set. This currently holds at least for the common input sets (Singleton, Hyperrectangle, Zonotope).

@schillic schillic marked this pull request as ready for review January 11, 2025 12:59
@@ -507,7 +507,7 @@ end
_wrap_invariant(X::LazySet, ::Int) = X
_wrap_invariant(::Nothing, n::Int) = Universe(n)

_wrap_inputs(U::AbstractInput, B::IdentityMultiple) = isidentity(B) ? U : map(u -> B * u, U)
_wrap_inputs(U::AbstractInput, B::IdentityMultiple) = isidentity(B) ? U : map(u -> scale(B.M.λ, u), U)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't B * u not using internally the scale method? what is the advantage of using scale?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the lazy operation use scale?

The advantage is that the added test now works. Without this change, the test crashes. I do not remember the details.

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.

2 participants