You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using JuMP
julia>using DynamicPolynomials
julia>@polyvar x
(x,)
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, a)
a
julia> (a .*ones(2, 2)) * (x .*ones(2, 2))
ERROR: MethodError: no method matching _A_mul_B!(::Array{Polynomial{true,GenericAffExpr{Float64,VariableRef}},2}, ::Array{GenericAffExpr{Float64,VariableRef},2}, ::Array{Term{true,Float64},2})
Closest candidates are:_A_mul_B!(::AbstractArray{T<:Union{AbstractJuMPScalar, NonlinearExpression},N}where N, ::Any, ::Any) where T<:Union{AbstractJuMPScalar, NonlinearExpression} at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:371_A_mul_B!(::AbstractArray{#s1040,N}where N where#s1040<:Union{GenericAffExpr, GenericQuadExpr}, ::SparseArrays.SparseMatrixCSC, ::Any) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:382_A_mul_B!(::AbstractArray{#s1040,N}where N where#s1040<:Union{GenericAffExpr, GenericQuadExpr}, ::AbstractArray{T,2} where T, ::SparseArrays.SparseMatrixCSC) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:395
Stacktrace:
[1] _A_mul_B(::Array{GenericAffExpr{Float64,VariableRef},2}, ::Array{Term{true,Float64},2}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:418
[2] *(::Array{GenericAffExpr{Float64,VariableRef},2}, ::Array{Term{true,Float64},2}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:512
[3] top-level scope at none:0
This would probably be resolved if we used Base.mul! instead of a custom _A_mul_B so that the fallback could be used in cased the result type is not a JuMP scalar function.
The text was updated successfully, but these errors were encountered:
This would probably be resolved if we used
Base.mul!
instead of a custom_A_mul_B
so that the fallback could be used in cased the result type is not a JuMP scalar function.The text was updated successfully, but these errors were encountered: