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

Support broadcasting over multiple DenseAxisArrays #2533

Merged
merged 4 commits into from
Apr 5, 2021
Merged

Conversation

odow
Copy link
Member

@odow odow commented Mar 23, 2021

Closes #2267

Here's the proof:

julia> using JuMP

julia> S = [:a, :b]
2-element Array{Symbol,1}:
 :a
 :b

julia> model = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> @variable(model, x[S], start = 0.0)
1-dimensional DenseAxisArray{VariableRef,1,...} with index sets:
    Dimension 1, [:a, :b]
And data, a 2-element Array{VariableRef,1}:
 x[a]
 x[b]

julia> start_value.(x)
1-dimensional DenseAxisArray{Float64,1,...} with index sets:
    Dimension 1, [:a, :b]
And data, a 2-element Array{Float64,1}:
 0.0
 0.0

julia> set_start_value.(x, start_value.(x) .+ 1);

julia> start_value.(x)
1-dimensional DenseAxisArray{Float64,1,...} with index sets:
    Dimension 1, [:a, :b]
And data, a 2-element Array{Float64,1}:
 1.0
 1.0

@odow
Copy link
Member Author

odow commented Mar 23, 2021

It looks like the error check was added a long time ago, and we never revisited the assumption: #1397

@odow odow added the Category: Containers Related to the Containers submodule label Mar 23, 2021
@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #2533 (1b56b46) into master (54c3c2c) will increase coverage by 0.18%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2533      +/-   ##
==========================================
+ Coverage   92.94%   93.13%   +0.18%     
==========================================
  Files          44       44              
  Lines        5457     5476      +19     
==========================================
+ Hits         5072     5100      +28     
+ Misses        385      376       -9     
Impacted Files Coverage Δ
src/Containers/DenseAxisArray.jl 88.33% <94.73%> (+1.18%) ⬆️
src/parse_nlp.jl 95.50% <0.00%> (+4.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54c3c2c...1b56b46. Read the comment docs.

@odow odow merged commit f1d41eb into master Apr 5, 2021
@odow odow deleted the od/broadcast branch April 5, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Containers Related to the Containers submodule Status: Needs review
Development

Successfully merging this pull request may close these issues.

Broadcasting over multiple DenseAxisArrays
2 participants