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

Refactor matmul code with mul! #1995

Merged
merged 6 commits into from
Jun 23, 2019
Merged

Refactor matmul code with mul! #1995

merged 6 commits into from
Jun 23, 2019

Conversation

blegat
Copy link
Member

@blegat blegat commented Jun 20, 2019

The new implementation catches mul! calls for which the eltype of the result is a JuMP affine or quadratic expressions (resolving #1990).
This allows the generic codes using mul! to benefit from our specialized multiplication methods.
For SparseArrays, the situation is less ideal as some calls are redirected to mul! and some have custom implementation that do not work for JuMP as they start by promoting the arrays to the same eltype...
This PR redirects some of them so that all tests pass but more are needed (more tests and more redirections) but this is left for future work. I don't think there is any regression as we already had this issue: #1276

Closes #1990
Closes #1716

@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

Merging #1995 into master will increase coverage by 0.13%.
The diff coverage is 82.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1995      +/-   ##
==========================================
+ Coverage   88.86%   88.99%   +0.13%     
==========================================
  Files          33       33              
  Lines        4282     4306      +24     
==========================================
+ Hits         3805     3832      +27     
+ Misses        477      474       -3
Impacted Files Coverage Δ
src/quad_expr.jl 89.03% <0%> (-1.1%) ⬇️
src/aff_expr.jl 85.82% <66.66%> (-0.44%) ⬇️
src/operators.jl 86.36% <85.54%> (+3.03%) ⬆️
src/optimizer_interface.jl 80.39% <0%> (+3.46%) ⬆️

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 36dc086...6af7e98. Read the comment docs.

Copy link
Member

@mlubin mlubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test to cover #1990?

Does this close #1716?

src/operators.jl Outdated Show resolved Hide resolved
src/operators.jl Outdated Show resolved Hide resolved
src/operators.jl Outdated Show resolved Hide resolved
src/operators.jl Outdated Show resolved Hide resolved
Copy link
Member

@mlubin mlubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming tests pass.

@blegat blegat merged commit ebf9ff9 into master Jun 23, 2019
@odow odow deleted the bl/mul branch June 29, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cannot multiply array of polynomials and array of JuMP variables A[t]_mul_B[!] deprecated upstream
3 participants