We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
value
JuMP.value is not implemented correctly for parameter functions, currently it errors.
JuMP.value
using InfiniteOpt, Ipopt model = InfiniteModel(Ipopt.Optimizer) @infinite_parameter(model, s in [0, 1], num_supports = 4) @variable(model, y, Infinite(s)) my_func(s) = 42 @parameter_function(model, pfunc == my_func(s)) @objective(model, Min, integral((y - pfunc)^2, s)) optimize!(model) value(pfunc)
ERROR: MethodError: no method matching value(::Float64; result=1) Closest candidates are: value(::Number) at C:\Users\Joshua\.julia\packages\JuMP\zn6NT\src\variables.jl:1298 got unsupported keyword argument "result" value(::Any, ::Function) at C:\Users\Joshua\.julia\packages\JuMP\zn6NT\src\deprecate.jl:17 got unsupported keyword argument "result" value(::AbstractArray{<:AbstractJuMPScalar}) at C:\Users\Joshua\.julia\packages\JuMP\zn6NT\src\variables.jl:1290 got unsupported keyword argument "result" ... Stacktrace: [1] (::InfiniteOpt.var"#480#481"{Int64})(v::Float64) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:65 [2] iterate @ .\generator.jl:47 [inlined] [3] _collect @ .\array.jl:744 [inlined] [4] collect_similar(cont::Vector{Float64}, itr::Base.Generator{Vector{Float64}, InfiniteOpt.var"#480#481"{Int64}}) @ Base .\array.jl:653 [5] map(f::Function, A::Vector{Float64}) @ Base .\abstractarray.jl:2849 [6] map_value(vref::GeneralVariableRef, key::Val{:TransData}, result::Int64; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:65 [7] map_value(vref::GeneralVariableRef, key::Val{:TransData}, result::Int64) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:63 [8] _get_value(vref::GeneralVariableRef, index_type::Type, result::Int64; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:101 [9] _get_value(vref::GeneralVariableRef, index_type::Type, result::Int64) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:101 [10] value(vref::GeneralVariableRef; result::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:143 [11] value(vref::GeneralVariableRef) @ InfiniteOpt C:\Users\Joshua\Documents\InfiniteOpt.jl\src\results.jl:143 [12] top-level scope @ REPL[12]:1
However, transcription_variable works:
transcription_variable
julia> transcription_variable(pfunc) 4-element Vector{Float64}: 42.0 42.0 42.0 42.0
The text was updated successfully, but these errors were encountered:
This is resolved by ecc1ee2. I forgot to make a pull request :)
Sorry, something went wrong.
No branches or pull requests
JuMP.value
is not implemented correctly for parameter functions, currently it errors.However,
transcription_variable
works:The text was updated successfully, but these errors were encountered: