-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
allow more of the newly named functions to take vector arguments #740
Comments
Related to the first example I gave, and maybe a separate issue that I can file, it would be better if I could do this:
But as @mlubin has told me, this doesn't work. I guess the scope of the j index goes to lower and upper bounds, but not to variable type? |
Because nobody was bothered enough to implement them. JuMP never claimed to be feature complete |
it was a half-rhetoric question haha |
That's not how |
OK, yes Is this related to #736 at all? Like I guess I assumed that it allows us to use the j index in kwargs? (There aren't examples yet so I don't know). |
You can use the index |
so should I submit a second issue for making variable categories kwargs? it's different from this issue about vector arguments |
Sure, it's on the roadmap though |
is it a big change? given that we are changing names, functions a lot in the next version, maybe it should go in there? Better to change a lot of things at once and ask people to update their code once |
I'm not in favor of rushing to stuff the next release with features given the deadlines and everyone being busy. Right now all the updates we're asking people to do are find/replace changes, and there's a big mental hurdle to ask people to start changing syntax, so I'm not convinced of the benefit of doing it all at once anyway. |
That makes sense. Find and replace is different to changing arguments. |
hey @joehuchette @IainNZ , thoughts on this one? is it tough? can it make it into this new version? |
Which vectorized methods would you like to see added, specifically? I'm alright adding something like |
So how about any of these variable get/set functions that aren't vectorized yet: setname, getname, setlowerbound, setupperbound, getlowerbound, getupperbound, getvalue, setvalue, getdual, setcategory, getcategory, getvariable? |
Go for it, except vectorized |
I definitely see the point. What happens with things indexed by
|
We could allow only a broadcasting version in that case, e.g., |
Yes, I'm (much) less OK adding something like |
the Julia dot syntax should work sometimes, but maybe not for JuMPContainers. so we should test that |
@mlubin said we may drop 0.5 next week-ish. so this code could be moved to JuMP then |
Replace JuMPDict with Dict. Rewrite JuMPArray to be compatible with AbstractArray. Explicit keyword argument in macro to force container type. Closes #1099 Closes #1047 Closes #417 (collect is now well defined for Array, JuMPArray, and Dict) Closes #833 (`eachindex` and `indices` are defined for JuMPArray) Closes #740 (dot broadcast syntax is now the default, no need to explicitly define vectorized functions) Closes #922 (fixed by checking for duplicates) Closes #933 (corollary: closes #346)
Replace JuMPDict with Dict. Rewrite JuMPArray to be compatible with AbstractArray. Explicit keyword argument in macro to force container type. Closes #1099 Closes #1047 Closes #417 (collect is now well defined for Array, JuMPArray, and Dict) Closes #833 (`eachindex` and `indices` are defined for JuMPArray) Closes #740 (dot broadcast syntax is now the default, no need to explicitly define vectorized functions) Closes #922 (fixed by checking for duplicates) Closes #933 (corollary: closes #346) Closes #643 (colons work for Array and JuMPArray, obviously not Dict) Closes #730 (end is not supported for JuMPArray) Closes #646 (we now rely on built-in iteration behavior for Dict)
Replace JuMPDict with Dict. Rewrite JuMPArray to be compatible with AbstractArray. Explicit keyword argument in macro to force container type. Closes #1099 Closes #1047 Closes #417 (collect is now well defined for Array, JuMPArray, and Dict) Closes #833 (`eachindex` and `indices` are defined for JuMPArray) Closes #740 (dot broadcast syntax is now the default, no need to explicitly define vectorized functions) Closes #922 (fixed by checking for duplicates) Closes #933 (corollary: closes #346) Closes #643 (colons work for Array and JuMPArray, obviously not Dict) Closes #730 (end is not supported for JuMPArray) Closes #646 (we now rely on built-in iteration behavior for Dict)
So I would never know which of the functions like
getvalue, setvalue, setlowerbound
etc take single variables and which can take vectors.getvalue
will take a vector,setlowerbound
doesnt.setvalue
, i actually forget, and the docs don't help.So currently i'm writing things like
And
map((ind -> setupperbound(x_orig[ind], 0.)), inds_cone)
That's not a big deal that I have to write extra, but what bothers me is that if some of these functions take vectors, why don't all of them?
The text was updated successfully, but these errors were encountered: