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
Fix multiplication of constant-only LinearExpression (#568)
* Fix multiplication of constant-only LinearExpression
When multiplying a constant-only LinearExpression with another
expression, the code would fail with IndexError when trying to
access _term=0 on an empty term dimension.
The fix correctly returns a LinearExpression (not QuadraticExpression)
since multiplying by a constant preserves linearity.
* fix: add type casts for mypy
* fix: use cast instead of isinstance for runtime type check
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments