summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-08-04 16:18:34 +0200
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-08-04 16:18:34 +0200
commit35f9253a0d19a523e1b10b25a149e3fb8d93c9c8 (patch)
tree7a7bedaf1fd01781ce62be9e2273937477c210d0 /README.md
parentadd a description of the example given in README.md (diff)
downloadpolymatrix-35f9253a0d19a523e1b10b25a149e3fb8d93c9c8.tar.gz
polymatrix-35f9253a0d19a523e1b10b25a149e3fb8d93c9c8.zip
add 'install_requires' to setup.py, add missing link to README.md
Diffstat (limited to '')
-rw-r--r--README.md14
1 files changed, 7 insertions, 7 deletions
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
```