summaryrefslogtreecommitdiffstats
path: root/polymatrix/expression/mixins/additionexprmixin.py
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-04-08 08:51:19 +0200
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-04-08 08:51:19 +0200
commit19ab60ad70e7d8478609a47a2e937fef3720dac9 (patch)
tree8836fbae02718948a45a6bd2e4c3d1f55548c7c5 /polymatrix/expression/mixins/additionexprmixin.py
parentimplement polynomial matrix as an expression (diff)
downloadpolymatrix-19ab60ad70e7d8478609a47a2e937fef3720dac9.tar.gz
polymatrix-19ab60ad70e7d8478609a47a2e937fef3720dac9.zip
remove shape property, introduce accumulate function, reimplement derivative expression
Diffstat (limited to 'polymatrix/expression/mixins/additionexprmixin.py')
-rw-r--r--polymatrix/expression/mixins/additionexprmixin.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/polymatrix/expression/mixins/additionexprmixin.py b/polymatrix/expression/mixins/additionexprmixin.py
index 776e952..cab8161 100644
--- a/polymatrix/expression/mixins/additionexprmixin.py
+++ b/polymatrix/expression/mixins/additionexprmixin.py
@@ -20,10 +20,10 @@ class AddExprMixin(ExpressionBaseMixin):
def right(self) -> ExpressionBaseMixin:
...
- # overwrites abstract method of `ExpressionBaseMixin`
- @property
- def shape(self) -> tuple[int, int]:
- return self.left.shape
+ # # overwrites abstract method of `ExpressionBaseMixin`
+ # @property
+ # def shape(self) -> tuple[int, int]:
+ # return self.left.shape
# overwrites abstract method of `ExpressionBaseMixin`
def apply(
@@ -39,8 +39,8 @@ class AddExprMixin(ExpressionBaseMixin):
for underlying in (left, right):
- for row in range(self.shape[0]):
- for col in range(self.shape[1]):
+ for row in range(left.shape[0]):
+ for col in range(left.shape[1]):
if (row, col) in terms:
terms_row_col = terms[row, col]
@@ -64,7 +64,7 @@ class AddExprMixin(ExpressionBaseMixin):
poly_matrix = init_poly_matrix(
terms=terms,
- shape=self.shape,
+ shape=left.shape,
)
return state, poly_matrix