lmlib.polynomial.poly.Poly#
- class lmlib.polynomial.poly.Poly(coef, expo)#
Bases:
lmlib.polynomial.poly._PolyBase
Univariate polyonimial in vector exponent notation: \(\alpha^\mathsf{T} x^q\)
Polynomial class for uni-variate polynomials in vector exponent notation, [Wildhaber2019], see Chapter 6.
Such a polynomial p(x) in x is defined as
\[\begin{split}p(x) &= \alpha^\mathsf{T}x^q = \begin{bmatrix}a_0& a_1& \cdots& a_{Q-1}\end{bmatrix} \begin{bmatrix}x^{q_0}\\ x^{q_1}\\ \vdots\\ x^{q_{Q-1}}\end{bmatrix}\\ &= a_0 x^{q_0} + a_1 x^{q_1}+ \dots + a_{Q-1} x^{q_{Q-1}} \ ,\end{split}\]with coefficient vector \(\alpha \in \mathbb{R}^Q\), exponent vector \(q \in \mathbb{Z}_{\geq 0}^Q\), and function variable \(x \in \mathbb{R}\).
- Parameters
coef (array_like, shape=(Q)) – Coefficient vector
expo (array_like, shape=(Q)) – Exponent vector
Examples
>>> import lmlib as lm >>> p = Poly([0, 0.2, 3], [0, 1, 2]) >>> print(p)
Methods
__init__
(coef, expo)Constructor method
eval
(variable)Evaluates the polynomial
Attributes
Number of elements in exponent vector \(Q\)
Coefficient vector \(\alpha\)
Coefficient vector (i.e., not factorized)
Factorized coefficient vectors
Exponent vector \(q\)
Exponent vectors
Number of dependent variables
- property coefs_fac#
Factorized coefficient vectors
- Type
ndarray, None
- eval(variable)#
Evaluates the polynomial
- Parameters
variable (array_like, scalar) – Dependent variables of a polynomial.
- Returns
out – Output of evaluated polynomial. Shape is identical as a dependent variable
- Return type