MultiCheb

MultiCheb Class

class yroots.polynomial.MultiCheb(coeff, clean_zeros=True)

Coefficient tensor representation of a Chebyshev basis polynomial.

Using this class instead of a Python callable function to represent a Chebyshev polynomial can lead to faster function evaluations during approximation.

Examples

To represent 4*T_2(x) + 1*T_3(x) (using Chebyshev polynomials of the first kind):

>>> f = yroots.MultiCheb([0,0,4,1])
>>> print(f)
[0. 0. 4. 1.]
Parameters:
  • coeff (list or numpy array) – An array containing the coefficients of the polynomial. If the polynomial is n-dimensional, the (i,j,…,n) index represents the term having T_i(x)*T_j(y)*….

  • clean_zeros (bool) – Whether or not to remove all extra rows or columns containing only zeros. Defaults to True.