Python binding to the Donuts wrapper for the Rings library by Stanislav Poslavsky.
- Python 3.7 or later
- Java 8 or later
pip install donuts-python
>>> from donuts import * >>> a = Polynomial('1 + x + y') >>> b = Polynomial('1 + y + z') >>> g = a + b >>> g Polynomial('2+z+2*y+x') >>> ag = a * g >>> bg = b * g >>> ag.gcd(bg) # must be equal to g Polynomial('2+z+2*y+x') >>> ag / bg # same as RationalFunction(ag, bg) RationalFunction('(1+y+x)/(1+z+y)') >>> Polynomial('2*x^2 - 2*x^3 + 2*x^2*y - 2*x^3*y').factors (Polynomial('-2'), Polynomial('x'), Polynomial('x'), Polynomial('-1+x'), Polynomial('1+y'))
git submodule update --init poetry install poetry run invoke prepare poetry run invoke build poetry run invoke fmt poetry run invoke lint poetry run invoke test poetry run invoke bench poetry run invoke doc DONUTS_PYTHON_BACKEND=pyjnius poetry run invoke test DONUTS_PYTHON_BACKEND=py4j poetry run invoke test DONUTS_PYTHON_BACKEND=jpype poetry run invoke test poetry run invoke build --sdist --wheel
This software was developed as part of the project supported by JSPS KAKENHI Grant Number 19K03831.
Donuts-Python is distributed under the MIT license.
The wheel contains a fat JAR file generated from the following dependencies:
- Donuts (MIT)
- Rings (Apache 2.0)
- libdivide4j (Apache 2.0)
- Combinatorics for Java (Apache 2.0)
- Apache Commons Math (Apache 2.0)
- GNU Trove (LGPL 2.1)