summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--polymatrix/expression/mixins/expressionmixin.py1
-rw-r--r--setup.py2
3 files changed, 8 insertions, 9 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
```
diff --git a/polymatrix/expression/mixins/expressionmixin.py b/polymatrix/expression/mixins/expressionmixin.py
index a5acff1..4afa44f 100644
--- a/polymatrix/expression/mixins/expressionmixin.py
+++ b/polymatrix/expression/mixins/expressionmixin.py
@@ -2,7 +2,6 @@ import abc
import dataclasses
import typing
import numpy as np
-from sympy import re
from polymatrix.expression.init.initadditionexpr import init_addition_expr
from polymatrix.expression.init.initcacheexpr import init_cache_expr
diff --git a/setup.py b/setup.py
index 3188bd3..5e09fe8 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
setup(
name='polymatrix',
version='0.0.1a1',
- install_requires=['dataclass-abc'],
+ install_requires=['dataclass-abc', 'numpy', 'scipy', 'sympy'],
description='A library to represent and manipulate multivariate polynomials',
long_description=long_description,
long_description_content_type='text/markdown',