File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1758,10 +1758,10 @@ function MOI.get(
17581758end
17591759
17601760function _get_variable_if_equivalent (b, x)
1761- return _get_variable_if_equivalent (bridged_variable_function (b, x))
1761+ return _get_variable_if_equivalent (bridged_variable_function (b, x), x )
17621762end
17631763
1764- function _get_variable_if_equivalent (f:: MOI.ScalarAffineFunction )
1764+ function _get_variable_if_equivalent (f:: MOI.ScalarAffineFunction , x )
17651765 if length (f. terms) == 1
17661766 term = only (f. terms)
17671767 if isone (term. coefficient)
@@ -1858,6 +1858,9 @@ function MOI.get(
18581858 end
18591859 vi_bridged = get (b. name_to_var, name, nothing )
18601860 MOI. Utilities. throw_if_multiple_with_name (vi_bridged, name)
1861+ if _get_variable_if_equivalent (b, vi_bridged) != = nothing
1862+ return vi_bridged
1863+ end
18611864 return MOI. Utilities. check_type_and_multiple_names (
18621865 MOI. VariableIndex,
18631866 vi_bridged,
You can’t perform that action at this time.
0 commit comments