summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2024-02-20 09:59:23 +0100
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2024-02-20 09:59:23 +0100
commitd18fc94c090c32007d7af1adc633a96b1f87b605 (patch)
tree5a9f92072f11168e9dcd40a2ed320c0cf8282cdc
parentadd pyproject.toml, remove setup.py (diff)
downloadpolymatrix-d18fc94c090c32007d7af1adc633a96b1f87b605.tar.gz
polymatrix-d18fc94c090c32007d7af1adc633a96b1f87b605.zip
division by float expression is multiplying instead of dividing
-rw-r--r--polymatrix/expression/mixins/divisionexprmixin.py9
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: