Polynomial class in python (w/ NumPy)
- user defined
- zeroed
Polynomials with specific coefficients. That means, that the number of coefficient is finite ($\exists {\epsilon>0}\forall{n>\epsilon\land n \in \N} ,,c_n=0$ but program doesn't store infinitely many zeroes. Array stops at last non-zero coefficient) and every coefficient has a value (known and saved in memory as a number).
Example being in a form of
$$
x^4+5x^3-3x+15
$$
and can be written as a product
$$
\begin{bmatrix}
15 \ -3 \ 0 \ 5 \ 1
\end{bmatrix}\cdot
\begin{bmatrix}
1 \ x \ x^2 \ x^3 \ x^4
\end{bmatrix}
$$
So the only information we need to store is a coefficients vector
For the ease of use, program stores coeffixients in reversed order. This has both antvantages and disadvantages, but reversing the vector is not something hard, so ok so what.
Polynomials with zeroed coefficients vector (
This solution for zeroed polynomial arythmetics is not the final one will be deprecated.
- approximates
- user-defined
- recursive
- inductive
- zeroed
- interpolation
- Lagrange interpolation
- solving polynomials
This is pretty big. So Lagrange came up with this genius idea of polynomial interpolation: $$ l_{n,i} = \prod_{j\neq i}\frac{x-x_j}{x_i-x_j} \ w = \sum_{i=0}^ny_il_{n,i}(x) $$
Idea behind it is pretty simple. It's a combination of root-finding algorithm with polynomial division. This problem is hard mainly from the numeric perspective.