File: //lib/python3/dist-packages/numpy/polynomial/__pycache__/_polybase.cpython-310.pyc
o
6��a.� � @ sL d Z ddlZddlZddlZddlZddlmZ dgZ G dd� dej
�ZdS )a
Abstract base class for the various polynomial Classes.
The ABCPolyBase class provides the methods needed to implement the common API
for the various polynomial classes. It operates as a mixin, but uses the
abc module from the stdlib, hence it is only available for Python >= 2.6.
� N� )� polyutils�ABCPolyBasec
@ s� e Zd ZdZdZdZdZe�dddddd d
ddd
d�
�Z e�ddddddddddd�
�Z
ejdk Z
eejdd� ��Zeejdd� ��Zeejdd� ��Zeejd d!� ��Zeejd"d#� ��Zeejd$d%� ��Zeejd&d'� ��Zeejd�d(d)���Zeejd*d+� ��Zeejd,d-� ��Zeejd.d/� ��Zeejd0d1� ��Zeejd2d3� ��Zeejd4d5� ��Zeejd6d7� ��Z d8d9� Z!d:d;� Z"d<d=� Z#d>d?� Z$d@dA� Z%d�dBdC�Z&dDdE� Z'dFdG� Z(dHdI� Z)dJdK� Z*e+dLdM� �Z,e+dNdO� �Z-e+dPdQ� �Z.edRdS� �Z/dTdU� Z0dVdW� Z1dXdY� Z2dZd[� Z3d\d]� Z4d^d_� Z5d`da� Z6dbdc� Z7ddde� Z8dfdg� Z9dhdi� Z:djdk� Z;dldm� Z<dndo� Z=dpdq� Z>drds� Z?dtdu� Z@dvdw� ZAdxdy� ZBdzd{� ZCd|d}� ZDd~d� ZEd�d�� ZFd�d�� ZGd�d�� ZHd�d�� ZId�d�� ZJd�d�� ZKd�d�� ZLd�d�d��ZMd�d�� ZNd�d�d��ZOd�d�� ZPd�g dfd�d��ZQd�d�d��ZRd�d�� ZSd�d�d��ZTe+ d�d�d���ZUe+g dfd�d���ZVe+d�d�d���ZWe+d�d�d���ZXe+d�d�d���ZYdS )�r a� An abstract base class for immutable series classes.
ABCPolyBase provides the standard Python numerical methods
'+', '-', '*', '//', '%', 'divmod', '**', and '()' along with the
methods listed below.
.. versionadded:: 1.9.0
Parameters
----------
coef : array_like
Series coefficients in order of increasing degree, i.e.,
``(1, 2, 3)`` gives ``1*P_0(x) + 2*P_1(x) + 3*P_2(x)``, where
``P_i`` is the basis polynomials of degree ``i``.
domain : (2,) array_like, optional
Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
to the interval ``[window[0], window[1]]`` by shifting and scaling.
The default value is the derived class domain.
window : (2,) array_like, optional
Window, see domain for its use. The default value is the
derived class window.
Attributes
----------
coef : (N,) ndarray
Series coefficients in order of increasing degree.
domain : (2,) ndarray
Domain that is mapped to window.
window : (2,) ndarray
Window that domain is mapped to.
Class Attributes
----------------
maxpower : int
Maximum power allowed, i.e., the largest number ``n`` such that
``p(x)**n`` is allowed. This is to limit runaway polynomial size.
domain : (2,) ndarray
Default domain of the class.
window : (2,) ndarray
Default window of the class.
N�d u ⁰� ¹� ²� ³u ⁴u ⁵u ⁶u ⁷u ⁸u ⁹)
�0�1�2�3�4�5�6�7�8�9u ₀u ₁u ₂u ₃u ₄u ₅u ₆u ₇u ₈u ₉�ntc C � d S �N� ��selfr r �</usr/lib/python3/dist-packages/numpy/polynomial/_polybase.py�domainf � zABCPolyBase.domainc C r r r r r r r �windowk r zABCPolyBase.windowc C r r r r r r r �
basis_namep r zABCPolyBase.basis_namec C r r r ��c1�c2r r r �_addu r zABCPolyBase._addc C r r r r r r r �_subz r zABCPolyBase._subc C r r r r r r r �_mul r zABCPolyBase._mulc C r r r r r r r �_div� r zABCPolyBase._divc C r r r )�c�pow�maxpowerr r r �_pow� r zABCPolyBase._powc C r r r )�xr% r r r �_val� r zABCPolyBase._valc C r r r )r% �m�k�lbnd�sclr r r �_int� r zABCPolyBase._intc C r r r )r% r+ r. r r r �_der� r zABCPolyBase._derc C r r r )r) �y�deg�rcond�fullr r r �_fit� r zABCPolyBase._fitc C r r r )�offr. r r r �_line� r zABCPolyBase._linec C r r r )r% r r r �_roots� r zABCPolyBase._rootsc C r r r )�rr r r �
_fromroots� r zABCPolyBase._fromrootsc C s2 t | j�t |j�krdS t�| j|jk�sdS dS )aG Check if coefficients match.
.. versionadded:: 1.6.0
Parameters
----------
other : class instance
The other class must have the ``coef`` attribute.
Returns
-------
bool : boolean
True if the coefficients are the same, False otherwise.
FT)�len�coef�np�all�r �otherr r r �has_samecoef� s
zABCPolyBase.has_samecoefc C � t �| j|jk�S )a? Check if domains match.
.. versionadded:: 1.6.0
Parameters
----------
other : class instance
The other class must have the ``domain`` attribute.
Returns
-------
bool : boolean
True if the domains are the same, False otherwise.
)r= r>