diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-09-05 11:25:35 +0200 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-09-05 11:25:35 +0200 |
commit | 976eb617e3aacd8ed16a691516fa0f287a88f292 (patch) | |
tree | 4bb823005b356246a9c5f2c51b80ef815c4fba08 | |
parent | save offset of a parameter with its name (diff) | |
download | polymatrix-976eb617e3aacd8ed16a691516fa0f287a88f292.tar.gz polymatrix-976eb617e3aacd8ed16a691516fa0f287a88f292.zip |
update links in README
Diffstat (limited to '')
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | polymatrix/expressionstate/mixins/expressionstatemixin.py | 1 |
2 files changed, 7 insertions, 8 deletions
@@ -1,6 +1,6 @@ # Multivariate polynomial library -`polymatrix` is a library to represent and operate on multivariate polynomials. +`polymatrix` is a library to represent and operate on multivariate polynomial matrices. It is used to define Sum Of Squares optimization problems. @@ -16,11 +16,11 @@ Some aspects of the library: * [`polymatrix.v_stack`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py) * [`polymatrix.block_diag`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py). * polynomial expressions are manipulated using methods like - * [`diff`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py), - * [`reshape`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`substitute`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`sum`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`to_constant`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) + * [`diff`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py), + * [`reshape`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`substitute`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`sum`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`to_constant`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) * an expression is converted to matrix representation using [`polymatrix.to_matrix_repr`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py). To get the actual representation, the [`apply(state)`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/statemonad/mixins/statemonadmixin.py) method needs to be called. ## Example @@ -31,7 +31,7 @@ f_1(x_1, x_2) = x_1 + x_2 f_2(x_1, x_2) = x_1 + x_1 x_2 -Then, the two expression are combined using the [`__add__`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) (or equivalently `+` infix) method +Then, the two expression are combined using the [`__add__`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) (or equivalently `+` infix) method f_3(x_1, x_2) = f_1(x_1, x_2) + f_2(x_1, x_2) = 2 x_1 + x_2 + x_1 x_2 diff --git a/polymatrix/expressionstate/mixins/expressionstatemixin.py b/polymatrix/expressionstate/mixins/expressionstatemixin.py index 6268d4b..8a8405c 100644 --- a/polymatrix/expressionstate/mixins/expressionstatemixin.py +++ b/polymatrix/expressionstate/mixins/expressionstatemixin.py @@ -41,7 +41,6 @@ class ExpressionStateMixin( if start <= offset < end: return f'{str(variable)}_{offset-start}' - def get_key_from_offset(self, offset: int): for variable, (start, end) in self.offset_dict.items(): if start <= offset < end: |