I'm running into errors using the normalized_coefficient function on variables that are of type DecisionRef or KnownRef.
If the decision variable isn't in the constraint, I'd prefer it to return 0 rather than throwing an error.
Of course I can do some filtering on the front end to avoid calling normalized_coefficient for constraints that aren't AffineDecisonFunctions, but for the sake of convenience/completeness, I wanted to check whether you would be open to a PR adding the following methods?
function JuMP._affine_coefficient(f::_VariableAffExpr{C}, decision::DecisionRef) where C
return zero(C)
end
function JuMP._affine_coefficient(f::_VariableAffExpr{C}, known::KnownRef) where C
return zero(C)
end
I'm running into errors using the
normalized_coefficient
function on variables that are of typeDecisionRef
orKnownRef
. If the decision variable isn't in the constraint, I'd prefer it to return 0 rather than throwing an error.Of course I can do some filtering on the front end to avoid calling
normalized_coefficient
for constraints that aren'tAffineDecisonFunction
s, but for the sake of convenience/completeness, I wanted to check whether you would be open to a PR adding the following methods?