MCPcopy Index your code
hub / github.com/numpy/numpy / Chebyshev

Class Chebyshev

numpy/polynomial/chebyshev.py:1970–2053  ·  view source on GitHub ↗

A Chebyshev series class. The Chebyshev class provides the standard Python numerical methods '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the attributes and methods listed below. Parameters ---------- coef : array_like Chebyshev coefficients in orde

Source from the content-addressed store, hash-verified

1968#
1969
1970class Chebyshev(ABCPolyBase):
1971 """A Chebyshev series class.
1972
1973 The Chebyshev class provides the standard Python numerical methods
1974 '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
1975 attributes and methods listed below.
1976
1977 Parameters
1978 ----------
1979 coef : array_like
1980 Chebyshev coefficients in order of increasing degree, i.e.,
1981 ``(1, 2, 3)`` gives ``1*T_0(x) + 2*T_1(x) + 3*T_2(x)``.
1982 domain : (2,) array_like, optional
1983 Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
1984 to the interval ``[window[0], window[1]]`` by shifting and scaling.
1985 The default value is [-1., 1.].
1986 window : (2,) array_like, optional
1987 Window, see `domain` for its use. The default value is [-1., 1.].
1988 symbol : str, optional
1989 Symbol used to represent the independent variable in string
1990 representations of the polynomial expression, e.g. for printing.
1991 The symbol must be a valid Python identifier. Default value is 'x'.
1992
1993 .. versionadded:: 1.24
1994
1995 """
1996 # Virtual Functions
1997 _add = staticmethod(chebadd)
1998 _sub = staticmethod(chebsub)
1999 _mul = staticmethod(chebmul)
2000 _div = staticmethod(chebdiv)
2001 _pow = staticmethod(chebpow)
2002 _val = staticmethod(chebval)
2003 _int = staticmethod(chebint)
2004 _der = staticmethod(chebder)
2005 _fit = staticmethod(chebfit)
2006 _line = staticmethod(chebline)
2007 _roots = staticmethod(chebroots)
2008 _fromroots = staticmethod(chebfromroots)
2009
2010 @classmethod
2011 def interpolate(cls, func, deg, domain=None, args=()):
2012 """Interpolate a function at the Chebyshev points of the first kind.
2013
2014 Returns the series that interpolates `func` at the Chebyshev points of
2015 the first kind scaled and shifted to the `domain`. The resulting series
2016 tends to a minmax approximation of `func` when the function is
2017 continuous in the domain.
2018
2019 Parameters
2020 ----------
2021 func : function
2022 The function to be interpolated. It must be a function of a single
2023 variable of the form ``f(x, a, b, c...)``, where ``a, b, c...`` are
2024 extra arguments passed in the `args` parameter.
2025 deg : int
2026 Degree of the interpolating polynomial.
2027 domain : {None, [beg, end]}, optional

Callers 6

test_addFunction · 0.90
test_subFunction · 0.90
test_mulFunction · 0.90
test_floordivFunction · 0.90
test_modFunction · 0.90
test_divmodFunction · 0.90

Calls

no outgoing calls

Tested by 6

test_addFunction · 0.72
test_subFunction · 0.72
test_mulFunction · 0.72
test_floordivFunction · 0.72
test_modFunction · 0.72
test_divmodFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…