@@ -372,33 +372,30 @@ for f_A in _MatrixLike, f_B in vcat(_MatrixLike, T -> StridedVector{<:T})
372372 end
373373end
374374
375- # See https://github.com/JuliaLang/julia/pull/37898
376- # The default fallback only used `promote_type` so it may get its wrong, e.g.,
377- # for JuMP and MultivariatePolynomials.
378- if VERSION >= v " 1.7.0-DEV.1284"
379- using LinearAlgebra: StridedMaybeAdjOrTransMat
380- _mat_mat_scalar (A, B, γ) = operate!! (* , operate (* , A, B), γ)
381- function LinearAlgebra. mat_mat_scalar (
382- A:: StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
383- B:: StridedMaybeAdjOrTransMat ,
384- γ,
385- )
386- return _mat_mat_scalar (A, B, γ)
387- end
388- function LinearAlgebra. mat_mat_scalar (
389- A:: StridedMaybeAdjOrTransMat ,
390- B:: StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
391- γ,
392- )
393- return _mat_mat_scalar (A, B, γ)
394- end
395- function LinearAlgebra. mat_mat_scalar (
396- A:: StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
397- B:: StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
398- γ,
399- )
400- return _mat_mat_scalar (A, B, γ)
401- end
375+ _mat_mat_scalar (A, B, γ) = operate!! (* , operate (* , A, B), γ)
376+
377+ function LinearAlgebra. mat_mat_scalar (
378+ A:: LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
379+ B:: LinearAlgebra.StridedMaybeAdjOrTransMat ,
380+ γ,
381+ )
382+ return _mat_mat_scalar (A, B, γ)
383+ end
384+
385+ function LinearAlgebra. mat_mat_scalar (
386+ A:: LinearAlgebra.StridedMaybeAdjOrTransMat ,
387+ B:: LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
388+ γ,
389+ )
390+ return _mat_mat_scalar (A, B, γ)
391+ end
392+
393+ function LinearAlgebra. mat_mat_scalar (
394+ A:: LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
395+ B:: LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable} ,
396+ γ,
397+ )
398+ return _mat_mat_scalar (A, B, γ)
402399end
403400
404401# Base doesn't define efficient fallbacks for sparse array arithmetic involving
614611# the type by default.
615612Base. zero (x:: AbstractMutable ) = zero (typeof (x))
616613
617- # This was fixed in https://github.com/JuliaLang/julia/pull/36194 but then
618- # reverted. Fixed again in https://github.com/JuliaLang/julia/pull/38789/.
619- if VERSION >= v " 1.7.0-DEV.872"
620- # `AbstractMutable` objects are more likely to implement `iszero` than `==`
621- # with `Int`.
622- LinearAlgebra. iszerodefined (:: Type{<:AbstractMutable} ) = true
623- else
624- # To determine whether the funtion is zero preserving, `LinearAlgebra` calls
625- # `zero` on the `eltype` of the broadcasted object and then check `_iszero`.
626- # `_iszero(x)` redirects to `iszero(x)` for numbers and to `x == 0`
627- # otherwise.
628- # `x == 0` returns false for types that implement `iszero` but not `==` such
629- # as `DummyBigInt` and MOI functions.
630- LinearAlgebra. _iszero (x:: AbstractMutable ) = iszero (x)
631- end
614+ # `AbstractMutable` objects are more likely to implement `iszero` than `==`
615+ # with `Int`.
616+ LinearAlgebra. iszerodefined (:: Type{<:AbstractMutable} ) = true
0 commit comments