-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
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
Feasibility checker with function #2526
Comments
We made it an struct FunctionalDict{F} <: AbstractDict
f::F
end
Base.getindex(f::FunctionalDict, key::VariableRef) = f.f(key)
FunctionalDict(x -> value(x)) Do we have a concrete use-case for this? I'm not in favor of adding complexity and multiple ways to do something before we really need to. |
Currently, we convert all function to JuMP before evaluating them. When we'll start looking at performance, we'll notice that we should directly evaluate them at the MOI level hence use: |
We already evaluate the functions using a function: JuMP.jl/src/feasibility_checker.jl Lines 60 to 69 in e4320ea
JuMP.jl/src/feasibility_checker.jl Line 108 in e4320ea
|
To summarize the developer call:
I would then propose that we close this issue for now and re-visit it in the future. |
Thinking more about this. I agree that if the user pass a function, he might expect that we memoize its results but we don't so that's an issue. In fact, this also applies to MOI functions. Even ScalarAffineFunction can have several terms with the same variable. |
The functional form of Lines 64 to 66 in 2b08a39
Lines 488 to 490 in 2b08a39
The So I don't think we need a consistent interface between |
In the
primal_feasibility_report
just introduced by #2466, we expect the primal value to be given by aDict
. In the future, we might rely onMOIU.eval_variables
to evaluate the function which requires a function mapping the variables to their values as arguments so we will have to create a lambda from theDict
. In view of this, we could also accept a function as argument to specify the value of the variables.To allow the syntax:
we should have the
point
as a first argument while it is currently the second argument.The text was updated successfully, but these errors were encountered: