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
I am trying to obtain the status of variables in the basis solution. The issue covered this topic with a previous version of this package. But, it seems that the proposed solution doesn't work for the current package version, so, I took the time to try to write my own function for this, but I am struggling in the step for retrieving the corresponding variables mapping.
For instance, let's consider the following use case.
model =direct_model(CPLEX.Optimizer())
@variable(model, y[["a", "b"]])
# constraintsoptimize!(model)
c_basis, r_basis =get_basis(model)
# c_basis["a"] = CPX_AT_LOWER 0 variable y["a"] at lower bound# CPX_BASIC 1 variable y["a"] is basic# CPX_AT_UPPER 2 variable y["a"] at upper bound# CPX_FREE_SUPER 3 variable y["a"] free and nonbasic
A "partial snippet" is given below.
functionget_basis(model::Model)
cval =Vector{Cint}(num_variables(model))
rval =Vector{Cint}(num_constraints(model))
ret =CPXgetbase(model.moi_backend.env, model.moi_backend.lp, cval, rval)
ret !=0&&throw(PROPEREXCEPTION(model.moi_backend.env, ret))
# ...end
I would like to know how I could complete the above function.
Thanks and regards.
The text was updated successfully, but these errors were encountered:
Hello.
I am trying to obtain the status of variables in the basis solution. The issue covered this topic with a previous version of this package. But, it seems that the proposed solution doesn't work for the current package version, so, I took the time to try to write my own function for this, but I am struggling in the step for retrieving the corresponding variables mapping.
For instance, let's consider the following use case.
A "partial snippet" is given below.
I would like to know how I could complete the above function.
Thanks and regards.
The text was updated successfully, but these errors were encountered: