관리-도구
편집 파일: _polybase.cpython-37.pyc
B ��Fd�u � @ sf d Z ddlmZmZmZ ddlmZmZmZ ddl m Z ddlZddl mZ dgZG d d� de�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. � )�division�absolute_import�print_function)�ABCMeta�abstractmethod�abstractproperty)�NumberN� )� polyutils�ABCPolyBasec @ s� e Zd ZdZeZdZdZdZe dd� �Z e dd� �Ze dd � �Ze d d� �Ze dd � �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze d d!� �Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd�d,d-�Zd.d/� Z d0d1� Z!d2d3� Z"d4d5� Z#d6d7� Z$d8d9� Z%d:d;� Z&d<d=� Z'd>d?� Z(d@dA� Z)dBdC� Z*dDdE� Z+dFdG� Z,dHdI� Z-dJdK� Z.dLdM� Z/dNdO� Z0dPdQ� Z1dRdS� Z2dTdU� Z3dVdW� Z4dXdY� Z5dZd[� Z6d\d]� Z7d^d_� Z8d`da� Z9dbdc� Z:ddde� Z;dfdg� Z<dhdi� Z=djdk� Z>d�dmdn�Z?dodp� Z@d�dqdr�ZAdsdt� ZBdug dfdvdw�ZCd�dxdy�ZDdzd{� ZEd�d|d}�ZFeGd�dd���ZHeGg dfd�d���ZIeGd�d�d���ZJeGd�d�d���ZKeGd�d�d���ZLdS )�r a� An abstract base class for 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 c C s d S )N� )�selfr r �M/opt/alt/python37/lib64/python3.7/site-packages/numpy/polynomial/_polybase.py�domainI s zABCPolyBase.domainc C s d S )Nr )r r r r �windowM s zABCPolyBase.windowc C s d S )Nr )r r r r �nicknameQ s zABCPolyBase.nicknamec C s d S )Nr )r r r r �_addU s zABCPolyBase._addc C s d S )Nr )r r r r �_subY s zABCPolyBase._subc C s d S )Nr )r r r r �_mul] s zABCPolyBase._mulc C s d S )Nr )r r r r �_diva s zABCPolyBase._divc C s d S )Nr )r r r r �_powe s zABCPolyBase._powc C s d S )Nr )r r r r �_vali s zABCPolyBase._valc C s d S )Nr )r r r r �_intm s zABCPolyBase._intc C s d S )Nr )r r r r �_derq s zABCPolyBase._derc C s d S )Nr )r r r r �_fitu s zABCPolyBase._fitc C s d S )Nr )r r r r �_liney s zABCPolyBase._linec C s d S )Nr )r r r r �_roots} s zABCPolyBase._rootsc C s d S )Nr )r r r r � _fromroots� s zABCPolyBase._fromrootsc C s6 t | j�t |j�krdS t�| j|jk�s.dS dS 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. FTN)�len�coef�np�all)r �otherr r r �has_samecoef� s zABCPolyBase.has_samecoefc C s 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"