Skip to content

Conversation

blegat
Copy link
Member

@blegat blegat commented Aug 14, 2025

Suggested by @AayushSabharwal. I am wondering whether that wouldn't be better compared to what we have.
The types for which that does not work are the types from JuMP, MOI and MultivariatePolynomials for which we already have custom methods (because the fallback would be allocating).
This also won't work for Matrix * Vector but the fallback with one also don't work there.
It also fixes the following but that @AayushSabharwal just reported to me:

julia> MA.promote_operation(+, Number, Number)
Int64

It would also reduce the number of weird errors reported by users of JuMP saying zero(::...) is not defined.

@AayushSabharwal
Copy link
Contributor

https://github.com/jump-dev/MutableArithmetics.jl/actions/runs/16967361630/job/48094753814?pr=334#step:6:139 seems like a strict improvement - fewer allocations. However, the failing JuMP test is not good. It might be a missing rule, but that means this PR would break JuMP.

@blegat blegat force-pushed the bl/simplify_promote_type_fallback branch from af514a6 to 0267f18 Compare August 14, 2025 15:24
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.

2 participants