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

When should clamp! be expected? #11

Open
zsunberg opened this issue Aug 9, 2022 · 2 comments
Open

When should clamp! be expected? #11

zsunberg opened this issue Aug 9, 2022 · 2 comments

Comments

@zsunberg
Copy link
Member

zsunberg commented Aug 9, 2022

Hi @findmyway, I noticed you added clamp! to the readme. If I am implementing an agent, when should I expect clamp! to be implemented in addition to clamp. For instance, obviously I cannot expect clamp!(3, 1..1) to work, but I would expect clamp!(::Vector, ::Box) to work. In my code, how can I check and be confident that it will work?

@zsunberg zsunberg changed the title When should clamp! be expected When should clamp! be expected? Aug 9, 2022
@findmyway
Copy link
Member

My initial thought is, as long as the first positional argument of clamp! is mutable.

@zsunberg
Copy link
Member Author

Ok, I guess that is the obvious answer :) I guess any space of AbstractArrays should have both clamp and clamp!` implemented for it.

Someone will need to go through the current code and implement clamp!

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

No branches or pull requests

2 participants