MCPcopy Create free account
hub / github.com/numpy/numpy / chebadd

Function chebadd

numpy/polynomial/chebyshev.py:569–608  ·  view source on GitHub ↗

Add one Chebyshev series to another. Returns the sum of two Chebyshev series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 :

(c1, c2)

Source from the content-addressed store, hash-verified

567
568
569def chebadd(c1, c2):
570 """
571 Add one Chebyshev series to another.
572
573 Returns the sum of two Chebyshev series `c1` + `c2`. The arguments
574 are sequences of coefficients ordered from lowest order term to
575 highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``.
576
577 Parameters
578 ----------
579 c1, c2 : array_like
580 1-D arrays of Chebyshev series coefficients ordered from low to
581 high.
582
583 Returns
584 -------
585 out : ndarray
586 Array representing the Chebyshev series of their sum.
587
588 See Also
589 --------
590 chebsub, chebmulx, chebmul, chebdiv, chebpow
591
592 Notes
593 -----
594 Unlike multiplication, division, etc., the sum of two Chebyshev series
595 is a Chebyshev series (without having to "reproject" the result onto
596 the basis set) so addition, just like that of "standard" polynomials,
597 is simply "component-wise."
598
599 Examples
600 --------
601 >>> from numpy.polynomial import chebyshev as C
602 >>> c1 = (1,2,3)
603 >>> c2 = (3,2,1)
604 >>> C.chebadd(c1,c2)
605 array([4., 4., 4.])
606
607 """
608 return pu._add(c1, c2)
609
610
611def chebsub(c1, c2):

Callers 1

poly2chebFunction · 0.85

Calls 1

_addMethod · 0.80

Tested by

no test coverage detected