-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extracting solution of decision variables #128
Comments
Hi @binkob, have you checked the link below? |
@sshin23 ERROR: type Array has no field offset I get this error when after solving and I try to fetch variable x. I also run the jump.jl example and got the same error. I might be missing something. using ExaModels, JuMP, CUDA N = 10 @variable(jm, x[i = 1:N], start = mod(i, 2) == 1 ? -1.2 : 1.0) em = ExaModel(jm; backend = CUDABackend())em = ExaModel(jm) #; backend = nothing) Here, note that only scalar objective/constraints created via
|
If you are using JuMP interface and want to access the solution, you may use the following interface: using ExaModels, JuMP, CUDA
using MadNLPGPU
set_optimizer(jm, ExaModels.MadNLPOptimizer)
optimize!(jm) |
@sshin23
When solving the examodel, the result is set up in the form:
result = madnlp(em),
however, I could not find a way to extract the exact solution for a variable
I would like to know how specific variables can be extracted. I realized that using ".solution" gets the solution of all variables, but they are combined. For large scale, that can be a problem. I could not find it in the examples.
Ex: If I define variables p and q as decision variables, is there a way I can extract its solution only?
sol_p = value.(p) as used in JuMP.
Thanks
The text was updated successfully, but these errors were encountered: