File: //usr/local/lib/python3.10/dist-packages/numpy/polynomial/__pycache__/polyutils.cpython-310.pyc
o
���g�Z � @ s� d Z ddlZddlZddlZddlZddlmZmZ ddl m
Z
g d�ZG dd� de�Z
dd � Zd0dd�Zd1d
d�Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd2d(d)�Zd*d+� Zd,d-� Zd3d.d/�Z dS )4a
Utility classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Warning objects
---------------
.. autosummary::
:toctree: generated/
RankWarning raised in least-squares fit for rank-deficient matrix.
Functions
---------
.. autosummary::
:toctree: generated/
as_series convert list of array_likes into 1-D arrays of common type.
trimseq remove trailing zeros.
trimcoef remove small trailing coefficients.
getdomain return the domain appropriate for a given set of abscissae.
mapdomain maps points between domains.
mapparms parameters of the linear map between domains.
� N)�dragon4_positional�dragon4_scientific)�absolute)�RankWarning� as_series�trimseq�trimcoef� getdomain� mapdomain�mapparms�format_floatc @ s e Zd ZdZdS )r z;Issued by chebfit when the design matrix is rank deficient.N)�__name__�
__module__�__qualname__�__doc__� r r �E/usr/local/lib/python3.10/dist-packages/numpy/polynomial/polyutils.pyr / s r c C sJ t | �dkr| S tt | �d dd�D ]
}| | dkr nq| d|d � S )a� Remove small Poly series coefficients.
Parameters
----------
seq : sequence
Sequence of Poly series coefficients. This routine fails for
empty sequences.
Returns
-------
series : sequence
Subsequence with trailing zeros removed. If the resulting sequence
would be empty, return the first element. The returned sequence may
or may not be a view.
Notes
-----
Do not lose the type info if the sequence contains unknown objects.
r � ���N)�len�range)�seq�ir r r r 6 s �r Tc
s dd� | D �}t dd� |D ��dkrtd��tdd� |D ��r#td��|r,d d� |D �}td
d� |D ��rig }|D ]-}|jt�t�kr_tjt|�t�t�d�}|dd� |dd�<