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

broadcasting a JuMParray #1455

Closed
bbrunaud opened this issue Sep 3, 2018 · 0 comments
Closed

broadcasting a JuMParray #1455

bbrunaud opened this issue Sep 3, 2018 · 0 comments
Milestone

Comments

@bbrunaud
Copy link

bbrunaud commented Sep 3, 2018

Cannot apply a vectorized operation to a JuMParray

julia> @variable(m, x[1:5, [:green, :blue]])
2-dimensional JuMPArray{VariableRef,2,...} with index sets:
    Dimension 1, 1:5
    Dimension 2, Symbol[:green, :blue]
And data, a 5×2 Array{VariableRef,2}:
 x[1,green]  x[1,blue]
 x[2,green]  x[2,blue]
 x[3,green]  x[3,blue]
 x[4,green]  x[4,blue]
 x[5,green]  x[5,blue]

julia> set_lower_bound.(x[:,:blue], 0)
ERROR: ArgumentError: broadcasting requires an assigned BroadcastStyle
Stacktrace:
 [1] copy(::Base.Broadcast.Broadcasted{Base.Broadcast.Unknown,Tuple{UnitRange{Int64}},typeof(setlowerbound),Tuple{JuMPArray{VariableRef,1,Tuple{UnitRange{Int64}},Tuple{Dict{Int64,Int64}}},Int64}}) at ./broadcast.jl:735
 [2] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.Unknown,Nothing,typeof(setlowerbound),Tuple{JuMPArray{VariableRef,1,Tuple{UnitRange{Int64}},Tuple{Dict{Int64,Int64}}},Int64}}) at ./broadcast.jl:724
 [3] top-level scope at none:0

julia> set_lower_bound.(x, 0)
ERROR: ArgumentError: broadcasting requires an assigned BroadcastStyle
Stacktrace:
 [1] copy(::Base.Broadcast.Broadcasted{Base.Broadcast.Unknown,Tuple{UnitRange{Int64},Array{Symbol,1}},typeof(setlowerbound),Tuple{JuMPArray{VariableRef,2,Tuple{UnitRange{Int64},Array{Symbol,1}},Tuple{Dict{Int64,Int64},Dict{Symbol,Int64}}},Int64}}) at ./broadcast.jl:735
 [2] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.Unknown,Nothing,typeof(setlowerbound),Tuple{JuMPArray{VariableRef,2,Tuple{UnitRange{Int64},Array{Symbol,1}},Tuple{Dict{Int64,Int64},Dict{Symbol,Int64}}},Int64}}) at ./broadcast.jl:724
 [3] top-level scope at none:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants