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

Add method to swap arguments in a lazy operation #817

Closed
schillic opened this issue Oct 15, 2018 · 2 comments · Fixed by #1526
Closed

Add method to swap arguments in a lazy operation #817

schillic opened this issue Oct 15, 2018 · 2 comments · Fixed by #1526
Assignees
Labels
performance 🐎 More efficient code usability 🖱️ Simplifies the usage or interface

Comments

@schillic
Copy link
Member

The idea is not to actually swap the arguments (which is generally not possible due to type constraints) but to return a new object. This is good for convenience.
In the particular case of an Intersection object, we can also copy the cache.

@schillic schillic added performance 🐎 More efficient code usability 🖱️ Simplifies the usage or interface labels Oct 15, 2018
@mforets
Copy link
Member

mforets commented Oct 15, 2018

example, on current master:

X = BallInf(ones(2), 1.0);
H = LazySets.HalfSpace([-1.0, 0.0], 0.0);
d = [0.0, 1.0];

Z = XH
ρ(d, Z)
ρ(d, Z)

is intersection empty

2.0000000000000004

Z = HX
ρ(d, Z)
ρ(d, Z)
is intersection empty
is intersection empty

2.0000000000000004

@schillic
Copy link
Member Author

schillic commented Oct 15, 2018

#819 provided the method for Intersection. We should add the method also for the other binary lazy operations.

schillic added a commit that referenced this issue Oct 15, 2018
#817 - Add method to swap arguments in a lazy operation
@schillic schillic self-assigned this Jul 24, 2019
schillic added a commit that referenced this issue Jul 28, 2019
#817 - Add swap methods to binary lazy operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🐎 More efficient code usability 🖱️ Simplifies the usage or interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants