summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polymatrix/expression/mixins/sumexprmixin.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/polymatrix/expression/mixins/sumexprmixin.py b/polymatrix/expression/mixins/sumexprmixin.py
index 83f9397..8e649d3 100644
--- a/polymatrix/expression/mixins/sumexprmixin.py
+++ b/polymatrix/expression/mixins/sumexprmixin.py
@@ -34,13 +34,14 @@ class SumExprMixin(ExpressionBaseMixin):
for row in range(underlying.shape[0]):
for col in range(underlying.shape[1]):
- polynomial = underlying.get_poly(row, col)
- if polynomial is None:
+ underlying_poly = underlying.get_poly(row, col)
+
+ if underlying_poly is None:
continue
polynomial = poly_matrix_data[row, 0]
- for monomial, value in polynomial.items():
+ for monomial, value in underlying_poly.items():
if monomial in polynomial:
polynomial[monomial] += value
else: