diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-02-20 09:59:23 +0100 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-02-20 09:59:23 +0100 |
commit | d18fc94c090c32007d7af1adc633a96b1f87b605 (patch) | |
tree | 5a9f92072f11168e9dcd40a2ed320c0cf8282cdc | |
parent | add pyproject.toml, remove setup.py (diff) | |
download | polymatrix-d18fc94c090c32007d7af1adc633a96b1f87b605.tar.gz polymatrix-d18fc94c090c32007d7af1adc633a96b1f87b605.zip |
division by float expression is multiplying instead of dividing
Diffstat (limited to '')
-rw-r--r-- | polymatrix/expression/mixins/divisionexprmixin.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/polymatrix/expression/mixins/divisionexprmixin.py b/polymatrix/expression/mixins/divisionexprmixin.py index e236456..29f6d6d 100644 --- a/polymatrix/expression/mixins/divisionexprmixin.py +++ b/polymatrix/expression/mixins/divisionexprmixin.py @@ -51,7 +51,14 @@ class DivisionExprMixin(ExpressionBaseMixin): if len(right_poly) == 1 and tuple() in right_poly: right_inv = {(0, 0): {tuple(): 1/right_poly[tuple()]}} - return ElemMultExprMixin.elem_mult(state, left, right) + return ElemMultExprMixin.elem_mult( + state=state, + left=left, + right=init_poly_matrix( + terms=right_inv, + shape=(1, 1), + ) + ) # add an auxillary equation and, therefore, needs to be cached if self in state.cache: |