diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-03-12 17:46:53 +0100 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-03-12 17:46:53 +0100 |
commit | e520902fd6f9991ffb75d8bc48f5f5ba144b91b3 (patch) | |
tree | 14e3eae5a10181845156e9b64deabbf5ff909521 /polymatrix/expression/mixins/additionexprmixin.py | |
parent | add integrate expression, improve variable naming (diff) | |
download | polymatrix-upstream.tar.gz polymatrix-upstream.zip |
add minimal documentation to the expression mixinsupstream
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: |