관리-도구
편집 파일: hermite.cpython-37.pyc
B ��Fd�� � @ 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�dd*g�Zd+d� Zd,d� Zd-d � Zd.d� Zd/d� Z d0d� Z!d1d� Z"dHd3d�Z#dId4d�Z$dg dddfd5d�Z%dJd7d�Z&d8d� Z'd9d � Z(d:d� Z)d;d!� Z*d<d� Z+d=d"� Z,d>d#� Z-dKd@d�Z.dAd$� Z/dBd� Z0dCdD� Z1dEd%� Z2dFd&� Z3G dGd� de�Z4dS )La� Objects for dealing with Hermite series. This module provides a number of objects (mostly functions) useful for dealing with Hermite series, including a `Hermite` 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 --------- - `hermdomain` -- Hermite series default domain, [-1,1]. - `hermzero` -- Hermite series that evaluates identically to 0. - `hermone` -- Hermite series that evaluates identically to 1. - `hermx` -- Hermite series for the identity map, ``f(x) = x``. Arithmetic ---------- - `hermmulx` -- multiply a Hermite series in ``P_i(x)`` by ``x``. - `hermadd` -- add two Hermite series. - `hermsub` -- subtract one Hermite series from another. - `hermmul` -- multiply two Hermite series. - `hermdiv` -- divide one Hermite series by another. - `hermval` -- evaluate a Hermite series at given points. - `hermval2d` -- evaluate a 2D Hermite series at given points. - `hermval3d` -- evaluate a 3D Hermite series at given points. - `hermgrid2d` -- evaluate a 2D Hermite series on a Cartesian product. - `hermgrid3d` -- evaluate a 3D Hermite series on a Cartesian product. Calculus -------- - `hermder` -- differentiate a Hermite series. - `hermint` -- integrate a Hermite series. Misc Functions -------------- - `hermfromroots` -- create a Hermite series with specified roots. - `hermroots` -- find the roots of a Hermite series. - `hermvander` -- Vandermonde-like matrix for Hermite polynomials. - `hermvander2d` -- Vandermonde-like matrix for 2D power series. - `hermvander3d` -- Vandermonde-like matrix for 3D power series. - `hermgauss` -- Gauss-Hermite quadrature, points and weights. - `hermweight` -- Hermite weight function. - `hermcompanion` -- symmetrized companion matrix in Hermite form. - `hermfit` -- least-squares fit returning a Hermite series. - `hermtrim` -- trim leading coefficients from a Hermite series. - `hermline` -- Hermite series of given straight line. - `herm2poly` -- convert a Hermite series to a polynomial. - `poly2herm` -- convert a polynomial to a Hermite series. Classes ------- - `Hermite` -- A Hermite series class. See also -------- `numpy.polynomial` � )�division�absolute_import�print_functionN)�normalize_axis_index� )� polyutils)�ABCPolyBase�hermzero�hermone�hermx� hermdomain�hermline�hermadd�hermsub�hermmulx�hermmul�hermdiv�hermpow�hermval�hermder�hermint� herm2poly� poly2herm� hermfromroots� hermvander�hermfit�hermtrim� hermroots�Hermite� hermval2d� hermval3d� hermgrid2d� hermgrid3d�hermvander2d�hermvander3d� hermcompanion� hermgauss� hermweightc C sJ t �| g�\} t| �d }d}x&t|dd�D ]}tt|�| | �}q,W |S )a� poly2herm(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 -------- herm2poly 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 import poly2herm >>> poly2herm(np.arange(4)) array([ 1. , 2.75 , 0.5 , 0.375]) r r ���)�pu� as_series�len�ranger r )Zpol�deg�res�i� r0 �K/opt/alt/python37/lib64/python3.7/site-packages/numpy/polynomial/hermite.pyr Q s &c C s� ddl m}m}m} t�| g�\} t| �}|dkr6| S |dkrR| d d9 <