JuliaStochOpt / ParameterJuMP.jl

A JuMP extension to use parameter in constraints RHS
MIT License
41 stars 5 forks source link

Matrix x Vector of params #49

Closed blegat closed 5 years ago

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

julia> p = Parameter(model, 1)
noname_param

julia> zeros(1, 1) * [p]
ERROR: MethodError: no method matching one(::Type{Parameter})
Closest candidates are:
  one(::BitArray{2}) at bitarray.jl:393
  one(::Missing) at missing.jl:79
  one(::Type{ForwardDiff.Dual{T,V,N}}) where {T, V, N} at /home/blegat/.julia/packages/ForwardDiff/N0wMF/src/dual.jl:292
  ...
Stacktrace:
 [1] _A_mul_B_eltype(::Type{Float64}, ::Type{Parameter}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:341
 [2] _A_mul_B_ret(::Array{Float64,2}, ::Array{Parameter,1}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:348
 [3] _A_mul_B(::Array{Float64,2}, ::Array{Parameter,1}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:417
 [4] *(::Array{Float64,2}, ::Array{Parameter,1}) at /home/blegat/.julia/packages/JuMP/jnmGG/src/operators.jl:522
 [5] top-level scope at none:0