diff options
author | Nao Pross <np@0hm.ch> | 2024-05-04 22:25:29 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-05-04 22:25:29 +0200 |
commit | 26127416ae20281ecbee3d693caaad2b8dfb14c2 (patch) | |
tree | 241ab897d7f879674a6d2a291e1b9d1e8b5c04e4 | |
parent | Remove abstractmethod decorator from PolyMatrix.get_poly (diff) | |
download | polymatrix-26127416ae20281ecbee3d693caaad2b8dfb14c2.tar.gz polymatrix-26127416ae20281ecbee3d693caaad2b8dfb14c2.zip |
Fix regression in ElemMultExpr
Caused by 5aa5d53c9375b6b0c98054351a4eb782497da330
-rw-r--r-- | polymatrix/expression/mixins/elemmultexprmixin.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/polymatrix/expression/mixins/elemmultexprmixin.py b/polymatrix/expression/mixins/elemmultexprmixin.py index f8121a8..330474b 100644 --- a/polymatrix/expression/mixins/elemmultexprmixin.py +++ b/polymatrix/expression/mixins/elemmultexprmixin.py @@ -11,6 +11,7 @@ from polymatrix.polymatrix.init import init_poly_matrix, init_broadcast_poly_mat from polymatrix.polymatrix.typing import MonomialIndex from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin from polymatrix.polymatrix.abc import PolyMatrix +from polymatrix.polymatrix.utils.mergemonomialindices import merge_monomial_indices class ElemMultExprMixin(ExpressionBaseMixin): @@ -62,14 +63,9 @@ class ElemMultExprMixin(ExpressionBaseMixin): # monomial = tuple(sorted(left_monomial + right_monomial)) - # TODO: This line broke since the introduction of index - # types, investigate why. Replacing it - # MonomialIndex.product fixes the issue - - # new_monomial = merge_monomial_indices( - # (left_monomial, right_monomial) - # ) - new_monomial = MonomialIndex.product(left_monomial, right_monomial) + new_monomial = merge_monomial_indices( + (left_monomial, right_monomial) + ) if new_monomial not in polynomial: polynomial[new_monomial] = 0 |