Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_polybase.cpython-313.pyc608 linesDownload Raw Back to __pycache__
1�

2z�je���p�SrSSKrSSKrSSKrSSKJr SSKrSSKJ	r3 S/r"SS\R5r
g)a4Abstract base class for the various polynomial Classes.5 6The ABCPolyBase class provides the methods needed to implement the common API7for the various polynomial classes. It operates as a mixin, but uses the8abc module from the stdlib, hence it is only available for Python >= 2.6.9 10�N)�Callable�)�	polyutils�ABCPolyBasec
�t�\rSrSrSrSrSrSr\RSSSSS	S11SSS
SS.125r13\RSSSSSSSSSSS.145r\RS:X+r\S5r\\R$S55r\\R$S55r\\R$S55r\\R$S55r\\R$S 55r\\R$S!55r\\R$S"55r\\R$SiS#j55r\\R$S$55r\\R$S%55r\\R$S&55r\\R$S'55r\\R$S(55r \\R$S)55r!\\R$S*55r"S+r#S,r$S-r%S.r&S/r'SjS1jr(S2r)S3r*S4r+S5r,\-S65r.\-S75r/\-S85r0\SkS9j5r1S:\2S;\3S<\34S=jr4S>r5S?r6S@r7SAr8SBr9SCr:SDr;SEr<SFr=SGr>SHr?SIr@SJrASKrBSLrCSMrDSNrESOrFSPrGSQrHSRrISSrJSTrKSUrLSVrMSWrNSXrOSYrPSlSZjrQS[rRSmS\jrSS]rTS^/S4S_jrUSnS`jrVSarWSoSbjrX\-SpScj5rY\-/SS04Sdj5rZ\-SjSej5r[\-SjSfj5r\\-SqSgj5r]Shr^g)rr�aFAn abstract base class for immutable series classes.15 16ABCPolyBase provides the standard Python numerical methods17'+', '-', '*', '//', '%', 'divmod', '**', and '()' along with the18methods listed below.19 20Parameters21----------22coef : array_like23    Series coefficients in order of increasing degree, i.e.,24    ``(1, 2, 3)`` gives ``1*P_0(x) + 2*P_1(x) + 3*P_2(x)``, where25    ``P_i`` is the basis polynomials of degree ``i``.26domain : (2,) array_like, optional27    Domain to use. The interval ``[domain[0], domain[1]]`` is mapped28    to the interval ``[window[0], window[1]]`` by shifting and scaling.29    The default value is the derived class domain.30window : (2,) array_like, optional31    Window, see domain for its use. The default value is the32    derived class window.33symbol : str, optional34    Symbol used to represent the independent variable in string35    representations of the polynomial expression, e.g. for printing.36    The symbol must be a valid Python identifier. Default value is 'x'.37 38    .. versionadded:: 1.2439 40Attributes41----------42coef : (N,) ndarray43    Series coefficients in order of increasing degree.44domain : (2,) ndarray45    Domain that is mapped to window.46window : (2,) ndarray47    Window that domain is mapped to.48symbol : str49    Symbol representing the independent variable.50 51Class Attributes52----------------53maxpower : int54    Maximum power allowed, i.e., the largest number ``n`` such that55    ``p(x)**n`` is allowed. This is to limit runaway polynomial size.56domain : (2,) ndarray57    Default domain of the class.58window : (2,) ndarray59    Default window of the class.60 61N�du⁰�¹�²�³u⁴u⁵u⁶u⁷u⁸u⁹)62�0�1�2�3�4�5�6�7�8�9u₀u₁u₂u₃u₄u₅u₆u₇u₈u₉�ntc��UR$�N)�_symbol��selfs �`D:\code\apps\devtools\python\user_packages\Python313\site-packages\numpy/polynomial/_polybase.py�symbol�ABCPolyBase.symbolns���|�|��c��gr�rs r�domain�ABCPolyBase.domainr���	
r c��grr"rs r�window�ABCPolyBase.windowwr%r c��grr"rs r�63basis_name�ABCPolyBase.basis_name|r%r c��grr"��c1�c2s  r�_add�ABCPolyBase._add�r%r c��grr"r-s  r�_sub�ABCPolyBase._sub�r%r c��grr"r-s  r�_mul�ABCPolyBase._mul�r%r c��grr"r-s  r�_div�ABCPolyBase._div�r%r c��grr")�c�pow�maxpowers   r�_pow�ABCPolyBase._pow�r%r c��grr")�xr<s  r�_val�ABCPolyBase._val�r%r c��grr")r<�m�k�lbnd�scls     r�_int�ABCPolyBase._int�r%r c��grr")r<rFrIs   r�_der�ABCPolyBase._der�r%r c��grr")rB�y�deg�rcond�fulls     r�_fit�ABCPolyBase._fit�r%r c��grr")�offrIs  r�_line�ABCPolyBase._line�r%r c��grr")r<s r�_roots�ABCPolyBase._roots�r%r c��grr")�rs r�64_fromroots�ABCPolyBase._fromroots�r%r c���[UR5[UR5:H=(a- [R"URUR:H5$)z�Check if coefficients match.65 66Parameters67----------68other : class instance69    The other class must have the ``coef`` attribute.70 71Returns72-------73bool : boolean74    True if the coefficients are the same, False otherwise.75 76)�len�coef�np�all�r�others  r�has_samecoef�ABCPolyBase.has_samecoef�s?��
��	�	�N�c�%�*�*�o�-�
0����t�y�y�E�J�J�.�/�	77r c�\�[R"URUR:H5$)z�Check if domains match.78 79Parameters80----------81other : class instance82    The other class must have the ``domain`` attribute.83 84Returns85-------86bool : boolean87    True if the domains are the same, False otherwise.88 89)rdrer#rfs  r�has_samedomain�ABCPolyBase.has_samedomain�� ���v�v�d�k�k�U�\�\�1�2�2r c�\�[R"URUR:H5$)z�Check if windows match.90 91Parameters92----------93other : class instance94    The other class must have the ``window`` attribute.95 96Returns97-------98bool : boolean99    True if the windows are the same, False otherwise.100 101)rdrer'rfs  r�has_samewindow�ABCPolyBase.has_samewindow�rmr c�,�[XR5$)z�Check if types match.102 103Parameters104----------105other : object106    Class instance.107 108Returns109-------110bool : boolean111    True if other is same class as self112 113)�114isinstance�	__class__rfs  r�has_sametype�ABCPolyBase.has_sametype�s���%���0�0r c���[U[5(a�[XR5(d[S5e[R115"URUR:H5(d[S5e[R116"URUR:H5(d[S5eURUR:wa[S5eUR$U$)a�Interpret other as polynomial coefficients.117 118The `other` argument is checked to see if it is of the same119class as self with identical domain and window. If so,120return its coefficients, otherwise return `other`.121 122Parameters123----------124other : anything125    Object to be checked.126 127Returns128-------129coef130    The coefficients of`other` if it is a compatible instance,131    of ABCPolyBase, otherwise `other`.132 133Raises134------135TypeError136    When `other` is an incompatible instance of ABCPolyBase.137 138zPolynomial types differzDomains differzWindows differzPolynomial symbols differ)rrrrs�	TypeErrorrdrer#r'r�139ValueErrorrcrfs  r�_get_coefficients�ABCPolyBase._get_coefficientss���0�e�[�)�)��e�^�^�4�4�� 9�:�:��V�V�D�K�K�5�<�<�7�8�8�� 0�1�1��V�V�D�K�K�5�<�<�7�8�8�� 0�1�1�������,� �!<�=�=��:�:���r rBc��[R"U/SS9unXlUb8[R"U/SS9un[U5S:wa[	S5eX lUb8[R"U/SS9un[U5S:wa[	S5eX0lUR5(d[	S5eX@l140g![a [S5ef=f)NF��trim�z$Domain has wrong number of elements.z$Window has wrong number of elements.z/Symbol string must be a valid Python identifierz!Symbol must be a non-empty string)�pu�	as_seriesrcrbrxr#r'�isidentifier�AttributeErrorrwr)rrcr#r'rs     r�__init__�ABCPolyBase.__init__$s������t�f�5�1����	����|�|�V�H�5�9�H�V��6�{�a�� �!G�H�H� �K����|�|�V�H�5�9�H�V��6�{�a�� �!G�H�H� �K�		A��&�&�(�(� �E���)�����	A��?�@�@�	A�s� B>�>Cc141���[UR5SSn[UR5SSn[UR5SSnURR142nUSUSUSUSURS3143$)N�������(z	, domain=z	, window=z144, symbol='z'))�reprrcr#r'rs�__name__r)rrcr#r'�names     r�__repr__�ABCPolyBase.__repr__Bs����D�I�I��q��$���d�k�k�"�1�R�(���d�k�k�"�1�R�(���~�~�&�&���&��$��y���	�&��B��;�;�-�r�+�	,r c���US:XaUR5$US;a[SUSURS35eUS:XaURUR5$URUR1455$)N�)�ascii�unicodezUnsupported format string 'z' passed to z4.__format__. Valid options are 'ascii' and 'unicode'r�)�__str__rxrs�_generate_string�_str_term_ascii�_str_term_unicode)r�fmt_strs  r�146__format__�ABCPolyBase.__format__Js����b�=��<�<�>�!��.�.��-�g�Y�l��>�>�"�#(�)��
�147�g���(�(��)=�)=�>�>��$�$�T�%;�%;�<�<r c��UR(aURUR5$URUR5$r)�_use_unicoder�r�r�rs rr��ABCPolyBase.__str__Ws9������(�(��)?�)?�@�@��$�$�T�%9�%9�:�:r c��[R"5RSS5nUS:aSn[R"UR148S5nUR
5upEUR[RXE5upgU(aSU-S-n[UR149SS5H�up�US-
n[US-5n150U	S:�aS	[R"U	S151S9-nOS[R"U	*S152S9-nX�"X�5-
n[URS
5S5[U5-nU[UR153SS5S-154:aUS-
nX�:�aURSS
S5nX;-
nM� U$![a S	U	3nN�f=f)zt155Generate the full string representation of the polynomial, using156``term_method`` to generate each polynomial term.157�	linewidth�Krrr��)N� z+ T��parensz- �158r�r~)rd�get_printoptions�getr�format_floatrc�mapparms�_format_term�	enumerate�strrwrb�split�replace)
r�term_methodr��outrW�scale�
scaled_symbol�needs_parens�irc�power�	next_term�line_lens
             rr��ABCPolyBase._generate_string\s����'�'�)�-�-�k�2�>�	��q�=��I��o�o�d�i�i��l�+���]�]�_�159��&*�&7�&7����8;�'D�#�
���-�/�#�5�M� ����1�2��/�G�A��3�J�C���A��J�E�160
(��1�9� $�r���t�D�'I� I�I� $�r����u�T�'J� J�I�
��U�:�:�I��3�9�9�T�?�2�.�/�#�i�.�@�H��3�t�y�y���}�%��)�)��A�
���$�%�-�-�c�4��;�	���C�30�4�161���
(� ���K�	�
(�s�E7�$E7�7F	�F	c��URc[S5eSURURUR5SUS3$)zk162String representation of single polynomial term using unicode163characters for superscripts and subscripts.164zZSubclasses must define either a basis_name, or override _str_term_unicode(cls, i, arg_str)�·r�r�)r*�NotImplementedError�	translate�_subscript_mapping��clsr��arg_strs   rr��ABCPolyBase._str_term_unicode�sU���>�>�!�%�5��
��S�^�^�$�Q�[�[��1G�1G�%H�$I��G�9�A��	 r c�^�URc[S5eSURSUSUS3$)zz165String representation of a single polynomial term using ** and _ to166represent superscripts and subscripts, respectively.167zXSubclasses must define either a basis_name, or override _str_term_ascii(cls, i, arg_str)r��_r�r��r*r�r�s   rr��ABCPolyBase._str_term_ascii�sB���>�>�!�%�3��
��3�>�>�"�!�A�3�a��y��2�2r c�^�URc[S5eSURSUSUS3$)NzbSubclasses must define either a basis name, or override _repr_latex_term(i, arg_str, needs_parens)�{z}_{z}(r�r�)r�r�r�r�s    r�_repr_latex_term�ABCPolyBase._repr_latex_term�s@���>�>�!�%�=�>�
>��C�N�N�#�5���3�w�i�q�9�9r c�2�S[R"XS9S3$)Nz\text{r��})rr�)rBr�s  r�_repr_latex_scalar�ABCPolyBase._repr_latex_scalar�s���"�/�/�!�;�<�B�?�?r �
scalar_formatrWr�c�168�US:XaUS:XaURnSnXE4$US:XaU"U5SUR3nSnXE4$US:XaU"U5UR3nSnXE4$U"U5SU"U5UR3nSnXE4$)z&Format a single term in the expansion rrF� + T)r)rr�rWr��termr�s      rr��ABCPolyBase._format_term�s����!�8���169��;�;�D� �L��!�!��a�Z�#�C�(�)��T�[�[�M�:�D��L��!�!��A�X�#�E�*�+�D�K�K�=�9�D��L��!�!�	!��%�&�c� ��'�(����
�7�
� �L��!�!r c��UR5upURURX5up4SRn/n[	UR1705H�upxUS:XaURU5n	Oc[
U[R5(dSURU5S3n	O.US:�aSURUSS93n	OSURU*SS93n	URXsU5n171U172S	:XaU	nOU	S173U1743nUS:XaU"U5nURU5 M� U(aSRU5nOSnS
URSUS
3$)Nz\color{{LightGray}}{{{}}}rz + (r�r�Tr�z - rz\,r�r
�$z	 \mapsto )
r�r�r��formatr�rcrr�numbers�Realr��append�joinr)
rrWr�r�r��mute�partsr�r<�coef_str�term_str�part�bodys
             r�_repr_latex_�ABCPolyBase._repr_latex_�sZ���]�]�_�175��!�.�.�t�/F�/F�/2�;���,�2�2�����d�i�i�(�D�A��A�v�"�5�5�a�8�9����7�<�<�0�0�!�$�"9�"9�!�"<�!=�Q�?���a�� ��!8�!8��4�!8�!H� I�J�� ��!8�!8�!��D�!8�!I� J�K���,�,�Q�l�C�H��3����#�*�B�x�j�1���A�v��D�z���L�L���+)�.��7�7�5�>�D��D��D�K�K�=�	�$��q�1�1r c��URR5nURR5US'URR5US'URR5US'UR176US'U$)Nrcr#r'r)�__dict__�copyrcr#r'r)r�rets  r�__getstate__�ABCPolyBase.__getstate__�sf���m�m� � �"���i�i�n�n�&��F�����(�(�*��H�
����(�(�*��H�
�����H�
��177r c��Xlgr)r�)r�dicts  r�__setstate__�ABCPolyBase.__setstate__�s���
r c��[R"XRUR5nUR	XR1785$r)r�	mapdomainr#r'rCrc)r�args  r�__call__�ABCPolyBase.__call__�s-���l�l�3���T�[�[�9���y�y��i�i�(�(r c�,�[UR5$r)�iterrcrs r�__iter__�ABCPolyBase.__iter__s���D�I�I��r c�,�[UR5$r)rbrcrs r�__len__�ABCPolyBase.__len__s���4�9�9�~�r c�|�URUR*URURUR5$r�rsrcr#r'rrs r�__neg__�ABCPolyBase.__neg__179s.���~�~�
�Y�Y�J����T�[�[�$�+�+�180�	181r c��U$rr"rs r�__pos__�ABCPolyBase.__pos__s���r c���URU5nURURU5nURX0RURUR5$![a	 [s$f=fr)	ryr0rc�	Exception�NotImplementedrsr#r'r�rrg�	othercoefrcs    r�__add__�ABCPolyBase.__add__�c���*�*�5�1�	�	"��9�9�T�Y�Y�	�2�D��~�~�d�K�K����d�k�k�J�J���	"�!�!�	"���A � A3�2A3c���URU5nURURU5nURX0RURUR5$![a	 [s$f=fr)	ryr3rcr�r�rsr#r'rrs    r�__sub__�ABCPolyBase.__sub__rrc���URU5nURURU5nURX0RURUR5$![a	 [s$f=fr)	ryr6rcr�r�rsr#r'rrs    r�__mul__�ABCPolyBase.__mul__"rrc���[U[R5(a[U[5(a$[	S[U5S[U5S35eUR
U5$)Nz&unsupported types for true division: 'z', '�')rrr��Number�boolrw�type�__floordiv__rfs  r�__truediv__�ABCPolyBase.__truediv__*s`���%����0�0�J�u�d�4K�4K�����J�<�t�D��K�=��3��
�� � ��'�'r c�D�URU5nU[LaU$US$�Nr��182__divmod__r��rrg�ress   rr�ABCPolyBase.__floordiv__5�&���o�o�e�$���.� ��J��1�v�
r c�D�URU5nU[LaU$US$�Nrrrs   r�__mod__�ABCPolyBase.__mod__;rr c�l�URU5nURURU5up4UR
X0RURUR5nUR
X@RURUR5nX44$![a e[a	 [183s$f=fr)184ryr9rc�ZeroDivisionErrorr�r�rsr#r'r)rrgr�quo�rems     rr�ABCPolyBase.__divmod__As����*�*�5�1�	�	"��y�y����I�6�H�C�185�n�n�S�+�+�t�{�{�D�K�K�H���n�n�S�+�+�t�{�{�D�K�K�H���x���
!�	���	"�!�!�	"�s�B�B3�2B3c��URURXRS9nURX RUR186UR5nU$)N)r>)r?rcr>rsr#r'r)rrgrcrs    r�__pow__�ABCPolyBase.__pow__Ms?���y�y����E�M�M�y�B���n�n�T�;�;����T�[�[�I���187r c���URXR5nUR	X R188URUR5$![a	 [s$f=fr)r0rcr�r�rsr#r'r�rrgrcs   r�__radd__�ABCPolyBase.__radd__R�Q��	"��9�9�U�I�I�.�D��~�~�d�K�K����d�k�k�J�J���	"�!�!�	"���A�A!� A!c���URXR5nUR	X R189URUR5$![a	 [s$f=fr)r3rcr�r�rsr#r'rr)s   r�__rsub__�ABCPolyBase.__rsub__Yr,r-c���URXR5nUR	X R190URUR5$![a	 [s$f=fr)r6rcr�r�rsr#r'rr)s   r�__rmul__�ABCPolyBase.__rmul__`r,r-c��[$r)r�rfs  r�__rtruediv__�ABCPolyBase.__rtruediv__gs191���r c�D�URU5nU[LaU$US$r��__rdivmod__r�rs   r�
__rfloordiv__�ABCPolyBase.__rfloordiv__l�(�����u�%���.� ��J��1�v�
r c�D�URU5nU[LaU$US$rr8rs   r�__rmod__�ABCPolyBase.__rmod__rr<r c�H�URXR5up#URX RURUR5nURX0RURUR5nX#4$![a e[a	 [s$f=fr)	r9rcr!r�r�rsr#r'r)rrgr"r#s    rr9�ABCPolyBase.__rdivmod__xs���	"��y�y��	�	�2�H�C�192�n�n�S�+�+�t�{�{�D�K�K�H���n�n�S�+�+�t�{�{�D�K�K�H���x���
!�	���	"�!�!�	"�s�B�B!� B!c��[XR5=(a� [R"URUR:H5=(a� [R"UR193UR194:H5=(a� URRURR:H=(aM [R"URUR:H5=(a URUR:HnU$r)	rrrsrdrer#r'rc�shaperrs   r�__eq__�ABCPolyBase.__eq__�s����%���0�-��v�v�d�k�k�U�\�\�1�2�-��v�v�d�k�k�U�\�\�1�2�-��	�	���5�:�:�#3�#3�3�-��v�v�d�i�i�5�:�:�-�.�	-�195���u�|�|�+�	��196r c�.�URU5(+$r)rDrfs  r�__ne__�ABCPolyBase.__ne__�s���;�;�u�%�%�%r c�z�URURURURUR5$)zGReturn a copy.197 198Returns199-------200new_series : series201    Copy of self.202 203r�rs rr��ABCPolyBase.copy�s)���~�~�d�i�i����d�k�k�4�;�;�O�Or c��[U5S-204$)ujThe degree of the series.205 206Returns207-------208degree : int209    Degree of the series, one less than the number of coefficients.210 211Examples212--------213 214Create a polynomial object for ``1 + 7*x + 4*x**2``:215 216>>> np.polynomial.set_default_printstyle("unicode")217>>> poly = np.polynomial.Polynomial([1, 7, 4])218>>> print(poly)2191.0 + 7.0·x + 4.0·x²220>>> poly.degree()2212222 223Note that this method does not check for non-zero coefficients.224You must trim the polynomial to remove any trailing zeroes:225 226>>> poly = np.polynomial.Polynomial([1, 7, 0])227>>> print(poly)2281.0 + 7.0·x + 0.0·x²229>>> poly.degree()2302231>>> poly.trim().degree()2321233 234r)rbrs r�degree�ABCPolyBase.degree�s��@�4�y�1�}�r c�*�URUS-5$)a9Truncate series to the given degree.235 236Reduce the degree of the series to `deg` by discarding the237high order terms. If `deg` is greater than the current degree a238copy of the current series is returned. This can be useful in least239squares where the coefficients of the high degree terms may be very240small.241 242Parameters243----------244deg : non-negative int245    The series is reduced to degree `deg` by discarding the high246    order terms. The value of `deg` must be a non-negative integer.247 248Returns249-------250new_series : series251    New instance of series with reduced degree.252 253r)�truncate)rrQs  r�cutdeg�ABCPolyBase.cutdeg�s��*�}�}�S�1�W�%�%r c��[R"URU5nURX RUR254UR5$)a'Remove trailing coefficients255 256Remove trailing coefficients until a coefficient is reached whose257absolute value greater than `tol` or the beginning of the series is258reached. If all the coefficients would be removed the series is set259to ``[0]``. A new series instance is returned with the new260coefficients.  The current instance remains unchanged.261 262Parameters263----------264tol : non-negative number.265    All trailing coefficients less than `tol` will be removed.266 267Returns268-------269new_series : series270    New instance of series with trimmed coefficients.271 272)r�trimcoefrcrsr#r'r)r�tolrcs   rr}�ABCPolyBase.trim�s7��(�{�{�4�9�9�c�*���~�~�d�K�K����d�k�k�J�Jr c��[U5nX!:wdUS:a[S5eU[UR5:�a
URnOURSUnUR	X0R273URUR5$)aTruncate series to length `size`.274 275Reduce the series to length `size` by discarding the high276degree terms. The value of `size` must be a positive integer. This277can be useful in least squares where the coefficients of the278high degree terms may be very small.279 280Parameters281----------282size : positive int283    The series is reduced to length `size` by discarding the high284    degree terms. The value of `size` must be a positive integer.285 286Returns287-------288new_series : series289    New instance of series with truncated coefficients.290 291rzsize must be a positive integerN)�intrxrbrcrsr#r'r)r�size�isizercs    rrO�ABCPolyBase.truncate�sl��(�D�	���=�E�A�I��>�?�?��C��	�	�N�"��9�9�D��9�9�V�e�$�D��~�~�d�K�K����d�k�k�J�Jr c��UcURnUcURnUcURnU"URXURS95$)a1Convert series to a different kind and/or domain and/or window.292 293Parameters294----------295domain : array_like, optional296    The domain of the converted series. If the value is None,297    the default domain of `kind` is used.298kind : class, optional299    The polynomial series type class to which the current instance300    should be converted. If kind is None, then the class of the301    current instance is used.302window : array_like, optional303    The window of the converted series. If the value is None,304    the default window of `kind` is used.305 306Returns307-------308new_series : series309    The returned class can be of different type than the current310    instance and/or have a different domain and/or different311    window.312 313Notes314-----315Conversion between domains and class types can result in316numerically ill defined series.317 318)r'r)rsr#r'�identityr)rr#�kindr's    r�convert�ABCPolyBase.convertsJ��:�<��>�>�D��>��[�[�F��>��[�[�F��D�M�M�&����M�L�M�Mr c�X�[R"URUR5$)a#Return the mapping parameters.319 320The returned values define a linear map ``off + scl*x`` that is321applied to the input arguments before the series is evaluated. The322map depends on the ``domain`` and ``window``; if the current323``domain`` is equal to the ``window`` the resulting map is the324identity.  If the coefficients of the series instance are to be325used by themselves outside this class, then the linear function326must be substituted for the ``x`` in the standard representation of327the base polynomials.328 329Returns330-------331off, scl : float or complex332    The mapping function is defined by ``off + scl*x``.333 334Notes335-----336If the current domain is the interval ``[l1, r1]`` and the window337is ``[l2, r2]``, then the linear mapping function ``L`` is338defined by the equations::339 340    L(l1) = l2341    L(r1) = r2342 343)rr�r#r'rs rr��ABCPolyBase.mapparms0s��6�{�{�4�;�;����4�4r rc���UR5upEUcSnOXEU--nURURXUSU-5nURX`RUR344UR5$)ayIntegrate.345 346Return a series instance that is the definite integral of the347current series.348 349Parameters350----------351m : non-negative int352    The number of integrations to perform.353k : array_like354    Integration constants. The first constant is applied to the355    first integration, the second to the second, and so on. The356    list of values must less than or equal to `m` in length and any357    missing values are set to zero.358lbnd : Scalar359    The lower bound of the definite integral.360 361Returns362-------363new_series : series364    A new series representing the integral. The domain is the same365    as the domain of the integrated series.366 367rg�?)r�rJrcrsr#r'r)rrFrGrHrWrIrcs       r�integ�ABCPolyBase.integMsb��2�=�=�?����<��D��t��#�D��y�y����A�$��S��9���~�~�d�K�K����d�k�k�J�Jr c���UR5up#URURX5nURX@RUR368UR5$)aGDifferentiate.369 370Return a series instance of that is the derivative of the current371series.372 373Parameters374----------375m : non-negative int376    Find the derivative of order `m`.377 378Returns379-------380new_series : series381    A new series representing the derivative. The domain is the same382    as the domain of the differentiated series.383 384)r�rMrcrsr#r'r)rrFrWrIrcs     r�deriv�ABCPolyBase.derivnsD��$�=�=�?����y�y����A�+���~�~�d�K�K����d�k�k�J�Jr c��URUR5n[R"XRUR3855$)z�Return the roots of the series polynomial.386 387Compute the roots for the series. Note that the accuracy of the388roots decreases the further outside the `domain` they lie.389 390Returns391-------392roots : ndarray393    Array containing the roots of the series.394 395)r[rcrr�r'r#)r�rootss  rri�ABCPolyBase.roots�s/�����D�I�I�&���|�|�E�;�;����<�<r c�r�UcURn[R"USUSU5nU"U5nX44$)a
Return x, y values at equally spaced points in domain.396 397Returns the x, y values at `n` linearly spaced points across the398domain.  Here y is the value of the polynomial at the points x. By399default the domain is the same as that of the series instance.400This method is intended mostly as a plotting aid.401 402Parameters403----------404n : int, optional405    Number of point pairs to return. The default value is 100.406domain : {None, array_like}, optional407    If not None, the specified domain is used instead of that of408    the calling instance. It should be of the form ``[beg,end]``.409    The default is None which case the class domain is used.410 411Returns412-------413x, y : ndarray414    x is equal to linspace(self.domain[0], self.domain[1], n) and415    y is the series evaluated at element of x.416 417rr)r#rd�linspace)r�nr#rBrPs     rrl�ABCPolyBase.linspace�s<��0�>��[�[�F��K�K��q�	�6�!�9�a�0����G���t�r c418	��Uc=[R"U5nUSUS:XaUS==S-ss'US==S-
ss'O0[U[5(a[	U5S:XaUR419nUcURn[R"XU5n420URX�X7XVS9nU(a
Uup�U"X�X�S9U
4$UnU"X�X�S9$)aLeast squares fit to data.421 422Return a series instance that is the least squares fit to the data423`y` sampled at `x`. The domain of the returned instance can be424specified and this will often result in a superior fit with less425chance of ill conditioning.426 427Parameters428----------429x : array_like, shape (M,)430    x-coordinates of the M sample points ``(x[i], y[i])``.431y : array_like, shape (M,)432    y-coordinates of the M sample points ``(x[i], y[i])``.433deg : int or 1-D array_like434    Degree(s) of the fitting polynomials. If `deg` is a single integer435    all terms up to and including the `deg`'th term are included in the436    fit. For NumPy versions >= 1.11.0 a list of integers specifying the437    degrees of the terms to include may be used instead.438domain : {None, [beg, end], []}, optional439    Domain to use for the returned series. If ``None``,440    then a minimal domain that covers the points `x` is chosen.  If441    ``[]`` the class domain is used. The default value was the442    class domain in NumPy 1.4 and ``None`` in later versions.443    The ``[]`` option was added in numpy 1.5.0.444rcond : float, optional445    Relative condition number of the fit. Singular values smaller446    than this relative to the largest singular value will be447    ignored. The default value is ``len(x)*eps``, where eps is the448    relative precision of the float type, about 2e-16 in most449    cases.450full : bool, optional451    Switch determining nature of return value. When it is False452    (the default) just the coefficients are returned, when True453    diagnostic information from the singular value decomposition is454    also returned.455w : array_like, shape (M,), optional456    Weights. If not None, the weight ``w[i]`` applies to the unsquared457    residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are458    chosen so that the errors of the products ``w[i]*y[i]`` all have459    the same variance.  When using inverse-variance weighting, use460    ``w[i] = 1/sigma(y[i])``.  The default value is None.461window : {[beg, end]}, optional462    Window to use for the returned series. The default463    value is the default class domain464symbol : str, optional465    Symbol representing the independent variable. Default is 'x'.466 467Returns468-------469new_series : series470    A series that represents the least squares fit to the data and471    has the domain and window specified in the call. If the472    coefficients for the unscaled and unshifted basis polynomials are473    of interest, do ``new_series.convert().coef``.474 475[resid, rank, sv, rcond] : list476    These values are only returned if ``full == True``477 478    - resid -- sum of squared residuals of the least squares fit479    - rank -- the numerical rank of the scaled Vandermonde matrix480    - sv -- singular values of the scaled Vandermonde matrix481    - rcond -- value of `rcond`.482 483    For more details, see `linalg.lstsq`.484 485rr)�wrRrS�r#r'r)	r�	getdomainrr�listrbr#r'r�rT)r�rBrPrQr#rRrSrpr'r�xnewrrc�statuss              r�fit�ABCPolyBase.fit�s���J�>��\�\�!�_�F��a�y�F�1�I�%��q�	�Q��	��q�	�Q��	��
���
%�
%�#�f�+��*:��Z�Z�F��>��Z�Z�F��|�|�A�v�.���h�h�t���h�A��� �N�T��D��F���
��D��t�6�I�Ir c�r�[R"U/SS9unUc[R"U5nO0[U[5(a[U5S:XaURnUcURn[U5n[R"X#5upgXgU--nURU5Xu--n	U"X�X4S9$)a�Return series instance that has the specified roots.486 487Returns a series representing the product488``(x - r[0])*(x - r[1])*...*(x - r[n-1])``, where ``r`` is a489list of roots.490 491Parameters492----------493roots : array_like494    List of roots.495domain : {[], None, array_like}, optional496    Domain for the resulting series. If None the domain is the497    interval from the smallest root to the largest. If [] the498    domain is the class domain. The default is [].499window : {None, array_like}, optional500    Window for the returned series. If None the class window is501    used. The default is None.502symbol : str, optional503    Symbol representing the independent variable. Default is 'x'.504 505Returns506-------507new_series : series508    Series with the specified roots.509 510Fr|rrq)511rr�rrrrrsrbr#r'r�r_)512r�rir#r'rrQrWrI�rnewrcs513          r�	fromroots�ABCPolyBase.fromrootss���8�,�,��w�U�3����>��\�\�%�(�F�
���
%�
%�#�f�+��*:��Z�Z�F��>��Z�Z�F��%�j���;�;�v�.����5�[� ���~�~�d�#�c�h�.���4�v�E�Er c��UcURnUcURn[R"X!5upEUR	XE5nU"XaX#5$)a�Identity function.514 515If ``p`` is the returned series, then ``p(x) == x`` for all516values of x.517 518Parameters519----------520domain : {None, array_like}, optional521    If given, the array must be of the form ``[beg, end]``, where522    ``beg`` and ``end`` are the endpoints of the domain. If None is523    given then the class domain is used. The default is None.524window : {None, array_like}, optional525    If given, the resulting array must be if the form526    ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of527    the window. If None is given then the class window is used. The528    default is None.529symbol : str, optional530    Symbol representing the independent variable. Default is 'x'.531 532Returns533-------534new_series : series535     Series of representing the identity.536 537)r#r'rr�rX)r�r#r'rrWrIrcs       rr\�ABCPolyBase.identity7sK��6�>��Z�Z�F��>��Z�Z�F��;�;�v�.����y�y��"���4��0�0r c��UcURnUcURn[U5nXQ:wdUS:a[S5eU"S/U-S/-X#U5$)a�Series basis polynomial of degree `deg`.538 539Returns the series representing the basis polynomial of degree `deg`.540 541Parameters542----------543deg : int544    Degree of the basis polynomial for the series. Must be >= 0.545domain : {None, array_like}, optional546    If given, the array must be of the form ``[beg, end]``, where547    ``beg`` and ``end`` are the endpoints of the domain. If None is548    given then the class domain is used. The default is None.549window : {None, array_like}, optional550    If given, the resulting array must be if the form551    ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of552    the window. If None is given then the class window is used. The553    default is None.554symbol : str, optional555    Symbol representing the independent variable. Default is 'x'.556 557Returns558-------559new_series : series560    A series with the coefficient of the `deg` term set to one and561    all others zero.562 563rz deg must be non-negative integerr)r#r'rWrx)r�rQr#r'r�idegs      r�basis�ABCPolyBase.basisZs\��:�>��Z�Z�F��>��Z�Z�F��3�x���;�$��(��?�@�@��A�3��:���#�V�V�<�<r c�b�UcURnUcURnURX U5$)a�Convert series to series of this class.564 565The `series` is expected to be an instance of some polynomial566series of one of the types supported by by the numpy.polynomial567module, but could be some other class that supports the convert568method.569 570Parameters571----------572series : series573    The series instance to be converted.574domain : {None, array_like}, optional575    If given, the array must be of the form ``[beg, end]``, where576    ``beg`` and ``end`` are the endpoints of the domain. If None is577    given then the class domain is used. The default is None.578window : {None, array_like}, optional579    If given, the resulting array must be if the form580    ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of581    the window. If None is given then the class window is used. The582    default is None.583 584Returns585-------586new_series : series587    A series of the same kind as the calling class and equal to588    `series` when evaluated.589 590See Also591--------592convert : similar instance method593 594)r#r'r^)r��seriesr#r's    r�cast�ABCPolyBase.cast�s2��D�>��Z�Z�F��>��Z�Z�F��~�~�f�6�2�2r )r�rrcr#r'r)NNrB)F)r)NNN)r)r	N)NNFNNrB)NN)_r��595__module__�__qualname__�__firstlineno__�__doc__�__hash__�__array_ufunc__r>r��	maketrans�_superscript_mappingr��osr�r��propertyr�abc�abstractmethodr#r'r*�staticmethodr0r3r6r9r?rCrJrMrTrXr[r_rhrkrortryr�r�r�r�r��classmethodr�r�r�r�r�floatr�r�r�r�r�r�r�r�r�rrr596rrrrr&r*r/r2r5r:r>r9rDrGr�rLrPr}rOr^r�rcrfrirlrvrzr\r�r��__static_attributes__r"r rrrs���/�d�H��O��H��=�=�
�
�
�
�
�
�
�
�
�
�*������
�
�
�
�
�
�
�
�
�
�(��� �w�w�$�&�L�
��������
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�����
���
�597�&3� 3� 1� "�H�<,�=�;�598,�\� �� ��5993��6003��:��:��@��@�601"�(�"��"�u�"�&&2�T��602)���603604�605�K�K�K�	(���606��607K�K�K��608��	��&�	P� �D&�.K�.K�:#N�J5�:�2�D�K�BK�,
=��<�CG��XJ��XJ�t�%'��S�(F��(F�T� 1�� 1�D�$=��$=�L�%3��%3r )r�r�r�r��collections.abcr�numpyrdr�rr�__all__�ABCrr"r r�<module>r�s7�����	�$����/��S3�#�'�'�S3r 
codekingpro/portable-devtools · Team Ai