관리-도구
편집 파일: hermite_e.cpython-37.pyc
B ��FdN� � @ s� d Z ddlmZmZmZ ddlZddlZddlm Z ddlmZ ddl mZ ddlmZ dd d ddd ddddddddddddddddddd d!d"d#d$d%d&gZejZd'd� Zd(d� Ze�d)dg�Ze�dg�Ze�dg�Ze�ddg�Zd*d� Zd+d� Zd,d � Zd-d� Zd.d� Z d/d� Z!d0d� Z"dGd2d�Z#dHd3d�Z$dg dddfd4d�Z%dId6d�Z&d7d� Z'd8d � Z(d9d� Z)d:d!� Z*d;d� Z+d<d"� Z,d=d#� Z-dJd?d�Z.d@d$� Z/dAd� Z0dBdC� Z1dDd%� Z2dEd&� Z3G dFd� de�Z4dS )KaA Objects for dealing with Hermite_e series. This module provides a number of objects (mostly functions) useful for dealing with Hermite_e series, including a `HermiteE` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the docstring for its "parent" sub-package, `numpy.polynomial`). Constants --------- - `hermedomain` -- Hermite_e series default domain, [-1,1]. - `hermezero` -- Hermite_e series that evaluates identically to 0. - `hermeone` -- Hermite_e series that evaluates identically to 1. - `hermex` -- Hermite_e series for the identity map, ``f(x) = x``. Arithmetic ---------- - `hermemulx` -- multiply a Hermite_e series in ``P_i(x)`` by ``x``. - `hermeadd` -- add two Hermite_e series. - `hermesub` -- subtract one Hermite_e series from another. - `hermemul` -- multiply two Hermite_e series. - `hermediv` -- divide one Hermite_e series by another. - `hermeval` -- evaluate a Hermite_e series at given points. - `hermeval2d` -- evaluate a 2D Hermite_e series at given points. - `hermeval3d` -- evaluate a 3D Hermite_e series at given points. - `hermegrid2d` -- evaluate a 2D Hermite_e series on a Cartesian product. - `hermegrid3d` -- evaluate a 3D Hermite_e series on a Cartesian product. Calculus -------- - `hermeder` -- differentiate a Hermite_e series. - `hermeint` -- integrate a Hermite_e series. Misc Functions -------------- - `hermefromroots` -- create a Hermite_e series with specified roots. - `hermeroots` -- find the roots of a Hermite_e series. - `hermevander` -- Vandermonde-like matrix for Hermite_e polynomials. - `hermevander2d` -- Vandermonde-like matrix for 2D power series. - `hermevander3d` -- Vandermonde-like matrix for 3D power series. - `hermegauss` -- Gauss-Hermite_e quadrature, points and weights. - `hermeweight` -- Hermite_e weight function. - `hermecompanion` -- symmetrized companion matrix in Hermite_e form. - `hermefit` -- least-squares fit returning a Hermite_e series. - `hermetrim` -- trim leading coefficients from a Hermite_e series. - `hermeline` -- Hermite_e series of given straight line. - `herme2poly` -- convert a Hermite_e series to a polynomial. - `poly2herme` -- convert a polynomial to a Hermite_e series. Classes ------- - `HermiteE` -- A Hermite_e series class. See also -------- `numpy.polynomial` � )�division�absolute_import�print_functionN)�normalize_axis_index� )� polyutils)�ABCPolyBase� hermezero�hermeone�hermex�hermedomain� hermeline�hermeadd�hermesub� hermemulx�hermemul�hermediv�hermepow�hermeval�hermeder�hermeint� herme2poly� poly2herme�hermefromroots�hermevander�hermefit� hermetrim� hermeroots�HermiteE� hermeval2d� hermeval3d�hermegrid2d�hermegrid3d� hermevander2d� hermevander3d�hermecompanion� hermegauss�hermeweightc C sJ t �| g�\} t| �d }d}x&t|dd�D ]}tt|�| | �}q,W |S )a� poly2herme(pol) Convert a polynomial to a Hermite series. Convert an array representing the coefficients of a polynomial (relative to the "standard" basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Hermite series, ordered from lowest to highest degree. Parameters ---------- pol : array_like 1-D array containing the polynomial coefficients Returns ------- c : ndarray 1-D array containing the coefficients of the equivalent Hermite series. See Also -------- herme2poly Notes ----- The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples -------- >>> from numpy.polynomial.hermite_e import poly2herme >>> poly2herme(np.arange(4)) array([ 2., 10., 2., 3.]) r r ���)�pu� as_series�len�ranger r )Zpol�deg�res�i� r0 �M/opt/alt/python37/lib64/python3.7/site-packages/numpy/polynomial/hermite_e.pyr R s &c C s� ddl m}m}m} t�| g�\} t| �}|dkr6| S |dkrB| S | d }| d }xDt|d dd�D ]0}|}|| |d ||d �}||||��}qdW ||||��S dS )a Convert a Hermite series to a polynomial. Convert an array representing the coefficients of a Hermite series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to highest degree. Parameters ---------- c : array_like 1-D array containing the Hermite series coefficients, ordered from lowest order term to highest. Returns ------- pol : ndarray 1-D array containing the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest order term to highest. See Also -------- poly2herme Notes ----- The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples -------- >>> from numpy.polynomial.hermite_e import herme2poly >>> herme2poly([ 2., 10., 2., 3.]) array([ 0., 1., 2., 3.]) r )�polyadd�polysub�polymulx� ���r( N)� polynomialr2 r3 r4 r) r* r+ r, ) �cr2 r3 r4 �n�c0�c1r/ �tmpr0 r0 r1 r � s &r( c C s&