ó
Ë½÷Xc           @` s-  d  Z  d d l m Z m Z m Z d d d d d d d	 d
 d d d d d g Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 Z d d l
 m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d d l Z d d l j Z d d l m Z d d l m Z m Z m Z d d l  m! Z! d d l  m" Z" d d l  m# Z# d d l$ m% Z% d d l  m& Z& d d l' m( Z( d d l) m* Z* d d l+ m, Z, m- Z- d „  Z. d „  Z/ d e0 f d „  ƒ  YZ1 d  „  Z2 d! „  Z3 d e% f d" „  ƒ  YZ4 d# e0 f d$ „  ƒ  YZ5 d e5 f d% „  ƒ  YZ6 d e5 f d& „  ƒ  YZ7 d e0 f d' „  ƒ  YZ8 d e0 f d( „  ƒ  YZ9 d) e: e j; d* „ Z< d	 e6 f d+ „  ƒ  YZ= d, „  Z> e? e? d- „ Z@ d. „  ZA e jB d/ d0 ƒ d1 d2 e? d3 „ ƒ ZC e jB d/ d4 ƒ d d5 „ ƒ ZD e jB d/ d6 ƒ d7 „  ƒ ZE e jB d/ d8 ƒ d1 d2 e? d9 „ ƒ ZF d S(:   s#    Classes for interpolating values.
i    (   t   divisiont   print_functiont   absolute_importt   interp1dt   interp2dt   splinet   splevalt   splmaket   spltoppt   ppformt   lagranget   PPolyt   BPolyt   NdPPolyt   RegularGridInterpolatort   interpnN(
   t   arrayt	   transposet   searchsortedt
   atleast_1dt
   atleast_2dt   dott   ravelt   poly1dt   asarrayt   intp(   t   comb(   t   xranget   integer_typest   string_typesi   (   t   fitpack(   t   dfitpack(   t   _fitpack(   t   _Interpolator1D(   t   _ppoly(   t   RectBivariateSpline(   t   _ndim_coords_from_arrays(   t   make_interp_splinet   BSplinec         C` s)   t  |  ƒ d k r d St j t j |  ƒ S(   sF   Product of a list of numbers; ~40x faster vs np.prod for Python tuplesi    i   (   t   lent	   functoolst   reducet   operatort   mul(   t   x(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   prod$   s    c         C` s§   t  |  ƒ } t d ƒ } xˆ t | ƒ D]z } t | | ƒ } xW t | ƒ D]I } | | k r` qH n  |  | |  | } | t d |  | g ƒ | 9} qH W| | 7} q% W| S(   s‹  
    Return a Lagrange interpolating polynomial.

    Given two 1-D arrays `x` and `w,` returns the Lagrange interpolating
    polynomial through the points ``(x, w)``.

    Warning: This implementation is numerically unstable. Do not expect to
    be able to use more than about 20 points even if they are chosen optimally.

    Parameters
    ----------
    x : array_like
        `x` represents the x-coordinates of a set of datapoints.
    w : array_like
        `w` represents the y-coordinates of a set of datapoints, i.e. f(`x`).

    Returns
    -------
    lagrange : numpy.poly1d instance
        The Lagrange interpolating polynomial.

    g        g      ð?(   R'   R   R   (   R,   t   wt   Mt   pt   jt   ptt   kt   fac(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR
   +   s    #c           B` s5   e  Z d  Z d e e d d „ Z d d e d „ Z RS(   sÃ  
    interp2d(x, y, z, kind='linear', copy=True, bounds_error=False,
             fill_value=nan)

    Interpolate over a 2-D grid.

    `x`, `y` and `z` are arrays of values used to approximate some function
    f: ``z = f(x, y)``. This class returns a function whose call method uses
    spline interpolation to find the value of new points.

    If `x` and `y` represent a regular grid, consider using
    RectBivariateSpline.

    Note that calling `interp2d` with NaNs present in input values results in
    undefined behaviour.

    Methods
    -------
    __call__

    Parameters
    ----------
    x, y : array_like
        Arrays defining the data point coordinates.

        If the points lie on a regular grid, `x` can specify the column
        coordinates and `y` the row coordinates, for example::

          >>> x = [0,1,2];  y = [0,3]; z = [[1,2,3], [4,5,6]]

        Otherwise, `x` and `y` must specify the full coordinates for each
        point, for example::

          >>> x = [0,1,2,0,1,2];  y = [0,0,0,3,3,3]; z = [1,2,3,4,5,6]

        If `x` and `y` are multi-dimensional, they are flattened before use.
    z : array_like
        The values of the function to interpolate at the data points. If
        `z` is a multi-dimensional array, it is flattened before use.  The
        length of a flattened `z` array is either
        len(`x`)*len(`y`) if `x` and `y` specify the column and row coordinates
        or ``len(z) == len(x) == len(y)`` if `x` and `y` specify coordinates
        for each point.
    kind : {'linear', 'cubic', 'quintic'}, optional
        The kind of spline interpolation to use. Default is 'linear'.
    copy : bool, optional
        If True, the class makes internal copies of x, y and z.
        If False, references may be used. The default is to copy.
    bounds_error : bool, optional
        If True, when interpolated values are requested outside of the
        domain of the input data (x,y), a ValueError is raised.
        If False, then `fill_value` is used.
    fill_value : number, optional
        If provided, the value to use for points outside of the
        interpolation domain. If omitted (None), values outside
        the domain are extrapolated.

    See Also
    --------
    RectBivariateSpline :
        Much faster 2D interpolation if your input data is on a grid
    bisplrep, bisplev :
        Spline interpolation based on FITPACK
    BivariateSpline : a more recent wrapper of the FITPACK routines
    interp1d : one dimension version of this function

    Notes
    -----
    The minimum number of data points required along the interpolation
    axis is ``(k+1)**2``, with k=1 for linear, k=3 for cubic and k=5 for
    quintic interpolation.

    The interpolator is constructed by `bisplrep`, with a smoothing factor
    of 0. If more control over smoothing is needed, `bisplrep` should be
    used directly.

    Examples
    --------
    Construct a 2-D grid and interpolate on it:

    >>> from scipy import interpolate
    >>> x = np.arange(-5.01, 5.01, 0.25)
    >>> y = np.arange(-5.01, 5.01, 0.25)
    >>> xx, yy = np.meshgrid(x, y)
    >>> z = np.sin(xx**2+yy**2)
    >>> f = interpolate.interp2d(x, y, z, kind='cubic')

    Now use the obtained interpolation function and plot the result:

    >>> import matplotlib.pyplot as plt
    >>> xnew = np.arange(-5.01, 5.01, 1e-2)
    >>> ynew = np.arange(-5.01, 5.01, 1e-2)
    >>> znew = f(xnew, ynew)
    >>> plt.plot(x, z[0, :], 'ro-', xnew, znew[0, :], 'b-')
    >>> plt.show()
    t   linearc         C` s/  t  | ƒ } t  | ƒ } t | ƒ } | j t | ƒ t | ƒ k } | r;| j d k r‹ | j t | ƒ t | ƒ f k r‹ t d ƒ ‚ q‹ n  t j | d | d  k ƒ sÚ t j	 | ƒ }	 | |	 } | d  d  … |	 f } n  t j | d | d  k ƒ s)t j	 | ƒ }	 | |	 } | |	 d  d  … f } n  t  | j
 ƒ } nZ t  | ƒ } t | ƒ t | ƒ k rnt d ƒ ‚ n  t | ƒ t | ƒ k r•t d ƒ ‚ n  y' i d d 6d d	 6d
 d 6| }
 } Wn t k
 rÛt d ƒ ‚ n X| st j | | | d |
 d | d d ƒ|  _ n€ t j | | | d  d  d  d  d |
 d | d d ƒ\ } } } } } } } | |  | |  | | |
 d | | d  |
 | f |  _ | |  _ | |  _ g  | | | f D] } t | d | ƒ^ q±\ |  _ |  _ |  _ t j | ƒ t j | ƒ |  _ |  _ t j | ƒ t j | ƒ |  _ |  _ d  S(   Ni   sd   When on a regular grid with x.size = m and y.size = n, if z.ndim == 2, then z must have shape (n, m)i   iÿÿÿÿs8   x and y must have equal lengths for non rectangular grids3   Invalid length for input z for non rectangular gridR5   i   t   cubici   t   quintics   Unsupported interpolation type.t   kxt   kyt   sg        t   copy(   R   R   t   sizeR'   t   ndimt   shapet
   ValueErrort   npt   allt   argsortt   Tt   KeyErrorR   t   bisplrept   tckR   t   regrid_smtht   Nonet   bounds_errort
   fill_valueR   R,   t   yt   zt   amint   amaxt   x_mint   x_maxt   y_mint   y_max(   t   selfR,   RK   RL   t   kindR;   RI   RJ   t   rectangular_gridR1   R8   R9   t   nxt   txt   nyt   tyt   ct   fpt   iert   a(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   __init__µ   sT    !


-*)		@%i    c      
   C` sØ  t  | ƒ } t  | ƒ } | j d k s6 | j d k rE t d ƒ ‚ n  | sl t j | ƒ } t j | ƒ } n  |  j s„ |  j d k	 rÝ | |  j k  | |  j	 k B} | |  j
 k  | |  j k B} t j | ƒ } t j | ƒ }	 n  |  j r#| sò |	 r#t d |  j |  j	 f |  j
 |  j f f ƒ ‚ n  t j | | |  j | | ƒ }
 t |
 ƒ }
 t |
 ƒ }
 |  j d k	 r¯| rŠ|  j |
 d d … | f <n  |	 r¯|  j |
 | d d … f <q¯n  t |
 ƒ d k rÎ|
 d }
 n  t |
 ƒ S(   sï  Interpolate the function.

        Parameters
        ----------
        x : 1D array
            x-coordinates of the mesh on which to interpolate.
        y : 1D array
            y-coordinates of the mesh on which to interpolate.
        dx : int >= 0, < kx
            Order of partial derivatives in x.
        dy : int >= 0, < ky
            Order of partial derivatives in y.
        assume_sorted : bool, optional
            If False, values of `x` and `y` can be in any order and they are
            sorted first.
            If True, `x` and `y` have to be arrays of monotonically
            increasing values.

        Returns
        -------
        z : 2D array with shape (len(y), len(x))
            The interpolated values.
        i   s!   x and y should both be 1-D arrayss-   Values out of range; x must be in %r, y in %rNi    (   R   R=   R?   R@   t   sortRI   RJ   RH   RO   RP   RQ   RR   t   anyR   t   bisplevRF   R   R   R'   R   (   RS   R,   RK   t   dxt   dyt   assume_sortedt   out_of_bounds_xt   out_of_bounds_yt   any_out_of_bounds_xt   any_out_of_bounds_yRL   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   __call__ì   s6    N(   t   __name__t
   __module__t   __doc__t   Truet   FalseRH   R^   Ri   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   S   s   `	6c         C` sÛ   |  j  } t | ƒ t | ƒ k r¾ xš t | d d d … | d d d … ƒ D]( \ } } | d k rK | | k rK PqK qK W|  j d k r± |  j  | k r± t j | |  j ƒ |  }  n  |  j ƒ  Sn  t d | | | f ƒ ‚ d S(   s7   Helper to check that arr_from broadcasts up to shape_toNiÿÿÿÿi   sE   %s argument must be able to broadcast up to shape %s but had shape %s(	   R>   R'   t   zipR<   R@   t   onest   dtypeR   R?   (   t   arr_fromt   shape_tot   namet
   shape_fromt   tt   f(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _check_broadcast_up_to*  s    	6c         C` s   t  |  t ƒ o |  d k S(   s?   Helper to check if fill_value == "extrapolate" without warningst   extrapolate(   t
   isinstanceR   (   RJ   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _do_extrapolate;  s    c           B` sŒ   e  Z d  Z d d e d e j e d „ Z e	 d „  ƒ Z
 e
 j d „  ƒ Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   s>  
    Interpolate a 1-D function.

    `x` and `y` are arrays of values used to approximate some function f:
    ``y = f(x)``.  This class returns a function whose call method uses
    interpolation to find the value of new points.

    Note that calling `interp1d` with NaNs present in input values results in
    undefined behaviour.

    Parameters
    ----------
    x : (N,) array_like
        A 1-D array of real values.
    y : (...,N,...) array_like
        A N-D array of real values. The length of `y` along the interpolation
        axis must be equal to the length of `x`.
    kind : str or int, optional
        Specifies the kind of interpolation as a string
        ('linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic'
        where 'zero', 'slinear', 'quadratic' and 'cubic' refer to a spline
        interpolation of zeroth, first, second or third order) or as an
        integer specifying the order of the spline interpolator to use.
        Default is 'linear'.
    axis : int, optional
        Specifies the axis of `y` along which to interpolate.
        Interpolation defaults to the last axis of `y`.
    copy : bool, optional
        If True, the class makes internal copies of x and y.
        If False, references to `x` and `y` are used. The default is to copy.
    bounds_error : bool, optional
        If True, a ValueError is raised any time interpolation is attempted on
        a value outside of the range of x (where extrapolation is
        necessary). If False, out of bounds values are assigned `fill_value`.
        By default, an error is raised unless `fill_value="extrapolate"`.
    fill_value : array-like or (array-like, array_like) or "extrapolate", optional
        - if a ndarray (or float), this value will be used to fill in for
          requested points outside of the data range. If not provided, then
          the default is NaN. The array-like must broadcast properly to the
          dimensions of the non-interpolation axes.
        - If a two-element tuple, then the first element is used as a
          fill value for ``x_new < x[0]`` and the second element is used for
          ``x_new > x[-1]``. Anything that is not a 2-element tuple (e.g.,
          list or ndarray, regardless of shape) is taken to be a single
          array-like argument meant to be used for both bounds as
          ``below, above = fill_value, fill_value``.

          .. versionadded:: 0.17.0
        - If "extrapolate", then points outside the data range will be
          extrapolated.

          .. versionadded:: 0.17.0
    assume_sorted : bool, optional
        If False, values of `x` can be in any order and they are sorted first.
        If True, `x` has to be an array of monotonically increasing values.

    Methods
    -------
    __call__

    See Also
    --------
    splrep, splev
        Spline interpolation/smoothing based on FITPACK.
    UnivariateSpline : An object-oriented wrapper of the FITPACK routines.
    interp2d : 2-D interpolation

    Examples
    --------
    >>> import matplotlib.pyplot as plt
    >>> from scipy import interpolate
    >>> x = np.arange(0, 10)
    >>> y = np.exp(-x/3.0)
    >>> f = interpolate.interp1d(x, y)

    >>> xnew = np.arange(0, 9, 0.1)
    >>> ynew = f(xnew)   # use interpolation function returned by `interp1d`
    >>> plt.plot(x, y, 'o', xnew, ynew, '-')
    >>> plt.show()
    R5   iÿÿÿÿc	         C` sÇ  t  j |  | | d | ƒ| |  _ | |  _ | d k rm i d d 6d d 6d d 6d	 d 6d
 d 6| }	 d } n= t | t ƒ r‹ | }	 d } n | d k rª t d | ƒ ‚ n  t | d |  j ƒ} t | d |  j ƒ} | st j	 | ƒ }
 | |
 } t j
 | |
 d | ƒ} n  | j d k r,t d ƒ ‚ n  | j d k rJt d ƒ ‚ n  t | j j t j ƒ sw| j t j ƒ } n  | | j |  _ | |  _ |  j |  j ƒ |  _ | |  _ ~ ~ | |  _ | |  _ | d k r d	 } | d k r!|  j d |  _ |  j d |  j d  |  _ |  j j |  _ q›|  j j t j k oH|  j j t j k } | o`|  j j d k } | ost | ƒ } | rŽ|  j j |  _ q›|  j j  |  _ nû |	 d } t! } |  j |  j } } |	 d k rVt j" |  j ƒ j# ƒ  r t j$ t% |  j ƒ t& |  j ƒ t' |  j ƒ ƒ } t( } n  t j" |  j ƒ j# ƒ  rVt j) |  j ƒ } t( } qVn  t* | | d |	 d t! ƒ|  _+ | rŒ|  j j, |  _ n |  j j- |  _ t' |  j ƒ | k  rÃt d | ƒ ‚ n  d S(   s,    Initialize a 1D linear interpolation class.t   axist   zerot   slineart	   quadraticR6   i    t   nearesti   i   i   R   R5   s8   %s is unsupported: Use fitpack routines for other types.R;   s,   the x array must have exactly one dimension.s-   the y array must have at least one dimension.g       @iÿÿÿÿR3   t   check_finites,   x and y arrays must have at least %d entriesN(   R}   R~   R   s   cubic(   s   linearR€   (   s   linearR€   (.   R!   R^   RI   R;   Rz   t   intt   NotImplementedErrorR   R@   RB   t   takeR=   R?   t
   issubclassRq   t   typet   inexactt   astypet   float_R|   RK   t   _reshape_yit   _yR,   t   _kindRJ   t   x_bdst	   __class__t   _call_nearestt   _callR{   t   _call_linear_npt   _call_linearRn   t   isnanR`   t   linspacet   mint   maxR'   Rm   t	   ones_likeR%   t   _splinet   _call_nan_splinet   _call_spline(   RS   R,   RK   RT   R|   R;   RI   RJ   Rd   t   ordert   indt   minvalt   condt   rewrite_nant   xxt   yy(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR^   “  s|    				
				*
0	c         C` s   |  j  S(   N(   t   _fill_value_orig(   RS   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRJ   ú  s    c         C` sl  t  | ƒ r9 |  j r$ t d ƒ ‚ n  t |  _ t |  _ n&|  j j |  j  |  j j |  j d } t	 | ƒ d k r| d } n  t
 | t ƒ rt	 | ƒ d k rt j | d ƒ t j | d ƒ g } d	 } x] t d ƒ D]$ } t | | | | | ƒ | | <qÖ Wn( t j | ƒ } t | | d ƒ g d } | \ |  _ |  _ t |  _ |  j d  k r_t |  _ n  | |  _ d  S(
   Ns.   Cannot extrapolate and raise at the same time.i   i    i   s   fill_value (below)s   fill_value (above)RJ   (   i   (   s   fill_value (below)s   fill_value (above)(   R{   RI   R?   Rn   Rm   t   _extrapolateRK   R>   R|   R'   Rz   t   tupleR@   R   t   rangeRx   t   _fill_value_belowt   _fill_value_aboveRH   R¢   (   RS   RJ   t   broadcast_shapet   below_abovet   namest   ii(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRJ   ÿ  s0    			!"	c         C` s   t  j | |  j |  j ƒ S(   N(   R@   t   interpR,   RK   (   RS   t   x_new(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR‘   !  s    c         C` sÆ   t  |  j | ƒ } | j d t |  j ƒ d ƒ j t ƒ } | d } | } |  j | } |  j | } |  j | } |  j | } | | | | d  d  … d  f }	 |	 | | d  d  … d  f | }
 |
 S(   Ni   (   R   R,   t   clipR'   Rˆ   R‚   R‹   RH   (   RS   R­   t   x_new_indicest   lot   hit   x_lot   x_hit   y_lot   y_hit   slopet   y_new(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR’   %  s    (
""c         C` sQ   t  |  j | d d ƒ} | j d t |  j ƒ d ƒ j t ƒ } |  j | } | S(   s6    Find nearest neighbour interpolated y_new = f(x_new).t   sidet   lefti    i   (   R   R   R®   R'   R,   Rˆ   R   R‹   (   RS   R­   R¯   R·   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   B  s    (c         C` s   |  j  | ƒ S(   N(   R˜   (   RS   R­   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRš   S  s    c         C` s    |  j  | ƒ } t j | d <| S(   N.(   R˜   R@   t   nan(   RS   R­   t   out(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR™   V  s    c         C` sr   t  | ƒ } |  j |  | ƒ } |  j sn |  j | ƒ \ } } t | ƒ d k rn |  j | | <|  j | | <qn n  | S(   Ni    (   R   R   R£   t   _check_boundsR'   R¦   R§   (   RS   R­   R·   t   below_boundst   above_bounds(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt	   _evaluate[  s    	c         C` sx   | |  j  d k  } | |  j  d k } |  j rJ | j ƒ  rJ t d ƒ ‚ n  |  j rn | j ƒ  rn t d ƒ ‚ n  | | f S(   s  Check the inputs for being in the bounds of the interpolated data.

        Parameters
        ----------
        x_new : array

        Returns
        -------
        out_of_bounds : bool array
            The mask on x_new of values that are out of the bounds.
        i    iÿÿÿÿs2   A value in x_new is below the interpolation range.s2   A value in x_new is above the interpolation range.(   R,   RI   R`   R?   (   RS   R­   R½   R¾   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR¼   j  s    N(   Rj   Rk   Rl   Rm   RH   R@   Rº   Rn   R^   t   propertyRJ   t   setterR‘   R’   R   Rš   R™   R¿   R¼   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   A  s   Pe"						t
   _PPolyBasec           B` se   e  Z d  Z d Z d d d „ Z d „  Z e d d d „ ƒ Z d	 „  Z	 d d
 „ Z
 d d d „ Z RS(   s%   Base class for piecewise polynomials.RZ   R,   Ry   R|   i    c         C` s2  t  j | ƒ |  _ t  j | d t  j ƒ|  _ | d  k rB t } n | d k r] t | ƒ } n  | |  _	 d | k o‡ |  j j
 d k  n s¬ t d | | j
 d f ƒ ‚ n  | |  _ | d k rü t  j |  j | d ƒ |  _ t  j |  j | d ƒ |  _ n  |  j j
 d k rt d ƒ ‚ n  |  j j d k  r>t d ƒ ‚ n  |  j j
 d k  r_t d	 ƒ ‚ n  |  j j d d k r„t d
 ƒ ‚ n  |  j j d |  j j d k r³t d ƒ ‚ n  t  j |  j ƒ } t  j | d k ƒ pìt  j | d k ƒ sþt d ƒ ‚ n  |  j |  j j ƒ } t  j |  j d | ƒ|  _ d  S(   NRq   t   periodici    i   s   %s must be between 0 and %ss   x must be 1-dimensionali   s!   at least 2 breakpoints are neededs!   c must have at least 2 dimensionss&   polynomial must be at least of order 0s"   number of coefficients != len(x)-1s.   `x` must be strictly increasing or decreasing.(   R@   R   RZ   t   ascontiguousarrayt   float64R,   RH   Rm   t   boolRy   R=   R?   R|   t   rollaxisR<   R>   t   diffRA   t
   _get_dtypeRq   (   RS   RZ   R,   Ry   R|   Rb   Rq   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR^   Ž  s8    		& 	 *c         C` sB   t  j | t  j ƒ s0 t  j |  j j t  j ƒ r7 t  j St  j Sd  S(   N(   R@   t
   issubdtypet   complexfloatingRZ   Rq   t   complex_R‰   (   RS   Rq   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÉ   ·  s    c         C` sL   t  j |  ƒ } | | _ | | _ | | _ | d k r? t } n  | | _ | S(   sA  
        Construct the piecewise polynomial without making checks.

        Takes the same parameters as the constructor. Input arguments
        `c` and `x` must be arrays of the correct shape and type.  The
        `c` array can only be of dtypes float and complex, and `x`
        array must have dtype float.
        N(   t   objectt   __new__RZ   R,   R|   RH   Rm   Ry   (   t   clsRZ   R,   Ry   R|   RS   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   construct_fast¾  s    
					c         C` sL   |  j  j j s$ |  j  j ƒ  |  _  n  |  j j j sH |  j j ƒ  |  _ n  d S(   sr   
        c and x may be modified by the user. The Cython code expects
        that they are C contiguous.
        N(   R,   t   flagst   c_contiguousR;   RZ   (   RS   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _ensure_c_contiguousÑ  s    c   	      C` sÍ  | d	 k	 r t j d ƒ n  t j | ƒ } t j | ƒ } | j d k  rX t d ƒ ‚ n  | j d k rv t d ƒ ‚ n  | j d | j d k rŸ t d ƒ ‚ n  | j d |  j j d k sÑ | j |  j j k rà t d ƒ ‚ n  | j	 d k ró d	 St j
 | ƒ } t j | d k ƒ p)t j | d k ƒ s;t d
 ƒ ‚ n  |  j d |  j d k rÇ| d | d k sxt d ƒ ‚ n  | d |  j d k r˜d } q6| d |  j d k r¸d } q6t d ƒ ‚ no | d | d k sêt d ƒ ‚ n  | d |  j d k r
d } n, | d |  j d k r*d } n t d ƒ ‚ |  j | j ƒ } t | j d |  j j d ƒ } t j | |  j j d | j d f |  j j d d | ƒ} | d k r6|  j | | |  j j d d	 … d	 |  j j d … f <| | | | j d d	 … |  j j d d	 … f <t j |  j | f |  _ nŠ | d k rÀ| | | |  j j d d	 … d	 | j d … f <|  j | | | j d d	 … | j d d	 … f <t j | |  j f |  _ n  | |  _ d	 S(   s  
        Add additional breakpoints and coefficients to the polynomial.

        Parameters
        ----------
        c : ndarray, size (k, m, ...)
            Additional coefficients for polynomials in intervals. Note that
            the first additional interval will be formed using one of the
            `self.x` end points.
        x : ndarray, size (m,)
            Additional breakpoints. Must be sorted in the same order as
            `self.x` and either to the right or to the left of the current
            breakpoints.
        right
            Deprecated argument. Has no effect.

            .. deprecated:: 0.19
        s*   `right` is deprecated and will be removed.i   s   invalid dimensions for ci   s   invalid dimensions for xi    s   x and c have incompatible sizess%   c and self.c have incompatible shapesNs   `x` is not sorted.iÿÿÿÿs,   `x` is in the different order than `self.x`.t   appendt   prepends9   `x` is neither on the left or on the right from `self.x`.Rq   (   RH   t   warningst   warnR@   R   R=   R?   R>   RZ   R<   RÈ   RA   R,   RÉ   Rq   R–   t   zerost   r_(	   RS   RZ   R,   t   rightRb   t   actionRq   t   k2t   c2(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   extendÛ  sZ    2*				 5	7111c         C` sx  | d k r |  j } n  t j | ƒ } | j | j } } t j | j ƒ  d t j ƒ} | d k rŸ |  j	 d | |  j	 d |  j	 d |  j	 d } t
 } n  t j t | ƒ t |  j j d ƒ f d |  j j ƒ} |  j ƒ  |  j | | | | ƒ | j | |  j j d ƒ } |  j d k rtt t | j ƒ ƒ } | | | |  j !| |  | | |  j } | j | ƒ } n  | S(   sX  
        Evaluate the piecewise polynomial or its derivative.

        Parameters
        ----------
        x : array_like
            Points to evaluate the interpolant at.
        nu : int, optional
            Order of derivative to evaluate. Must be non-negative.
        extrapolate : {bool, 'periodic', None}, optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used.
            If None (default), use `self.extrapolate`.

        Returns
        -------
        y : array_like
            Interpolated values. Shape is determined by replacing
            the interpolation axis in the original array with the shape of x.

        Notes
        -----
        Derivatives are evaluated piecewise for each polynomial
        segment, even if the polynomial is not differentiable at the
        breakpoints. The polynomial intervals are considered half-open,
        ``[a, b)``, except for the last interval which is closed
        ``[a, b]``.
        Rq   RÃ   i    iÿÿÿÿi   N(   RH   Ry   R@   R   R>   R=   RÄ   R   R‰   R,   Rn   t   emptyR'   R-   RZ   Rq   RÓ   R¿   t   reshapeR|   t   listR¥   R   (   RS   R,   t   nuRy   t   x_shapet   x_ndimR»   t   l(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRi   .  s"    2	7
+(   RZ   R,   s   extrapolates   axisN(   Rj   Rk   Rl   t	   __slots__RH   R^   RÉ   t   classmethodRÐ   RÓ   RÞ   Ri   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÂ   Š  s   )		
Sc           B` s€   e  Z d  Z d „  Z d d „ Z d d „ Z d d „ Z d e d d „ Z	 e d d „ Z
 e d d	 „ ƒ Z e d d
 „ ƒ Z RS(   sV  
    Piecewise polynomial in terms of coefficients and breakpoints

    The polynomial between ``x[i]`` and ``x[i + 1]`` is written in the
    local power basis::

        S = sum(c[m, i] * (xp - x[i])**(k-m) for m in range(k+1))

    where ``k`` is the degree of the polynomial.

    Parameters
    ----------
    c : ndarray, shape (k, m, ...)
        Polynomial coefficients, order `k` and `m` intervals
    x : ndarray, shape (m+1,)
        Polynomial breakpoints. Must be sorted in either increasing or
        decreasing order.
    extrapolate : bool or 'periodic', optional
        If bool, determines whether to extrapolate to out-of-bounds points
        based on first and last intervals, or to return NaNs. If 'periodic',
        periodic extrapolation is used. Default is True.
    axis : int, optional
        Interpolation axis. Default is zero.

    Attributes
    ----------
    x : ndarray
        Breakpoints.
    c : ndarray
        Coefficients of the polynomials. They are reshaped
        to a 3-dimensional array with the last dimension representing
        the trailing dimensions of the original coefficient array.
    axis : int
        Interpolation axis.

    Methods
    -------
    __call__
    derivative
    antiderivative
    integrate
    solve
    roots
    extend
    from_spline
    from_bernstein_basis
    construct_fast

    See also
    --------
    BPoly : piecewise polynomials in the Bernstein basis

    Notes
    -----
    High-order polynomials in the power basis can be numerically
    unstable.  Precision problems can start to appear for orders
    larger than 20-30.
    c         C` sO   t  j |  j j |  j j d |  j j d d ƒ |  j | | t | ƒ | ƒ d  S(   Ni    i   iÿÿÿÿ(   R"   t   evaluateRZ   Rà   R>   R,   RÆ   (   RS   R,   Râ   Ry   R»   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR¿   Ÿ  s    /i   c         C` s  | d k  r |  j  | ƒ S| d k r8 |  j j ƒ  } n& |  j d | … d d … f j ƒ  } | j d d k r— t j d | j d d | j ƒ} n  t j t j	 | j d d d ƒ | ƒ } | | t
 d ƒ f d | j d 9} |  j | |  j |  j |  j ƒ S(   s  
        Construct a new piecewise polynomial representing the derivative.

        Parameters
        ----------
        nu : int, optional
            Order of derivative to evaluate. Default is 1, i.e. compute the
            first derivative. If negative, the antiderivative is returned.

        Returns
        -------
        pp : PPoly
            Piecewise polynomial of order k2 = k - n representing the derivative
            of this polynomial.

        Notes
        -----
        Derivatives are evaluated piecewise for each polynomial
        segment, even if the polynomial is not differentiable at the
        breakpoints. The polynomial intervals are considered half-open,
        ``[a, b)``, except for the last interval which is closed
        ``[a, b]``.
        i    Ni   Rq   iÿÿÿÿ(   i   (   N(   t   antiderivativeRZ   R;   R>   R@   RØ   Rq   t   spect   pocht   aranget   sliceRH   R=   RÐ   R,   Ry   R|   (   RS   Râ   RÝ   t   factor(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt
   derivative£  s    &&(&c         C` sE  | d k r |  j  | ƒ St j |  j j d | |  j j d f |  j j d d |  j j ƒ} |  j | | *t j t j |  j j d d d ƒ | ƒ } | | c  | t	 d ƒ f d | j d *|  j ƒ  t j | j | j d | j d d ƒ |  j | d ƒ |  j d k r t } n	 |  j } |  j | |  j | |  j ƒ S(	   s<  
        Construct a new piecewise polynomial representing the antiderivative.

        Antiderivative is also the indefinite integral of the function,
        and derivative is its inverse operation.

        Parameters
        ----------
        nu : int, optional
            Order of antiderivative to evaluate. Default is 1, i.e. compute
            the first integral. If negative, the derivative is returned.

        Returns
        -------
        pp : PPoly
            Piecewise polynomial of order k2 = k + n representing
            the antiderivative of this polynomial.

        Notes
        -----
        The antiderivative returned by this function is continuous and
        continuously differentiable to order n-1, up to floating point
        rounding error.

        If antiderivative is computed and ``self.extrapolate='periodic'``,
        it will be set to False for the returned instance. This is done because
        the antiderivative is no longer periodic and its correct evaluation
        outside of the initially given x interval is difficult.
        i    i   i   Rq   iÿÿÿÿRÃ   N(   N(   Rï   R@   RØ   RZ   R>   Rq   Rê   Rë   Rì   Rí   RH   R=   RÓ   R"   t   fix_continuityRà   R,   Ry   Rn   RÐ   R|   (   RS   Râ   RZ   Rî   Ry   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRé   Ï  s    8+-
&		c         C` sä  | d k r |  j } n  d } | | k  r@ | | } } d } n  t j t |  j j d ƒ f d |  j j ƒ} |  j ƒ  | d k ru|  j	 d |  j	 d } } | | } | | }	 t
 |	 | ƒ \ }
 } |
 d k r)t j |  j j |  j j d |  j j d d ƒ |  j	 | | t d | ƒ| |
 9} n | j d ƒ | | | | } | | } t j | ƒ } | | k rÂt j |  j j |  j j d |  j j d d ƒ |  j	 | | t d | ƒ| | 7} qÃt j |  j j |  j j d |  j j d d ƒ |  j	 | | t d | ƒ| | 7} t j |  j j |  j j d |  j j d d ƒ |  j	 | | | | | t d | ƒ| | 7} nN t j |  j j |  j j d |  j j d d ƒ |  j	 | | t | ƒ d | ƒ| | 9} | j |  j j d ƒ S(	   s˜  
        Compute a definite integral over a piecewise polynomial.

        Parameters
        ----------
        a : float
            Lower integration bound
        b : float
            Upper integration bound
        extrapolate : {bool, 'periodic', None}, optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used.
            If None (default), use `self.extrapolate`.

        Returns
        -------
        ig : array_like
            Definite integral of the piecewise polynomial over [a, b]
        i   iÿÿÿÿi   Rq   RÃ   i    R»   N(   RH   Ry   R@   Rß   R-   RZ   R>   Rq   RÓ   R,   t   divmodR"   t	   integrateRà   Rn   t   fillt
   empty_likeRÆ   (   RS   R]   t   bRy   t   signt	   range_intt   xst   xet   periodt   intervalt	   n_periodsR¹   t   remainder_int(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRò     sP    	.


)
))
)%)
g        c         C` s)  | d k r |  j } n  |  j ƒ  t j |  j j t j ƒ rL t d ƒ ‚ n  t	 | ƒ } t
 j |  j j |  j j d |  j j d d ƒ |  j | t | ƒ t | ƒ ƒ } |  j j d k rÂ | d St j t |  j j d ƒ d t ƒ} x$ t | ƒ D] \ } } | | | <qô W| j |  j j d ƒ Sd S(   s‡  
        Find real solutions of the the equation ``pp(x) == y``.

        Parameters
        ----------
        y : float, optional
            Right-hand side. Default is zero.
        discontinuity : bool, optional
            Whether to report sign changes across discontinuities at
            breakpoints as roots.
        extrapolate : {bool, 'periodic', None}, optional
            If bool, determines whether to return roots from the polynomial
            extrapolated based on first and last intervals, 'periodic' works
            the same as False. If None (default), use `self.extrapolate`.

        Returns
        -------
        roots : ndarray
            Roots of the polynomial(s).

            If the PPoly object describes multiple polynomials, the
            return value is an object array whose each element is an
            ndarray containing the roots.

        Notes
        -----
        This routine works only on real-valued polynomials.

        If the piecewise polynomial contains sections that are
        identically zero, the root list will contain the start point
        of the corresponding interval, followed by a ``nan`` value.

        If the polynomial is discontinuous across a breakpoint, and
        there is a sign change across the breakpoint, this is reported
        if the `discont` parameter is True.

        Examples
        --------

        Finding roots of ``[x**2 - 1, (x - 1)**2]`` defined on intervals
        ``[-2, 1], [1, 2]``:

        >>> from scipy.interpolate import PPoly
        >>> pp = PPoly(np.array([[1, -4, 3], [1, 0, 0]]).T, [-2, 1, 2])
        >>> pp.roots()
        array([-1.,  1.])
        s0   Root finding is only for real-valued polynomialsi    i   iÿÿÿÿi   Rq   N(   RH   Ry   RÓ   R@   RÊ   RZ   Rq   RË   R?   t   floatR"   t
   real_rootsRà   R>   R,   RÆ   R=   Rß   R-   RÍ   t	   enumerate(   RS   RK   t   discontinuityRy   t   rt   r2R«   t   root(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   solveW  s    0
/%c         C` s   |  j  d | | ƒ S(   s_  
        Find real roots of the the piecewise polynomial.

        Parameters
        ----------
        discontinuity : bool, optional
            Whether to report sign changes across discontinuities at
            breakpoints as roots.
        extrapolate : {bool, 'periodic', None}, optional
            If bool, determines whether to return roots from the polynomial
            extrapolated based on first and last intervals, 'periodic' works
            the same as False. If None (default), use `self.extrapolate`.

        Returns
        -------
        roots : ndarray
            Roots of the polynomial(s).

            If the PPoly object describes multiple polynomials, the
            return value is an object array whose each element is an
            ndarray containing the roots.

        See Also
        --------
        PPoly.solve
        i    (   R  (   RS   R  Ry   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   rootsŸ  s    c   	      C` sî   t  | t ƒ r< | j \ } } } | d k rK | j } qK n | \ } } } t j | d t | ƒ d f d | j ƒ} xa t	 | d d ƒ D]M } t
 j | d  | d | ƒ} | t j | d ƒ | | | d d … f <qŠ W|  j | | | ƒ S(   sÆ  
        Construct a piecewise polynomial from a spline

        Parameters
        ----------
        tck
            A spline, as returned by `splrep` or a BSpline object.
        extrapolate : bool or 'periodic', optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used. Default is True.
        i   Rq   iÿÿÿÿt   derN(   Rz   R&   RF   RH   Ry   R@   Rß   R'   Rq   R   R   t   splevRê   t   gammaRÐ   (	   RÏ   RF   Ry   Rv   RZ   R3   t   cvalst   mRK   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   from_spline¼  s    ,/c      	   C` s+  t  j | j ƒ } | j j d d } d | j j d } t  j | j ƒ } x¨ t | d ƒ D]– } d | t	 | | ƒ | j | } xk t | | d ƒ D]V }	 t	 | | |	 | ƒ d |	 }
 | | |	 c | |
 | t
 d ƒ f | |	 7<q™ Wq] W| d k r| j } n  |  j | | j | | j ƒ S(   sû  
        Construct a piecewise polynomial in the power basis
        from a polynomial in Bernstein basis.

        Parameters
        ----------
        bp : BPoly
            A Bernstein basis polynomial, as created by BPoly
        extrapolate : bool or 'periodic', optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used. Default is True.
        i    i   i   iÿÿÿÿN(   N(   R@   RÈ   R,   RZ   R>   RH   R=   t
   zeros_likeR¥   R   Rí   Ry   RÐ   R|   (   RÏ   t   bpRy   Rb   R3   t   restRZ   R]   Rî   R:   t   val(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   from_bernstein_basisØ  s    "9N(   Rj   Rk   Rl   R¿   Rï   Ré   RH   Rò   Rm   R  R  Rç   R  R  (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   d  s   :	,6RHc           B` s›   e  Z d  Z d „  Z d d „ Z d d „ Z d d „ Z d d „ Z e	 j j e _ e
 d d „ ƒ Z e
 d d d „ ƒ Z e d	 „  ƒ Z e d
 „  ƒ Z RS(   s_	  Piecewise polynomial in terms of coefficients and breakpoints.

    The polynomial between ``x[i]`` and ``x[i + 1]`` is written in the
    Bernstein polynomial basis::

        S = sum(c[a, i] * b(a, k; x) for a in range(k+1)),

    where ``k`` is the degree of the polynomial, and::

        b(a, k; x) = binom(k, a) * t**a * (1 - t)**(k - a),

    with ``t = (x - x[i]) / (x[i+1] - x[i])`` and ``binom`` is the binomial
    coefficient.

    Parameters
    ----------
    c : ndarray, shape (k, m, ...)
        Polynomial coefficients, order `k` and `m` intervals
    x : ndarray, shape (m+1,)
        Polynomial breakpoints. Must be sorted in either increasing or
        decreasing order.
    extrapolate : bool, optional
        If bool, determines whether to extrapolate to out-of-bounds points
        based on first and last intervals, or to return NaNs. If 'periodic',
        periodic extrapolation is used. Default is True.
    axis : int, optional
        Interpolation axis. Default is zero.

    Attributes
    ----------
    x : ndarray
        Breakpoints.
    c : ndarray
        Coefficients of the polynomials. They are reshaped
        to a 3-dimensional array with the last dimension representing
        the trailing dimensions of the original coefficient array.
    axis : int
        Interpolation axis.

    Methods
    -------
    __call__
    extend
    derivative
    antiderivative
    integrate
    construct_fast
    from_power_basis
    from_derivatives

    See also
    --------
    PPoly : piecewise polynomials in the power basis

    Notes
    -----
    Properties of Bernstein polynomials are well documented in the literature.
    Here's a non-exhaustive list:

    .. [1] http://en.wikipedia.org/wiki/Bernstein_polynomial

    .. [2] Kenneth I. Joy, Bernstein polynomials,
      http://www.idav.ucdavis.edu/education/CAGDNotes/Bernstein-Polynomials.pdf

    .. [3] E. H. Doha, A. H. Bhrawy, and M. A. Saker, Boundary Value Problems,
         vol 2011, article ID 829546, :doi:`10.1155/2011/829543`.

    Examples
    --------
    >>> from scipy.interpolate import BPoly
    >>> x = [0, 1]
    >>> c = [[1], [2], [3]]
    >>> bp = BPoly(c, x)

    This creates a 2nd order polynomial

    .. math::

        B(x) = 1 \times b_{0, 2}(x) + 2 \times b_{1, 2}(x) + 3 \times b_{2, 2}(x) \\
             = 1 \times (1-x)^2 + 2 \times 2 x (1 - x) + 3 \times x^2

    c         C` sO   t  j |  j j |  j j d |  j j d d ƒ |  j | | t | ƒ | ƒ d  S(   Ni    i   iÿÿÿÿ(   R"   t   evaluate_bernsteinRZ   Rà   R>   R,   RÆ   (   RS   R,   Râ   Ry   R»   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR¿   M  s    )i   c         C` s7  | d k  r |  j  | ƒ S| d k rS |  } x  t | ƒ D] } | j ƒ  } q9 W| S| d k rq |  j j ƒ  } nn d |  j j d } |  j j d d } t j	 |  j
 ƒ d t d ƒ f | } | t j	 |  j d d ƒ| } | j d d k rt j d | j d d | j ƒ} n  |  j | |  j
 |  j |  j ƒ S(	   sÎ  
        Construct a new piecewise polynomial representing the derivative.

        Parameters
        ----------
        nu : int, optional
            Order of derivative to evaluate. Default is 1, i.e. compute the
            first derivative. If negative, the antiderivative is returned.

        Returns
        -------
        bp : BPoly
            Piecewise polynomial of order k - nu representing the derivative of
            this polynomial.

        i    i   i   R|   Rq   N(   N(   i   (   Ré   R¥   Rï   RZ   R;   RH   R=   R>   R@   RÈ   R,   Rí   RØ   Rq   RÐ   Ry   R|   (   RS   Râ   R  R3   RÝ   R  Rb   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRï   R  s     & &c   	      C` sƒ  | d k r |  j  | ƒ S| d k rS |  } x  t | ƒ D] } | j ƒ  } q9 W| S|  j |  j } } | j d } t j | d f | j d d | j ƒ} t j	 | d d ƒ| | d d … d f <| d | d  } | | d t d ƒ f d
 | j d 9} | d d … d d … f c t j	 | | d d … f d d ƒd  7<|  j d	 k r^t } n	 |  j } |  j | | | d |  j ƒS(   s  
        Construct a new piecewise polynomial representing the antiderivative.

        Parameters
        ----------
        nu : int, optional
            Order of antiderivative to evaluate. Default is 1, i.e. compute
            the first integral. If negative, the derivative is returned.

        Returns
        -------
        bp : BPoly
            Piecewise polynomial of order k + nu representing the
            antiderivative of this polynomial.

        Notes
        -----
        If antiderivative is computed and ``self.extrapolate='periodic'``,
        it will be set to False for the returned instance. This is done because
        the antiderivative is no longer periodic and its correct evaluation
        outside of the initially given x interval is difficult.
        i    i   Rq   R|   N.iÿÿÿÿi   RÃ   (   N(   Rï   R¥   Ré   RZ   R,   R>   R@   RØ   Rq   t   cumsumRH   Rí   R=   Ry   Rn   RÐ   R|   (	   RS   Râ   R  R3   RZ   R,   RÝ   t   deltaRy   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRé   ‡  s$    *))E		c         C` sm  |  j  ƒ  } | d k r$ |  j } n  | d k r< | | _ n  | d k rU| | k r] d } n | | } } d } |  j d |  j d } } | | } | | }	 t |	 | ƒ \ }
 } |
 | | ƒ | | ƒ } | | | | } | | } | | k r| | | ƒ | | ƒ 7} n: | | | ƒ | | ƒ | | | | | ƒ | | ƒ 7} | | S| | ƒ | | ƒ Sd S(   st  
        Compute a definite integral over a piecewise polynomial.

        Parameters
        ----------
        a : float
            Lower integration bound
        b : float
            Upper integration bound
        extrapolate : {bool, 'periodic', None}, optional
            Whether to extrapolate to out-of-bounds points based on first
            and last intervals, or to return NaNs. If 'periodic', periodic
            extrapolation is used. If None (default), use `self.extrapolate`.

        Returns
        -------
        array_like
            Definite integral of the piecewise polynomial over [a, b]

        RÃ   i   iÿÿÿÿi    N(   Ré   RH   Ry   R,   Rñ   (   RS   R]   Rõ   Ry   t   ibRö   Rø   Rù   Rú   Rû   Rü   R¹   t   res(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRò   ¿  s,    	


:c         C` sy   t  |  j j d | j d ƒ } |  j |  j | |  j j d ƒ |  _ |  j | | | j d ƒ } t j |  | | | ƒ S(   Ni    (   R–   RZ   R>   t   _raise_degreeRÂ   RÞ   (   RS   RZ   R,   RÚ   R3   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÞ   ÿ  s     &c   
   
   C` s  t  j | j ƒ } | j j d d } d | j j d } t  j | j ƒ } x– t | d ƒ D]„ } | j | t	 | | | ƒ | t
 d ƒ f | | | } x@ t | | | d ƒ D]' }	 | |	 c | t	 |	 | | ƒ 7<q¶ Wq] W| d k rý | j } n  |  j | | j | | j ƒ S(   sì  
        Construct a piecewise polynomial in Bernstein basis
        from a power basis polynomial.

        Parameters
        ----------
        pp : PPoly
            A piecewise polynomial in the power basis
        extrapolate : bool or 'periodic', optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used. Default is True.
        i    i   i   N(   N(   R@   RÈ   R,   RZ   R>   RH   R=   R  R¥   R   Rí   Ry   RÐ   R|   (
   RÏ   t   ppRy   Rb   R3   R  RZ   R]   Rî   R1   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   from_power_basis  s    ;)c         ` s  t  j | ƒ } t | ƒ t ˆ  ƒ k r6 t d ƒ ‚ n  t  j | d | d  d k ƒ rf t d ƒ ‚ n  t | ƒ d } y& t ‡  f d †  t | ƒ Dƒ ƒ } Wn t k
 r» t d ƒ ‚ n X| d k rØ d g | } nb t	 | t
 t  j f ƒ r | g | } n  t | t | ƒ ƒ } t d „  | Dƒ ƒ r:t d ƒ ‚ n  g  } x£t | ƒ D]•} ˆ  | ˆ  | d }	 }
 | | d k r˜t |	 ƒ t |
 ƒ } } nà | | d } t | d	 t |	 ƒ ƒ } t | | t |
 ƒ ƒ } t | | t |
 ƒ ƒ } | | | k rEd
 | | t |	 ƒ | | d t |
 ƒ | | f } t | ƒ ‚ n  | t |	 ƒ k of| t |
 ƒ k sxt d ƒ ‚ n  t j | | | | d |	 |  |
 |  ƒ } t | ƒ | k  rÕt j | | t | ƒ ƒ } n  | j | ƒ qMWt  j | ƒ } |  | j d d ƒ | | ƒ S(   s0
  Construct a piecewise polynomial in the Bernstein basis,
        compatible with the specified values and derivatives at breakpoints.

        Parameters
        ----------
        xi : array_like
            sorted 1D array of x-coordinates
        yi : array_like or list of array_likes
            ``yi[i][j]`` is the ``j``-th derivative known at ``xi[i]``
        orders : None or int or array_like of ints. Default: None.
            Specifies the degree of local polynomials. If not None, some
            derivatives are ignored.
        extrapolate : bool or 'periodic', optional
            If bool, determines whether to extrapolate to out-of-bounds points
            based on first and last intervals, or to return NaNs.
            If 'periodic', periodic extrapolation is used. Default is True.

        Notes
        -----
        If ``k`` derivatives are specified at a breakpoint ``x``, the
        constructed polynomial is exactly ``k`` times continuously
        differentiable at ``x``, unless the ``order`` is provided explicitly.
        In the latter case, the smoothness of the polynomial at
        the breakpoint is controlled by the ``order``.

        Deduces the number of derivatives to match at each end
        from ``order`` and the number of derivatives available. If
        possible it uses the same number of derivatives from
        each end; if the number is odd it tries to take the
        extra one from y2. In any case if not enough derivatives
        are available at one end or another it draws enough to
        make up the total from the other end.

        If the order is too high and not enough derivatives are available,
        an exception is raised.

        Examples
        --------

        >>> from scipy.interpolate import BPoly
        >>> BPoly.from_derivatives([0, 1], [[1, 2], [3, 4]])

        Creates a polynomial `f(x)` of degree 3, defined on `[0, 1]`
        such that `f(0) = 1, df/dx(0) = 2, f(1) = 3, df/dx(1) = 4`

        >>> BPoly.from_derivatives([0, 1, 2], [[0, 1], [0], [2]])

        Creates a piecewise polynomial `f(x)`, such that
        `f(0) = f(1) = 0`, `f(2) = 2`, and `df/dx(0) = 1`.
        Based on the number of derivatives provided, the order of the
        local polynomials is 2 on `[0, 1]` and 1 on `[1, 2]`.
        Notice that no restriction is imposed on the derivatives at
        `x = 1` and `x = 2`.

        Indeed, the explicit form of the polynomial is::

            f(x) = | x * (1 - x),  0 <= x < 1
                   | 2 * (x - 1),  1 <= x <= 2

        So that f'(1-0) = -1 and f'(1+0) = 2

        s&   xi and yi need to have the same lengthi   i    s)   x coordinates are not in increasing orderc         3` s1   |  ]' } t  ˆ  | ƒ t  ˆ  | d  ƒ Vq d S(   i   N(   R'   (   t   .0t   i(   t   yi(    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>p  s    s/   Using a 1D array for y? Please .reshape(-1, 1).c         s` s   |  ] } | d  k Vq d S(   i    N(    (   R  t   o(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>{  s    s   Orders must be positive.i   sP   Point %g has %d derivatives, point %g has %d derivatives, but order %d requesteds0   `order` input incompatible with length y1 or y2.N(   R@   R   R'   R?   R`   R–   R¥   t	   TypeErrorRH   Rz   R   t   integerR•   R   t   _construct_from_derivativesR  RÔ   t   swapaxes(   RÏ   t   xiR  t   ordersRy   R  R3   RZ   R  t   y1t   y2t   n1t   n2t   nt   mesgRõ   (    (   R  s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   from_derivatives%  sN    @!&2$c         C` s!  t  j | ƒ t  j | ƒ } } | j d | j d k rH t d ƒ ‚ n  | j | j } } t  j | t  j ƒ s… t  j | t  j ƒ r‘ t  j } n	 t  j } t	 | ƒ t	 | ƒ } } | | }	 t  j
 | | f | j d d | ƒ}
 xŒ t d | ƒ D]{ } | | t j |	 | | ƒ | |  | |
 | <xD t d | ƒ D]3 } |
 | c d | | t | | ƒ |
 | 8<q8Wqô Wx§ t d | ƒ D]– } | | t j |	 | | ƒ d | | |  | |
 | d <xR t d | ƒ D]A } |
 | d c d | d t | | d ƒ |
 | | 8<qÔWqƒW|
 S(   sY  Compute the coefficients of a polynomial in the Bernstein basis
        given the values and derivatives at the edges.

        Return the coefficients of a polynomial in the Bernstein basis
        defined on `[xa, xb]` and having the values and derivatives at the
        endpoints ``xa`` and ``xb`` as specified by ``ya`` and ``yb``.
        The polynomial constructed is of the minimal possible degree, i.e.,
        if the lengths of ``ya`` and ``yb`` are ``na`` and ``nb``, the degree
        of the polynomial is ``na + nb - 1``.

        Parameters
        ----------
        xa : float
            Left-hand end point of the interval
        xb : float
            Right-hand end point of the interval
        ya : array_like
            Derivatives at ``xa``. ``ya[0]`` is the value of the function, and
            ``ya[i]`` for ``i > 0`` is the value of the ``i``-th derivative.
        yb : array_like
            Derivatives at ``xb``.

        Returns
        -------
        array
            coefficient array of a polynomial having specified derivatives

        Notes
        -----
        This uses several facts from life of Bernstein basis functions.
        First of all,

            .. math:: b'_{a, n} = n (b_{a-1, n-1} - b_{a, n-1})

        If B(x) is a linear combination of the form

            .. math:: B(x) = \sum_{a=0}^{n} c_a b_{a, n},

        then :math: B'(x) = n \sum_{a=0}^{n-1} (c_{a+1} - c_{a}) b_{a, n-1}.
        Iterating the latter one, one finds for the q-th derivative

            .. math:: B^{q}(x) = n!/(n-q)! \sum_{a=0}^{n-q} Q_a b_{a, n-q},

        with

          .. math:: Q_a = \sum_{j=0}^{q} (-)^{j+q} comb(q, j) c_{j+a}

        This way, only `a=0` contributes to :math: `B^{q}(x = xa)`, and
        `c_q` are found one by one by iterating `q = 0, ..., na`.

        At `x = xb` it's the same with `a = n - q`.

        i   s'   ya and yb have incompatible dimensions.Rq   i    iÿÿÿÿ(   R@   R   R>   R?   Rq   RÊ   RË   RÌ   R‰   R'   Rß   R¥   Rê   Rë   R   (   t   xat   xbt   yat   ybt   dtat   dtbt   dtt   nat   nbR(  RZ   t   qR1   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   ›  s(    7	
'.5;Cc      
   C` sÜ   | d k r |  S|  j  d d } t j |  j  d | f |  j  d d |  j ƒ} xƒ t |  j  d ƒ D]n } |  | t | | ƒ } xN t | d ƒ D]< } | | | c | t | | ƒ t | | | | ƒ 7<q” Wqf W| S(   s	  Raise a degree of a polynomial in the Bernstein basis.

        Given the coefficients of a polynomial degree `k`, return (the
        coefficients of) the equivalent polynomial of degree `k+d`.

        Parameters
        ----------
        c : array_like
            coefficient array, 1D
        d : integer

        Returns
        -------
        array
            coefficient array, 1D array of length `c.shape[0] + d`

        Notes
        -----
        This uses the fact that a Bernstein polynomial `b_{a, k}` can be
        identically represented as a linear combination of polynomials of
        a higher degree `k+d`:

            .. math:: b_{a, k} = comb(k, a) \sum_{j=0}^{d} b_{a+j, k+d} \
                                 comb(d, j) / comb(k+d, a+j)

        i    i   Rq   (   R>   R@   RØ   Rq   R¥   R   (   RZ   t   dR3   R»   R]   Rw   R1   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR  ñ  s    1>N(   Rj   Rk   Rl   R¿   Rï   Ré   RH   Rò   RÞ   RÂ   Rç   R  R*  t   staticmethodR   R  (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   ù  s   R	58@uVc           B` s‰   e  Z d  Z d d „ Z e d d „ ƒ Z d „  Z d „  Z d d d „ Z	 d „  Z
 d „  Z d „  Z d	 „  Z d d
 „ Z d d „ Z RS(   s  
    Piecewise tensor product polynomial

    The value at point `xp = (x', y', z', ...)` is evaluated by first
    computing the interval indices `i` such that::

        x[0][i[0]] <= x' < x[0][i[0]+1]
        x[1][i[1]] <= y' < x[1][i[1]+1]
        ...

    and then computing::

        S = sum(c[k0-m0-1,...,kn-mn-1,i[0],...,i[n]]
                * (xp[0] - x[0][i[0]])**m0
                * ...
                * (xp[n] - x[n][i[n]])**mn
                for m0 in range(k[0]+1)
                ...
                for mn in range(k[n]+1))

    where ``k[j]`` is the degree of the polynomial in dimension j. This
    representation is the piecewise multivariate power basis.

    Parameters
    ----------
    c : ndarray, shape (k0, ..., kn, m0, ..., mn, ...)
        Polynomial coefficients, with polynomial order `kj` and
        `mj+1` intervals for each dimension `j`.
    x : ndim-tuple of ndarrays, shapes (mj+1,)
        Polynomial breakpoints for each dimension. These must be
        sorted in increasing order.
    extrapolate : bool, optional
        Whether to extrapolate to out-of-bounds points based on first
        and last intervals, or to return NaNs. Default: True.

    Attributes
    ----------
    x : tuple of ndarrays
        Breakpoints.
    c : ndarray
        Coefficients of the polynomials.

    Methods
    -------
    __call__
    construct_fast

    See also
    --------
    PPoly : piecewise polynomials in 1D

    Notes
    -----
    High-order polynomials in the power basis can be numerically
    unstable.

    c         C` sk  t  d „  | Dƒ ƒ |  _ t j | ƒ |  _ | d  k r@ t } n  t | ƒ |  _ t	 |  j ƒ } t
 d „  |  j Dƒ ƒ r† t d ƒ ‚ n  t
 d „  |  j Dƒ ƒ r® t d ƒ ‚ n  | j d | k  rÐ t d ƒ ‚ n  t
 d „  |  j Dƒ ƒ rø t d	 ƒ ‚ n  t
 d
 „  t | j | d | !|  j ƒ Dƒ ƒ r7t d ƒ ‚ n  |  j |  j j ƒ } t j |  j d | ƒ|  _ d  S(   Nc         s` s'   |  ] } t  j | d  t  j ƒVq d S(   Rq   N(   R@   RÄ   RÅ   (   R  t   v(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>V  s    c         s` s   |  ] } | j  d  k Vq d S(   i   N(   R=   (   R  R7  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>]  s    s"   x arrays must all be 1-dimensionalc         s` s   |  ] } | j  d  k  Vq d S(   i   N(   R<   (   R  R7  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>_  s    s+   x arrays must all contain at least 2 pointsi   s(   c must have at least 2*len(x) dimensionsc         s` s0   |  ]& } t  j | d  | d  d k  ƒ Vq d S(   i   iÿÿÿÿi    N(   R@   R`   (   R  R7  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>c  s    s)   x-coordinates are not in increasing orderc         s` s(   |  ] \ } } | | j  d  k Vq d S(   i   N(   R<   (   R  R]   Rõ   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pys	   <genexpr>e  s    s/   x and c do not agree on the number of intervalsRq   (   R¤   R,   R@   R   RZ   RH   Rm   RÆ   Ry   R'   R`   R?   R=   Ro   R>   RÉ   Rq   RÄ   (   RS   RZ   R,   Ry   R=   Rq   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR^   U  s$    	0c         C` sC   t  j |  ƒ } | | _ | | _ | d k r6 t } n  | | _ | S(   sB  
        Construct the piecewise polynomial without making checks.

        Takes the same parameters as the constructor. Input arguments
        `c` and `x` must be arrays of the correct shape and type.  The
        `c` array can only be of dtypes float and complex, and `x`
        array must have dtype float.

        N(   RÍ   RÎ   RZ   R,   RH   Rm   Ry   (   RÏ   RZ   R,   Ry   RS   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÐ   k  s    				c         C` sB   t  j | t  j ƒ s0 t  j |  j j t  j ƒ r7 t  j St  j Sd  S(   N(   R@   RÊ   RË   RZ   Rq   RÌ   R‰   (   RS   Rq   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÉ   ~  s    c         C` sO   |  j  j j s$ |  j  j ƒ  |  _  n  t |  j t ƒ sK t |  j ƒ |  _ n  d  S(   N(   RZ   RÑ   RÒ   R;   Rz   R,   R¤   (   RS   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRÓ   …  s    c      	   C` sä  | d k r |  j } n t | ƒ } t |  j ƒ } t | ƒ } | j } t j | j	 d | j d ƒ d t j
 ƒ} | d k r t j | f d t j ƒ} nI t j | d t j ƒ} | j d k s× | j d | k ræ t d ƒ ‚ n  t |  j j |  ƒ } t |  j j | d | !ƒ } t |  j j d | ƒ } t j |  j j |  d t j ƒ}	 t j | j d | f d |  j j ƒ}
 |  j ƒ  t j |  j j	 | | | ƒ |  j |	 | | t | ƒ |
 ƒ |
 j	 | d  |  j j d | ƒ S(   sÇ  
        Evaluate the piecewise polynomial or its derivative

        Parameters
        ----------
        x : array-like
            Points to evaluate the interpolant at.
        nu : tuple, optional
            Orders of derivatives to evaluate. Each must be non-negative.
        extrapolate : bool, optional
            Whether to extrapolate to out-of-bounds points based on first
            and last intervals, or to return NaNs.

        Returns
        -------
        y : array-like
            Interpolated values. Shape is determined by replacing
            the interpolation axis in the original array with the shape of x.

        Notes
        -----
        Derivatives are evaluated piecewise for each polynomial
        segment, even if the polynomial is not differentiable at the
        breakpoints. The polynomial intervals are considered half-open,
        ``[a, b)``, except for the last interval which is closed
        ``[a, b]``.

        iÿÿÿÿRq   i   i    s&   invalid number of derivative orders nui   N(   RH   Ry   RÆ   R'   R,   R$   R>   R@   RÄ   Rà   R‰   RØ   t   intcR   R=   R?   R-   RZ   R   Rß   Rq   RÓ   R"   t   evaluate_nd(   RS   R,   Râ   Ry   R=   Rã   t   dim1t   dim2t   dim3t   ksR»   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRi   ‹  s4    	+""(
	c         C` s'  | d k  r |  j  | | ƒ St |  j ƒ } | | } | d k rF d St d ƒ g | } t d | d ƒ | | <|  j | } | j | d k rÄ t | j ƒ } d | | <t j	 | d | j
 ƒ} n  t j t j | j | d d ƒ | ƒ } d g | j } t d ƒ | | <| | | 9} | |  _ d S(   sy   
        Compute 1D derivative along a selected dimension in-place
        May result to non-contiguous c array.
        i    Ni   Rq   iÿÿÿÿ(   t   _antiderivative_inplaceR'   R,   Rí   RH   RZ   R>   Rá   R@   RØ   Rq   Rê   Rë   Rì   R=   (   RS   Râ   R|   R=   t   slRÝ   t   shpRî   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _derivative_inplaceÌ  s$    

(c   	      C` sâ  | d k r |  j  | | ƒ St |  j ƒ } | | } t t | ƒ ƒ } | | | d | d <| | <| t t | |  j j ƒ ƒ } |  j j | ƒ } t j	 | j
 d | f | j
 d d | j ƒ} | | | *t j t j | j
 d d d ƒ | ƒ } | | c  | t d ƒ f d | j d *t t | j ƒ ƒ } | | | | d | d <| | | <| j | ƒ } | j ƒ  } t j | j | j
 d | j
 d d ƒ |  j | | d ƒ | j | ƒ } | j | ƒ } | |  _ d S(   st   
        Compute 1D antiderivative along a selected dimension
        May result to non-contiguous c array.
        i    i   Rq   iÿÿÿÿN(   N(   RA  R'   R,   Rá   R¥   RZ   R=   R   R@   RØ   R>   Rq   Rê   Rë   Rì   Rí   RH   R;   R"   Rð   Rà   (	   RS   Râ   R|   R=   t   permRZ   RÝ   Rî   t   perm2(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR>  î  s,    
%(-%&c         C` s_   |  j  |  j j ƒ  |  j |  j ƒ } x* t | ƒ D] \ } } | j | | ƒ q1 W| j ƒ  | S(   s$  
        Construct a new piecewise polynomial representing the derivative.

        Parameters
        ----------
        nu : ndim-tuple of int
            Order of derivatives to evaluate for each dimension.
            If negative, the antiderivative is returned.

        Returns
        -------
        pp : NdPPoly
            Piecewise polynomial of orders (k[0] - nu[0], ..., k[n] - nu[n])
            representing the derivative of this polynomial.

        Notes
        -----
        Derivatives are evaluated piecewise for each polynomial
        segment, even if the polynomial is not differentiable at the
        breakpoints. The polynomial intervals in each dimension are
        considered half-open, ``[a, b)``, except for the last interval
        which is closed ``[a, b]``.

        (   RÐ   RZ   R;   R,   Ry   R   RA  RÓ   (   RS   Râ   R0   R|   R(  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRï     s
    $
c         C` s_   |  j  |  j j ƒ  |  j |  j ƒ } x* t | ƒ D] \ } } | j | | ƒ q1 W| j ƒ  | S(   sú  
        Construct a new piecewise polynomial representing the antiderivative.

        Antiderivative is also the indefinite integral of the function,
        and derivative is its inverse operation.

        Parameters
        ----------
        nu : ndim-tuple of int
            Order of derivatives to evaluate for each dimension.
            If negative, the derivative is returned.

        Returns
        -------
        pp : PPoly
            Piecewise polynomial of order k2 = k + n representing
            the antiderivative of this polynomial.

        Notes
        -----
        The antiderivative returned by this function is continuous and
        continuously differentiable to order n-1, up to floating point
        rounding error.

        (   RÐ   RZ   R;   R,   Ry   R   R>  RÓ   (   RS   Râ   R0   R|   R(  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRé   7  s
    $
c         C` sv  | d k r |  j } n t | ƒ } t |  j ƒ } t | ƒ | } |  j } t t | j	 ƒ ƒ } | j
 d | | ƒ | | d =| j
 d | | | ƒ | | | d =| j | ƒ } t j | j | j d | j d d ƒ |  j | d | ƒ} | j | | d | ƒ}	 | d k r*|	 j | j d ƒ S|	 j | j d ƒ } |  j |  |  j | d }
 |  j | |
 d | ƒSd S(   s¦  
        Compute NdPPoly representation for one dimensional definite integral

        The result is a piecewise polynomial representing the integral:

        .. math::

           p(y, z, ...) = \int_a^b dx\, p(x, y, z, ...)

        where the dimension integrated over is specified with the
        `axis` parameter.

        Parameters
        ----------
        a, b : float
            Lower and upper bound for integration.
        axis : int
            Dimension over which to compute the 1D integrals
        extrapolate : bool, optional
            Whether to extrapolate to out-of-bounds points based on first
            and last intervals, or to return NaNs.

        Returns
        -------
        ig : NdPPoly or array-like
            Definite integral of the piecewise polynomial over [a, b].
            If the polynomial was 1-dimensional, an array is returned,
            otherwise, an NdPPoly object.

        i    i   iÿÿÿÿRy   i   N(   RH   Ry   RÆ   R'   R,   R‚   RZ   Rá   R¥   R=   t   insertR   R   RÐ   Rà   R>   Rò   (   RS   R]   Rõ   R|   Ry   R=   RZ   t   swapR0   R»   R,   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   integrate_1dY  s*    	&	c         C` s6  t  |  j ƒ } | d k r' |  j } n t | ƒ } t | d ƒ sU t  | ƒ | k rd t d ƒ ‚ n  |  j ƒ  |  j } x¸ t	 | ƒ D]ª \ } \ } } t
 t | j ƒ ƒ } | j d | | | ƒ | | | d =| j | ƒ } t j | |  j | d | ƒ}	 |	 j | | d | ƒ}
 |
 j | j d ƒ } q„ W| S(   sq  
        Compute a definite integral over a piecewise polynomial.

        Parameters
        ----------
        ranges : ndim-tuple of 2-tuples float
            Sequence of lower and upper bounds for each dimension,
            ``[(a[0], b[0]), ..., (a[ndim-1], b[ndim-1])]``
        extrapolate : bool, optional
            Whether to extrapolate to out-of-bounds points based on first
            and last intervals, or to return NaNs.

        Returns
        -------
        ig : array_like
            Definite integral of the piecewise polynomial over
            [a[0], b[0]] x ... x [a[ndim-1], b[ndim-1]]

        t   __len__s&   Range not a sequence of correct lengthi   Ry   i   N(   R'   R,   RH   Ry   RÆ   t   hasattrR?   RÓ   RZ   R   Rá   R¥   R=   RD  R   R   RÐ   Rò   Rà   R>   (   RS   t   rangesRy   R=   RZ   R(  R]   Rõ   RE  R0   R»   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRò   –  s"    "
	N(   Rj   Rk   Rl   RH   R^   Rç   RÐ   RÉ   RÓ   Ri   RA  R>  Rï   Ré   RF  Rò   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR     s   9		A	"	(	!	"=c           B` sJ   e  Z d  Z d e e j d „ Z d d „ Z d „  Z	 d „  Z
 d „  Z RS(   sj  
    Interpolation on a regular grid in arbitrary dimensions

    The data must be defined on a regular grid; the grid spacing however may be
    uneven.  Linear and nearest-neighbour interpolation are supported. After
    setting up the interpolator object, the interpolation method (*linear* or
    *nearest*) may be chosen at each evaluation.

    Parameters
    ----------
    points : tuple of ndarray of float, with shapes (m1, ), ..., (mn, )
        The points defining the regular grid in n dimensions.

    values : array_like, shape (m1, ..., mn, ...)
        The data on the regular grid in n dimensions.

    method : str, optional
        The method of interpolation to perform. Supported are "linear" and
        "nearest". This parameter will become the default for the object's
        ``__call__`` method. Default is "linear".

    bounds_error : bool, optional
        If True, when interpolated values are requested outside of the
        domain of the input data, a ValueError is raised.
        If False, then `fill_value` is used.

    fill_value : number, optional
        If provided, the value to use for points outside of the
        interpolation domain. If None, values outside
        the domain are extrapolated.

    Methods
    -------
    __call__

    Notes
    -----
    Contrary to LinearNDInterpolator and NearestNDInterpolator, this class
    avoids expensive triangulation of the input data by taking advantage of the
    regular grid structure.

    .. versionadded:: 0.14

    Examples
    --------
    Evaluate a simple example function on the points of a 3D grid:

    >>> from scipy.interpolate import RegularGridInterpolator
    >>> def f(x, y, z):
    ...     return 2 * x**3 + 3 * y**2 - z
    >>> x = np.linspace(1, 4, 11)
    >>> y = np.linspace(4, 7, 22)
    >>> z = np.linspace(7, 9, 33)
    >>> data = f(*np.meshgrid(x, y, z, indexing='ij', sparse=True))

    ``data`` is now a 3D array with ``data[i,j,k] = f(x[i], y[j], z[k])``.
    Next, define an interpolating function from this data:

    >>> my_interpolating_function = RegularGridInterpolator((x, y, z), data)

    Evaluate the interpolating function at the two points
    ``(x,y,z) = (2.1, 6.2, 8.3)`` and ``(3.3, 5.2, 7.1)``:

    >>> pts = np.array([[2.1, 6.2, 8.3], [3.3, 5.2, 7.1]])
    >>> my_interpolating_function(pts)
    array([ 125.80469388,  146.30069388])

    which is indeed a close approximation to
    ``[f(2.1, 6.2, 8.3), f(3.3, 5.2, 7.1)]``.

    See also
    --------
    NearestNDInterpolator : Nearest neighbour interpolation on unstructured
                            data in N dimensions

    LinearNDInterpolator : Piecewise linear interpolant on unstructured data
                           in N dimensions

    References
    ----------
    .. [1] Python package *regulargrid* by Johannes Buchner, see
           https://pypi.python.org/pypi/regulargrid/
    .. [2] Trilinear interpolation. (2013, January 17). In Wikipedia, The Free
           Encyclopedia. Retrieved 27 Feb 2013 01:28.
           http://en.wikipedia.org/w/index.php?title=Trilinear_interpolation&oldid=533448871
    .. [3] Weiser, Alan, and Sergio E. Zarantonello. "A note on piecewise linear
           and multilinear table interpolation in many dimensions." MATH.
           COMPUT. 50.181 (1988): 189-196.
           http://www.ams.org/journals/mcom/1988-50-181/S0025-5718-1988-0917826-0/S0025-5718-1988-0917826-0.pdf

    R5   c   	      C` s+  | d k r t  d | ƒ ‚ n  | |  _ | |  _ t | d ƒ sR t j | ƒ } n  t | ƒ | j k r‰ t  d t | ƒ | j f ƒ ‚ n  t | d ƒ rÔ t | d ƒ rÔ t j | j	 t j
 ƒ sÔ | j t ƒ } qÔ n  | |  _ | d  k	 r8t j | ƒ j	 } t | d ƒ r8t j | | j	 d d	 ƒr8t  d
 ƒ ‚ q8n  x¸ t | ƒ D]ª \ } } t j t j | ƒ d k ƒ s‚t  d | ƒ ‚ n  t j | ƒ j d k s­t  d | ƒ ‚ n  | j | t | ƒ k sEt  d t | ƒ | j | | f ƒ ‚ qEqEWt g  | D] } t j | ƒ ^ qýƒ |  _ | |  _ d  S(   NR5   R€   s   Method '%s' is not definedR=   s7   There are %d point arrays, but values has %d dimensionsRq   Rˆ   t   castingt	   same_kindsD   fill_value must be either 'None' or of a type compatible with valuesg        s5   The points in dimension %d must be strictly ascendingi   s0   The points in dimension %d must be 1-dimensionals1   There are %d points and %d values in dimension %d(   s   linears   nearest(   R?   t   methodRI   RH  R@   R   R'   R=   RÊ   Rq   R‡   Rˆ   Rþ   RJ   RH   t   can_castR   RA   RÈ   R>   R¤   t   gridt   values(	   RS   t   pointsRO  RL  RI   RJ   t   fill_value_dtypeR  R0   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR^   &	  s>    			
'+c         C` sæ  | d
 k r |  j n | } | d k r: t d | ƒ ‚ n  t |  j ƒ } t | d | ƒ} | j d t |  j ƒ k r— t d | j d | f ƒ ‚ n  | j } | j d | d ƒ } |  j r;xy t	 | j
 ƒ D]e \ } } t j t j |  j | d | k ƒ t j | |  j | d k ƒ ƒ sÏ t d	 | ƒ ‚ qÏ qÏ Wn  |  j | j
 ƒ \ } } }	 | d k rz|  j | | |	 ƒ }
 n$ | d k rž|  j | | |	 ƒ }
 n  |  j rÇ|  j d
 k	 rÇ|  j |
 |	 <n  |
 j | d  |  j j | ƒ S(   s6  
        Interpolation at coordinates

        Parameters
        ----------
        xi : ndarray of shape (..., ndim)
            The coordinates to sample the gridded data at

        method : str
            The method of interpolation to perform. Supported are "linear" and
            "nearest".

        R5   R€   s   Method '%s' is not definedR=   iÿÿÿÿsc   The requested sample points xi have dimension %d, but this RegularGridInterpolator has dimension %di   i    s8   One of the requested xi is out of bounds in dimension %dN(   s   linears   nearest(   RH   RL  R?   R'   RN  R$   R>   Rà   RI   R   RC   R@   t   logical_andRA   t   _find_indicest   _evaluate_lineart   _evaluate_nearestRJ   RO  (   RS   R"  RL  R=   t   xi_shapeR  R0   t   indicest   norm_distancest   out_of_boundst   result(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRi   O	  s8    		##		c         C` sß   t  d  ƒ f d |  j j t | ƒ } t j g  | D] } | | d g ^ q4 Œ  } d } x | D]w } d }	 xF t | | | ƒ D]2 \ }
 } } |	 t j	 |
 | k d | | ƒ 9}	 q W| t j
 |  j | ƒ |	 | 7} q` W| S(   Ni   g        g      ð?(   N(   Rí   RH   RO  R=   R'   t	   itertoolst   productRo   R@   t   whereR   (   RS   RW  RX  RY  t   vsliceR  t   edgesRO  t   edge_indicest   weightt   eiR  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRT  €	  s    ',"'&c         C` sW   g  } xC t  | | ƒ D]2 \ } } | j t j | d k | | d ƒ ƒ q W|  j | S(   Ng      à?i   (   Ro   RÔ   R@   R]  RO  (   RS   RW  RX  RY  t   idx_resR  R  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRU  	  s    *c         C` s  g  } g  } t  j | j d d t ƒ} xÎ t | |  j ƒ D]º \ } } t  j | | ƒ d } d | | d k  <| j d | | | j d k <| j | ƒ | j | | | | | d | | ƒ |  j	 s; | | | d k  7} | | | d k 7} q; q; W| | | f S(   Ni   Rq   i    i   iÿÿÿÿ(
   R@   RØ   R>   RÆ   Ro   RN  R   R<   RÔ   RI   (   RS   R"  RW  RX  RY  R,   RN  R  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRS  •	  s    	N(   Rj   Rk   Rl   Rm   R@   Rº   R^   RH   Ri   RT  RU  RS  (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   Ç  s   [(1		R5   c         C` sq  | d k r t  d | ƒ ‚ n  t | d ƒ s@ t j | ƒ } n  | j } | d k rp | d k rp t  d ƒ ‚ n  | rž | d k rž | d k rž t  d ƒ ‚ n  t |  ƒ | k rÏ t  d	 t |  ƒ | f ƒ ‚ n  t |  ƒ | k rü | d k rü t  d
 ƒ ‚ n  x¸ t |  ƒ D]ª \ } } t j t j	 | ƒ d k ƒ sFt  d | ƒ ‚ n  t j | ƒ j d k sqt  d | ƒ ‚ n  | j
 | t | ƒ k s	t  d t | ƒ | j
 | | f ƒ ‚ q	q	Wt g  |  D] } t j | ƒ ^ qÁƒ }	 t | d t |	 ƒ ƒ} | j
 d t |	 ƒ k r6t  d | j
 d t |	 ƒ f ƒ ‚ n  xw t | j ƒ D]f \ } } | rFt j t j |	 | d | k ƒ t j | |	 | d k ƒ ƒ rFt  d | ƒ ‚ qFqFW| d k rçt |  | d d d | d | ƒ}
 |
 | ƒ S| d k rt |  | d d d | d | ƒ}
 |
 | ƒ S| d k rm| j
 } | j d | j
 d ƒ } t j |	 d d | d d … d f k | d d … d f |	 d d k |	 d d | d d … d f k | d d … d f |	 d d k f d d ƒ} t j | d d … d f ƒ } t |  d |  d | ƒ }
 |
 j | | d f | | d f ƒ | | <| | t j | ƒ <| j | d  ƒ Sd S(   sï  
    Multidimensional interpolation on regular grids.

    Parameters
    ----------
    points : tuple of ndarray of float, with shapes (m1, ), ..., (mn, )
        The points defining the regular grid in n dimensions.

    values : array_like, shape (m1, ..., mn, ...)
        The data on the regular grid in n dimensions.

    xi : ndarray of shape (..., ndim)
        The coordinates to sample the gridded data at

    method : str, optional
        The method of interpolation to perform. Supported are "linear" and
        "nearest", and "splinef2d". "splinef2d" is only supported for
        2-dimensional data.

    bounds_error : bool, optional
        If True, when interpolated values are requested outside of the
        domain of the input data, a ValueError is raised.
        If False, then `fill_value` is used.

    fill_value : number, optional
        If provided, the value to use for points outside of the
        interpolation domain. If None, values outside
        the domain are extrapolated.  Extrapolation is not supported by method
        "splinef2d".

    Returns
    -------
    values_x : ndarray, shape xi.shape[:-1] + values.shape[ndim:]
        Interpolated values at input coordinates.

    Notes
    -----

    .. versionadded:: 0.14

    See also
    --------
    NearestNDInterpolator : Nearest neighbour interpolation on unstructured
                            data in N dimensions

    LinearNDInterpolator : Piecewise linear interpolant on unstructured data
                           in N dimensions

    RegularGridInterpolator : Linear and nearest-neighbor Interpolation on a
                              regular grid in arbitrary dimensions

    RectBivariateSpline : Bivariate spline approximation over a rectangular mesh

    R5   R€   t	   splinef2ds[   interpn only understands the methods 'linear', 'nearest', and 'splinef2d'. You provided %s.R=   i   sB   The method spline2fd can only be used for 2-dimensional input datas4   The method spline2fd does not support extrapolation.s7   There are %d point arrays, but values has %d dimensionssS   The method spline2fd can only be used for scalar data with one point per coordinateg        s5   The points in dimension %d must be strictly ascendingi   s0   The points in dimension %d must be 1-dimensionals1   There are %d points and %d values in dimension %diÿÿÿÿsc   The requested sample points xi have dimension %d, but this RegularGridInterpolator has dimension %di    s8   One of the requested xi is out of bounds in dimension %dRL  RI   RJ   NR|   (   s   linears   nearestRd  (   R?   RH  R@   R   R=   RH   R'   R   RA   RÈ   R>   R¤   R$   RC   RR  R   Rà   Rô   R#   t   evt   logical_not(   RP  RO  R"  RL  RI   RJ   R=   R  R0   RN  R¬   RV  t	   idx_validRZ  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   ª	  sp    9	'( &!	
	
	HH	*c           B` sA   e  Z d  Z d e d „ Z d „  Z d „  Z e d d „ ƒ Z RS(   se   
    Deprecated piecewise polynomial class.

    New code should use the `PPoly` class instead.

    g        c         C` s¥   t  j d d t ƒ| r+ t j | ƒ } n t j | ƒ } t j |  | | ƒ |  j |  _	 |  j
 |  _ |  j	 j d |  _ | |  _ |  j d |  _ |  j d |  _ d  S(   Ns)   ppform is deprecated -- use PPoly insteadt   categoryi    iÿÿÿÿ(   RÖ   R×   t   DeprecationWarningR@   R_   R   R   R^   RZ   t   coeffsR,   t   breaksR>   t   KRó   R]   Rõ   (   RS   Rj  Rk  Ró   R_   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR^   :
  s    	c         C` s   t  j |  | d t ƒ S(   Ni    (   R   Ri   Rn   (   RS   R,   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyRi   L
  s    c         C` sA   t  j |  | | | | ƒ |  j | | |  j k | |  j k @<| S(   N(   R   R¿   Ró   R]   Rõ   (   RS   R,   Râ   Ry   R»   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR¿   O
  s    $c   
      C` sµ   t  | ƒ d } t j | d | f d t ƒ} xp t | d d ƒ D]\ } t j | d ƒ } t j | d  | | | | ƒ }	 |	 | }	 |	 | | | d  d  … f <qB W|  | | d | ƒS(   Ni   Rq   iÿÿÿÿRó   (	   R'   R@   Rß   Rþ   R   Rê   R	  R    t	   _bspleval(
   RÏ   t   xkR
  R›   Ró   t   Nt   sivalsR  t   factR  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt
   fromsplineT
  s    
(	   Rj   Rk   Rl   Rn   R^   Ri   R¿   Rç   Rr  (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR	   2
  s   		c         C` sh   | j  d k r t |  | ƒ St t | j  ƒ ƒ } | j d d ƒ | j d ƒ t |  | j | ƒ ƒ Sd S(   sC   Similar to numpy.dot, but sum over last axis of a and 1st axis of bi   iÿÿÿÿi    N(   R=   R   Rá   R¥   RD  t   popR   (   R]   Rõ   t   axes(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _dot0d
  s    c         C` sf  t  |  ƒ d } | } | d  k r7 t j | |  ƒ } n  t j | |  ƒ } t j j | ƒ \ } }	 }
 | d } |
 | d  … d  d  … f j } |
 d  | … d  d  … f j } t	 | j | ƒ } t	 | j | ƒ } t	 | | ƒ } t j j
 | | ƒ } t	 | | ƒ } t j | | ƒ | } t	 | | ƒ } t	 | t j d |	 ƒ ƒ } t	 | | j ƒ } t | | ƒ S(   Ni   g      ð?(   R'   RH   R    t   _bsplmatt   _bspldismatt   scipyt   linalgt   svdRC   R   R  R@   t   eyet   diagRu  (   Rn  t   ykR›   t   condst   BRo  Rl  t   Jt   uR:   t   vhRœ   t   V2t   V1t   At   tmpt   QR0   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   _find_smoothesto
  s&    
  c   
      C` s­   | d } | d } t  j | | f d d ƒ} t  j | | f d d ƒ} | j \ } }	 | |	 k rt t d ƒ ‚ n5 | |	 k  r– t |  | | d  | ƒ St j j | | ƒ Sd  S(   Ni    i   R|   s    over-specification of conditions(	   R@   t   concatenateR>   R?   Rˆ  RH   Rx  Ry  R  (
   Rn  R}  R›   R~  R  t   lht   rhR.   R/   Ro  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt
   _find_user
  s    

t   messagesF   splmake is deprecated in scipy 0.19.0, use make_interp_spline instead.i   t	   smoothestc         C` sÇ   t  j | ƒ } t | ƒ } | d k  r6 t d ƒ ‚ n  | d k rS |  | d  | f S| d k rl |  | | f Sy t d | ƒ } Wn t ‚ n Xt j | |  ƒ } | |  | | | | ƒ } |  | | f S(   sŽ  
    Return a representation of a spline given data-points at internal knots

    Parameters
    ----------
    xk : array_like
        The input array of x values of rank 1
    yk : array_like
        The input array of y values of rank N. `yk` can be an N-d array to
        represent more than one curve, through the same `xk` points. The first
        dimension is assumed to be the interpolating dimension and is the same
        length of `xk`.
    order : int, optional
        Order of the spline
    kind : str, optional
        Can be 'smoothest', 'not_a_knot', 'fixed', 'clamped', 'natural',
        'periodic', 'symmetric', 'user', 'mixed' and it is ignored if order < 2
    conds : optional
        Conds

    Returns
    -------
    splmake : tuple
        Return a (`xk`, `cvals`, `k`) representation of a spline given
        data-points where the (internal) knots are at the data-points.

    i    s   order must not be negativeiÿÿÿÿi   s   _find_%s(   R@   t
   asanyarrayR‚   R?   t   evalRƒ   R    Rv  (   Rn  R}  R›   RT   R~  t   funcR  t   coefs(    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   ž
  s    
s;   spleval is deprecated in scipy 0.19.0, use BSpline instead.c         C` s'  |  \ } } } t  j | ƒ } t  j | ƒ } | j d } t  j | j | d | j ƒ}	 xº t  j | Œ  D]© }
 t d ƒ f |
 } t | j j	 t  j
 ƒ rï t j | | | j | | | ƒ |	 | _ t j | | | j | | | ƒ |	 | _ qi t j | | | | | | ƒ |	 | <qi W| | |	 _ |	 S(   sà  
    Evaluate a fixed spline represented by the given tuple at the new x-values

    The `xj` values are the interior knot points.  The approximation
    region is `xj[0]` to `xj[-1]`.  If N+1 is the length of `xj`, then `cvals`
    should have length N+k where `k` is the order of the spline.

    Parameters
    ----------
    (xj, cvals, k) : tuple
        Parameters that define the fixed spline
    xj : array_like
        Interior knot points
    cvals : array_like
        Curvature
    k : int
        Order of the spline
    xnew : array_like
        Locations to calculate spline
    deriv : int
        Deriv

    Returns
    -------
    spleval : ndarray
        If `cvals` represents more than one curve (`cvals.ndim` > 1) and/or
        `xnew` is N-d, then the result is `xnew.shape` + `cvals.shape[1:]`
        providing the interpolation of multiple curves.

    Notes
    -----
    Internally, an additional `k`-1 knot points are added on either side of
    the spline.

    i   Rq   N(   R@   R>   R   Rß   Rq   t   ndindexRí   RH   R…   R†   RË   R    Rm  t   realt   imag(   t   xckt   xnewt   derivt   xjR
  R3   t   oldshapeR    t   shR  t   indexR?  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR   Ñ
  s    &),'sE   spltopp is deprecated in scipy 0.19.0, use PPoly.from_spline instead.c         C` s   t  j |  | | ƒ S(   s@   Return a piece-wise polynomial object from a fixed-spline tuple.(   R	   Rr  (   Rn  R
  R3   (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR     s    s@   spline is deprecated in scipy 0.19.0, use Bspline class instead.c      
   C` s(   t  t |  | d | d | d | ƒ| ƒ S(   s÷  
    Interpolate a curve at new points using a spline fit

    Parameters
    ----------
    xk, yk : array_like
        The x and y values that define the curve.
    xnew : array_like
        The x values where spline should estimate the y values.
    order : int
        Default is 3.
    kind : string
        One of {'smoothest'}
    conds : Don't know
        Don't know

    Returns
    -------
    spline : ndarray
        An array of y values; the spline evaluated at the positions `xnew`.

    R›   RT   R~  (   R   R   (   Rn  R}  R—  R›   RT   R~  (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyR     s    (G   Rl   t
   __future__R    R   R   t   __all__R[  RÖ   R(   R*   t   numpyR@   R   R   R   R   R   R   R   R   R   R   t   scipy.linalgRx  t   scipy.specialt   specialRê   R   t   scipy._lib.sixR   R   R   t    R   R   R    t   polyintR!   R"   t   fitpack2R#   t   interpndR$   t	   _bsplinesR%   R&   R-   R
   RÍ   R   Rx   R{   R   RÂ   R   R   R   R   Rm   Rº   R   R	   Ru  RH   Rˆ  RŒ  t	   deprecateR   R   R   R   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/interpolate.pyt   <module>   sf   F		(×		ÿ JÚÿ –ÿ ÿ #ÿ ®ã‡2	 	14