-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Can we make at-expression more general? #525
Comments
The scalar |
Yeah I was thinking of collections. |
This still doesn't work: julia> @expression(m, [i=1:2], x^2)
ERROR: Collection of expressions with @expression must be linear. For quadratic expressions, use your own array. |
We should make containers infer the element type by creating the first element and looking at its value. This would also remove the need for |
We shouldn't assume that the element type is homogeneous. We should use the same approach as julia> map(+, Any[1, 2, 3], Any[10, 20, 30])
3-element Array{Int64,1}:
11
22
33
julia> map(+, Any[1, 2, 3], Any[10, 20, 30.0])
3-element Array{Real,1}:
11
22
33.0 |
I agree, normally, this is what is done by |
At the moment if only works for linear expressions, which means it can't be used for extensions (or even quadratics). One option would be just to use JuMPDicts of Anys, I guess, but that could hurt you if you wanted to use it for matrix ops later I suppose.
The text was updated successfully, but these errors were encountered: