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 noticed two parts of my worflows that could be improved in Xpress.jl
The first one is that the implemetation of reducedcost in JuMP is the following
functionreduced_cost(x::VariableRef)::Float64
model =owner_model(x)
if!has_duals(model)
error(
"Unable to query reduced cost of variable because model does"*" not have duals available.",
)
end
sign =objective_sense(model) == MIN_SENSE ?1.0:-1.0ifis_fixed(x)
return sign *dual(FixRef(x))
end
rc =0.0ifhas_upper_bound(x)
rc +=dual(UpperBoundRef(x))
endifhas_lower_bound(x)
rc +=dual(LowerBoundRef(x))
endreturn sign * rc
end
but when we do getlpsol Xpress could return all of the reduced cost and we could cache them directly and only query them through MOI
The second one is that whenever we have to change the bound of a variable in Xpress.jl we have this implementation
function MOI.set(
model::Optimizer,
::MOI.ConstraintSet,
c::MOI.ConstraintIndex{MOI.VariableIndex, S}, s::S
) where {S<:SCALAR_SETS}
MOI.throw_if_not_valid(model, c)
lower, upper =_bounds(s)
info =_info(model, c)
if lower == upper
if lower !==nothing_set_variable_fixed_bound(model, info, lower)
endelseif lower !==nothing_set_variable_lower_bound(model, info, lower)
endif upper !==nothing_set_variable_upper_bound(model, info, upper)
endend
info.previous_lower_bound =_get_variable_lower_bound(model, info)
info.previous_upper_bound =_get_variable_upper_bound(model, info)
returnend
but the functions _get_variable_... we have to run XPRSgetub or XPRSgetlb, could we simply store the current bound on the VariableInfo?
The text was updated successfully, but these errors were encountered:
I noticed two parts of my worflows that could be improved in Xpress.jl
The first one is that the implemetation of
reducedcost
in JuMP is the followingbut when we do getlpsol Xpress could return all of the reduced cost and we could cache them directly and only query them through MOI
The second one is that whenever we have to change the bound of a variable in Xpress.jl we have this implementation
but the functions
_get_variable_...
we have to run XPRSgetub or XPRSgetlb, could we simply store the current bound on the VariableInfo?The text was updated successfully, but these errors were encountered: