&D d Z ddlZddlmZ ddlmZ ddlm Z ddlmZ g dZ e j Zd Zd Zd Zd Zd Zd Zd Zd Z ej ddg Z ej dg Z ej dg Z ej ddg Zd Zd Zd Zd Z d Z!d Z"d Z#d1dZ$d2dZ%dg dddfdZ&d3dZ'd Z(d Z)d Z*d! Z+d" Z,d# Z-d$ Z.d4d&Z/d' Z0d( Z1d5d*Z2d+ Z3d, Z4d- Z5d. Z6 G d/ d0e Z7dS )6a ==================================================== Chebyshev Series (:mod:`numpy.polynomial.chebyshev`) ==================================================== This module provides a number of objects (mostly functions) useful for dealing with Chebyshev series, including a `Chebyshev` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the docstring for its "parent" sub-package, `numpy.polynomial`). Classes ------- .. autosummary:: :toctree: generated/ Chebyshev Constants --------- .. autosummary:: :toctree: generated/ chebdomain chebzero chebone chebx Arithmetic ---------- .. autosummary:: :toctree: generated/ chebadd chebsub chebmulx chebmul chebdiv chebpow chebval chebval2d chebval3d chebgrid2d chebgrid3d Calculus -------- .. autosummary:: :toctree: generated/ chebder chebint Misc Functions -------------- .. autosummary:: :toctree: generated/ chebfromroots chebroots chebvander chebvander2d chebvander3d chebgauss chebweight chebcompanion chebfit chebpts1 chebpts2 chebtrim chebline cheb2poly poly2cheb chebinterpolate See also -------- `numpy.polynomial` Notes ----- The implementations of multiplication, division, integration, and differentiation use the algebraic identities [1]_: .. math:: T_n(x) = \frac{z^n + z^{-n}}{2} \\ z\frac{dx}{dz} = \frac{z - z^{-1}}{2}. where .. math:: x = \frac{z + z^{-1}}{2}. These identities allow a Chebyshev series to be expressed as a finite, symmetric Laurent series. In this module, this sort of Laurent series is referred to as a "z-series." References ---------- .. [1] A. T. Benjamin, et al., "Combinatorial Trigonometry with Chebyshev Polynomials," *Journal of Statistical Planning and Inference 14*, 2008 (https://web.archive.org/web/20080221202153/https://www.math.hmc.edu/~benjamin/papers/CombTrig.pdf, pg. 4) N)normalize_axis_index ) polyutils)ABCPolyBase)"chebzerochebonechebx chebdomaincheblinechebaddchebsubchebmulxchebmulchebdivchebpowchebvalchebderchebint cheb2poly poly2cheb chebfromroots chebvanderchebfitchebtrim chebrootschebpts1chebpts2 Chebyshev chebval2d chebval3d chebgrid2d chebgrid3dchebvander2dchebvander3d chebcompanion chebgauss chebweightchebinterpolatec | j }t j d|z dz | j }| dz ||dz d<