From 35f9253a0d19a523e1b10b25a149e3fb8d93c9c8 Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Thu, 4 Aug 2022 16:18:34 +0200 Subject: add 'install_requires' to setup.py, add missing link to README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 08e5c9a..b1bad09 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Some aspects of the library: * multiple polynomial expressions are combined using functions like * [`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 bounded functions like +* 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) @@ -27,13 +27,13 @@ Some aspects of the library: In this example, two polynomial expressions are defined using sympy expressions -$f_1(x_1, x_2) = x_1 + x_2$ +$\quad f_1(x_1, x_2) = x_1 + x_2$ -$f_2(x_1, x_2) = x_1 + x_1 x_2$ +$\quad f_2(x_1, x_2) = x_1 + x_1 x_2$ -Then, the two expression are combined using the `__add__` (or equivalently `+`) function +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 `+`) function -$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$ +$\quad 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$ Finally, different representations of the polynomial are printed. @@ -66,6 +66,6 @@ state, matrix_repr = polymatrix.to_matrix_repr((f3,), x).apply(state) # prints the numpy matrix representations of the polynomial matrix # array([[2., 1.]]) # array([[0. , 0.5, 0.5, 0. ]]) -print(matrix_repr.data[0][1]) -print(matrix_repr.data[0][2].toarray()) +print(matrix_repr.data[0][1]) # numpy array +print(matrix_repr.data[0][2].toarray()) # sparse scipy array ``` -- cgit v1.2.1