Matrix Polynomial¶
- class fastmat.Polynomial¶
Bases:
Matrix
For given coefficients \(a_k,\dots,a_0 \in \mathbb{C}\) and a linear mapping \(A \in \mathbb{C}^{n \times n}\), we define
\[M = a_n A^n + a_{n-1} A^{n-1} + a_1 A + a_0 I.\]The transform \(M \cdot x\) can be calculated efficiently with Horner’s method.
>>> # import the package >>> import fastmat as fm >>> >>> # define the transforms >>> H = fm.Hadamard(n) >>> >>> # define the coefficient array >>> arr_a = [1, 2 + 1j, -3.0, 0.0] >>> >>> # define the polynomial >>> M = fm.Polynomial(H, arr_a)
Let \(H_n\) be the Hadamard matrix of order \(n\). And let \(a = (1, 2 + i, -3, 0) \in \mathbb{C}^{4}\) be a coefficient vector, then the polynomial is defined as
\[M = H_n^3 + (2+i) H_n^2 - 3 H_n.\]- __init__()¶
Initialize a Polynomial matrix instance.
- Parameters
- mat
fastmat.Matrix
A fastmat matrix instance subject to constructing the polynomial.
- coeff
numpy.ndarray
A 1d vector defining the polynomial coefficients.
- **optionsoptional
Additional keyworded arguments. Supports all optional arguments supported by
fastmat.Matrix
.
- mat
- coeff¶
Return the polynomial coefficient vector.
(read only)