3 releases (stable)
1.1.0 | Jul 1, 2023 |
---|---|
1.0.0 | Jul 17, 2022 |
0.1.0 | Apr 11, 2022 |
#357 in Math
734 downloads per month
Used in automatica
175KB
4K
SLoC
Polynomen - Polynomial Library
Home page and software specification
Polynomial creation from coefficients or roots.
Polynomial evaluation with Horner method.
(Mutable) Indexing of polynomial coefficients.
Polynomials addition, subtraction and division.
Polynomials multiplication with convolution and fast fourier transform.
Polynomial and scalar addition, subtraction, multiplication and division.
Polynomial roots finding (real and complex).
Polynomial differentiation and integration.
Examples
#[macro_use] extern crate polynomen;
use polynomen::Poly;
let p1 = poly!(1, 2, 3);
let p2 = Poly::new_from_coeffs(&[1, 2, 3]);
assert_eq!(p1, p2);
Examples of library usage can be found in the examples/
folder.
lib.rs
:
Polynomials Library
Polynomial implementation
- builder from coefficients or roots
- degree
- extend by adding 0 coefficients to higher order terms
- transformation to monic form
- rounding to zero for small coefficients
- coefficient indexing
- zero and unit polynomials
- arithmetic operations between polynomials (addition, subtraction, multiplication, division, reminder, negation)
- arithmetic operations with floats (addition, subtraction, multiplication, division)
- multiplication using fast fourier transform
- polynomial exponentiation
- differentiation and integration
- polynomial evaluation
- evaluation of polynomial ratios that reduces overflows
- greatest common divisor between two polynomials
- polynomial norms (l1, l2, l∞)
- roots finding (real and complex) using eigenvalues of the companion matrix or iterative method
Dependencies
~1.5MB
~25K SLoC