diff options
Diffstat (limited to 'polymatrix/expression/mixins/additionexprmixin.py')
-rw-r--r-- | polymatrix/expression/mixins/additionexprmixin.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/polymatrix/expression/mixins/additionexprmixin.py b/polymatrix/expression/mixins/additionexprmixin.py index e3580f0..0ba8a2e 100644 --- a/polymatrix/expression/mixins/additionexprmixin.py +++ b/polymatrix/expression/mixins/additionexprmixin.py @@ -10,6 +10,16 @@ from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin class AdditionExprMixin(ExpressionBaseMixin): + """ + Adds two polymatrices + + [[2*x1+x2], [x1**2]] + [[3*x2], [x1]] -> [[2*x1+4*x2], [x1+x1**2]]. + + If one summand is of size (1, 1), then perform broadcast: + + [[2*x1+x2], [x1**2]] + [[x1]] -> [[3*x1+x2], [x1+x1**2]]. + """ + @property @abc.abstractmethod def left(self) -> ExpressionBaseMixin: |