Low-level functions for evaluating and manipulating polynomials.
Examples
The vector of coefficients for the polynomial f(x, y) = 3 x y + x^2 is
[0, 3, 0, 1, 0, 0].
With eval() we can evaluate this polynomial:
import nutils_poly
import numpy
coeffs = numpy.array([0, 3, 0, 1, 0, 0], dtype=float)
# array of three `x` and `y` pairs (last axis)
values = numpy.array([[1, 0], [1, 1], [2, 3]], dtype=float)
numpy.testing.assert_allclose(nutils_poly.eval(coeffs, values), [1, 4, 22])
PartialDerivPlan::apply() computes the coefficients for the partial
derivative of a polynomial to one of the variables. The partial derivative
of f to x, the first variable, is ∂_x f(x, y) = 3 y + 2 x
(coefficients: [3, 2, 0]):
import nutils_poly
import numpy
coeffs = numpy.array([0, 3, 0, 1, 0, 0], dtype=float)
pd = nutils_poly.PartialDerivPlan(
2, # number of variables
2, # degree
0, # variable to compute the partial derivative to
)
numpy.testing.assert_allclose(pd(coeffs), [3, 2, 0])
Further reading
This package is a Python interface for the Rust crate
nutils-poly using PyO3.
This package is part of the Nutils project.
Release files for nutils-poly 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nutils_poly-1.0.1.tar.gz | 15.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| nutils_poly-1.0.1-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| nutils_poly-1.0.1-cp38-abi3-win32.whl | CPython 3.8 | abi3 | Windows x86-32 | Details |
| nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_x86_64.whl | CPython 3.8 | abi3 | Linux musl 1.1+ x86-64 | Details |
| nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_aarch64.whl | CPython 3.8 | abi3 | Linux musl 1.1+ ARM64 | Details |
| nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| nutils_poly-1.0.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.8 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 | Details |
Total release size: 5.9 MB
Release files / nutils_poly-1.0.1.tar.gz
| Download URL | nutils_poly-1.0.1.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f30b6620e831e5820e01d30af9e30de50391b0026b7c54855c4be7b072bb6880
|
|
BLAKE2b-256 checksum How to use checksums |
1c9cae9aeb0aa1ef8fd7159fe522c2c2bf3609834d2e122ef14aae172b1ce375
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-win_amd64.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 213.5 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c5118f1df97856c1e462f0c3ab4f1e960447b88900ed2975918c7e67996f448a
|
|
BLAKE2b-256 checksum How to use checksums |
0554e01764cc588650387061e75f413ef156b2da2574bcc3e75b2cbec0c5cf33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-win32.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-win32.whl |
|---|---|
| Size | 202.5 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
b688de6b21d23d013061c3c20b638ef42a27467dcc9d211f9834b5e0a3d60d37
|
|
BLAKE2b-256 checksum How to use checksums |
0ef9f299233ca0685f13868ad0da1a642596119ca391def460bd344aa6028804
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_x86_64.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.8 Linux musl 1.1+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c9f43689335b2ef12048b0964725b31426e3f460532ad5df87e798567e0f99b2
|
|
BLAKE2b-256 checksum How to use checksums |
932a733600c5fb2d2cf4695223096158690a8af8d4bfaa971f6e0271e73af841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_aarch64.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-musllinux_1_1_aarch64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.8 Linux musl 1.1+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e8eef88742e8052a56b55811aa79c4858fcb2c001ea89c51d9c7db7d5b4427f2
|
|
BLAKE2b-256 checksum How to use checksums |
0d7946cb5d6c1b6b576241ab0192a760ca78eefa1aa9705829c241bb4889c1f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6630fc5d4373eaf888e9e09697545e4e4f182a728f27657cc5882956b06b5317
|
|
BLAKE2b-256 checksum How to use checksums |
dec6a9d27c6f8b7ea7c675cdb049e2b9f96844a1d091bfb355b011ca65679846
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
538c841d9ac53ee48bc32376fa905feac1742907b5c91303d29ff300081f6a32
|
|
BLAKE2b-256 checksum How to use checksums |
bb5f0439024d34727a5e1d48d66879c0f6d41679bd8c39111a7dd4fb59df7baa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / nutils_poly-1.0.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | nutils_poly-1.0.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 643.5 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
efe99a301e4eb637c36ad4be76c686080c24fce57eeaf9d3789ff92d14cb6550
|
|
BLAKE2b-256 checksum How to use checksums |
74ecc2a4e6cb7b90bea678f9b33be6aaad72f610f894a60d0790b78d3e1eed33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|