From d18fc94c090c32007d7af1adc633a96b1f87b605 Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Tue, 20 Feb 2024 09:59:23 +0100 Subject: division by float expression is multiplying instead of dividing --- polymatrix/expression/mixins/divisionexprmixin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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: -- cgit v1.2.1