| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/scipy/interpolate/__pycache__/ |
Upload File : |
�
d�c� � �� � d Z ddlZddlmZ ddlmZ ddlmZm Z g d�Z
dd�Z G d � d
e� � Z G d� de� � Z
dd
�Z G d� de� � Z G d� de� � ZdS )z;Interpolation algorithms using piecewise cubic polynomials.� N� )�PPoly)� _isscalar)�solve_banded�solve)�CubicHermiteSpline�PchipInterpolator�pchip_interpolate�Akima1DInterpolator�CubicSplinec � � t t j | |f� � \ } }t j | j t j � � rt
d� � �| � t � � } t j |j t j � � rt }nt }|�ut j |� � }|j
|j
k rt
d� � �t j |j t j � � rt }|� |d�� � }|� |d�� � }||j z }| j dk rt
d� � �| j
d d k rt
d
� � �| j
d |j
| k r"t
d� |� � � � �t j
t j | � � � � st
d� � �t j
t j |� � � � st
d
� � �|�5t j
t j |� � � � st
d� � �t j | � � }t j |dk � � rt
d� � �t j ||d� � }|�t j ||d� � }| ||||fS )a Prepare input for cubic spline interpolators.
All data are converted to numpy arrays and checked for correctness.
Axes equal to `axis` of arrays `y` and `dydx` are moved to be the 0th
axis. The value of `axis` is converted to lie in
[0, number of dimensions of `y`).
z`x` must contain real values.Nz/The shapes of `y` and `dydx` must be identical.F��copyr z`x` must be 1-dimensional.r � z%`x` must contain at least 2 elements.zBThe length of `y` along `axis`={0} doesn't match the length of `x`z$`x` must contain only finite values.z$`y` must contain only finite values.z'`dydx` must contain only finite values.z)`x` must be strictly increasing sequence.)�map�np�asarray�
issubdtype�dtype�complexfloating�
ValueError�astype�float�complex�shape�ndim�format�all�isfinite�diff�any�moveaxis)�x�y�axis�dydxr �dxs �:/usr/lib/python3/dist-packages/scipy/interpolate/_cubic.py�
prepare_inputr) se � � �r�z�A�q�6�"�"�D�A�q� �}�Q�W�b�0�1�1� :��8�9�9�9� ������A� �}�Q�W�b�0�1�1� ���������z�$�����7�d�j� � ��N�O�O�O�
�=���R�%7�8�8� ��E��{�{�5�u�{�-�-�� ����U��#�#�A��!�&�=�D��v��{�{��5�6�6�6��w�q�z�A�~�~��@�A�A�A��w�q�z�Q�W�T�]�"�"�� 3�39�6�$�<�<�A� A� A� �6�"�+�a�.�.�!�!� A��?�@�@�@�
�6�"�+�a�.�.�!�!� A��?�@�@�@�����r�{�4�'8�'8� 9� 9���B�C�C�C� �����B� �v�b�A�g��� F��D�E�E�E�
��A�t�Q���A����{�4��q�)�)���b�!�T�4��� c �$ � � e Zd ZdZd� fd� Z� xZS )r a� Piecewise-cubic interpolator matching values and first derivatives.
The result is represented as a `PPoly` instance.
Parameters
----------
x : array_like, shape (n,)
1-D array containing values of the independent variable.
Values must be real, finite and in strictly increasing order.
y : array_like
Array containing values of the dependent variable. It can have
arbitrary number of dimensions, but the length along ``axis``
(see below) must match the length of ``x``. Values must be finite.
dydx : array_like
Array containing derivatives of the dependent variable. It can have
arbitrary number of dimensions, but the length along ``axis``
(see below) must match the length of ``x``. Values must be finite.
axis : int, optional
Axis along which `y` is assumed to be varying. Meaning that for
``x[i]`` the corresponding values are ``np.take(y, i, axis=axis)``.
Default is 0.
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), it is set to True.
Attributes
----------
x : ndarray, shape (n,)
Breakpoints. The same ``x`` which was passed to the constructor.
c : ndarray, shape (4, n-1, ...)
Coefficients of the polynomials on each segment. The trailing
dimensions match the dimensions of `y`, excluding ``axis``.
For example, if `y` is 1-D, then ``c[k, i]`` is a coefficient for
``(x-x[i])**(3-k)`` on the segment between ``x[i]`` and ``x[i+1]``.
axis : int
Interpolation axis. The same axis which was passed to the
constructor.
Methods
-------
__call__
derivative
antiderivative
integrate
roots
See Also
--------
Akima1DInterpolator : Akima 1D interpolator.
PchipInterpolator : PCHIP 1-D monotonic cubic interpolator.
CubicSpline : Cubic spline data interpolator.
PPoly : Piecewise polynomial in terms of coefficients and breakpoints
Notes
-----
If you want to create a higher-order spline matching higher-order
derivatives, use `BPoly.from_derivatives`.
References
----------
.. [1] `Cubic Hermite spline
<https://en.wikipedia.org/wiki/Cubic_Hermite_spline>`_
on Wikipedia.
r Nc �N �� |�d}t ||||� � \ }}}}}|� |j d gdg|j dz
z z � � }t j |d�� � |z }|d d� |dd � z d|z z
|z } t j dt |� � dz
f|j dd � z | j �� � }
| |z |
d<