← Back
Editing: _zeros_py.cpython-311.pyc
� d�c� � � � d dl Z d dlmZ d dlZddlmZ d dlZdZdZ d ej e� � j z Z g d�Zd Zd Zd ZdZdZdZd ZdZdZdZeeeeeeeeeeiZ G d� d� � Zd� Zd� Z d+d�Zd� Zde e eddfd�Zde e eddfd�Z de e eddfd�Z!de e eddfd �Z"e e fd!�Z#d"� Z$d#� Z% d,d$�Z&d%� Z'd&� Z(d'� Z) G d(� d)� � Z*dde e eddfd*�Z+dS )-� N)� namedtuple� )�_zeros�d g�-����=� )�newton�bisect�ridder�brentq�brenth�toms748�RootResults���������� convergedz sign errorzconvergence errorzvalue errorzNo errorc � � e Zd ZdZd� Zd� ZdS )r a� Represents the root finding result. Attributes ---------- root : float Estimated root location. iterations : int Number of iterations needed to find the root. function_calls : int Number of times the function was called. converged : bool True if the routine converged. flag : str Description of the cause of termination. c � � || _ || _ || _ |t k | _ d | _ t | | _ d S # t $ r d|fz | _ Y d S w xY w)Nzunknown error %d)�root� iterations�function_calls�_ECONVERGEDr �flag�flag_map�KeyError)�selfr r r r s �:/usr/lib/python3/dist-packages/scipy/optimize/_zeros_py.py�__init__zRootResults.__init__3 sn � ��� �$���,�����,����� � 5� ���D�I�I�I��� 5� 5� 5�*�d�W�4�D�I�I�I�I� 5���s �A �A�Ac � � �� g d�}t t t |� � � � dz �d� �� fd�|D � � � � S )N)r r r r r r � c �| �� g | ]8}|� �� � d z t t �|� � � � z ��9S )z: )�rjust�repr�getattr)�.0�a�mr s ��r � <listcomp>z(RootResults.__repr__.<locals>.<listcomp>B sO �� � *� *� *�� �'�'�!�*�*�t�+�d�7�4��3C�3C�.D�.D�D� *� *� *� )�max�map�len�join)r �attrsr'