Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Attributes canget too strict #87

Closed
tkoolen opened this issue Feb 9, 2018 · 3 comments
Closed

Attributes canget too strict #87

tkoolen opened this issue Feb 9, 2018 · 3 comments

Comments

@tkoolen
Copy link

tkoolen commented Feb 9, 2018

In

https://github.com/JuliaOpt/MathOptInterfaceUtilities.jl/blob/c5b5c4bcae650a141101fb1e16d459c84e582bb9/src/instancemanager.jl#L359-L364

typeof(index) is used for canget, even though a concrete index is available. That seems too strict. It may be the case that you can get an attribute for certain indices, but not all.

@mlubin
Copy link
Member

mlubin commented Feb 9, 2018

This was discussed at jump-dev/MathOptInterface.jl#191. Allowing the possibility for an attribute not to be available for a subset of indices forces inefficiencies in copy! (e.g., we can't query for all values at the same time). It also adds an extra level of state (and hence complexity) that I don't see a compelling need for.

@mlubin
Copy link
Member

mlubin commented Feb 9, 2018

Also using indices instead of types in the code block referenced above would mean that for the same attribute, the instancemanager could sometimes return the value from the solver and sometimes from the instance. That's just confusing.

@tkoolen
Copy link
Author

tkoolen commented Feb 9, 2018

Ah, my mistake. I thought there was also a canget method with ::VariableIndex argument, in addition to the ::Type{VariableIndex} version, but I must have misread the MOI docs. I mistakenly implemented the former instead of the latter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants