
    (phK                     V    S SK r\R                  " \5      R                  rS rS rS rg)    Nc                      [        U 5      S:X  a  [        S5      e[        S U  5       5      n[        S U  5       5      nS[        -  [        US5      -  U-  $ )a  
Get a relative tolerance for a set of arrays.

Parameters
----------
*arrays: tuple
    Set of `numpy.ndarray` to get the tolerance for.

Returns
-------
float
    Relative tolerance for the set of arrays.

Raises
------
ValueError
    If no array is provided.
r   z$At least one array must be provided.c              3   8   #    U  H  oR                   v   M     g 7f)N)size.0arrays     O/var/www/html/venv/lib/python3.13/site-packages/scipy/_lib/cobyqa/utils/math.py	<genexpr>!get_arrays_tol.<locals>.<genexpr>   s     .vezzvs   c           	   3      #    U  HE  n[         R                  " [         R                  " U[         R                  " U5         5      S S9v   MG     g7f)      ?)initialN)npmaxabsisfiniter   s     r	   r
   r      s9      E 	rvveBKK./0#>s   AAg      $@r   )len
ValueErrorr   EPS)arraysr   weights      r	   get_arrays_tolr      s_    & 6{a?@@.v..D  F #:D#&//    c                     [         R                  " [         R                  " U 5      5      R                  [        5      n U R
                  S:w  a  [        U5      eU $ )z
Preprocess a 1-dimensional array.

Parameters
----------
x : array_like
    Array to be preprocessed.
message : str
    Error message if `x` cannot be interpreter as a 1-dimensional array.

Returns
-------
`numpy.ndarray`
    Preprocessed array.
   )r   
atleast_1dsqueezeastypefloatndimr   xmessages     r	   exact_1d_arrayr$   $   s@      	bjjm$++E2Avv{!!Hr   c                     [         R                  " U 5      R                  [        5      n U R                  S:w  a  [        U5      eU $ )z
Preprocess a 2-dimensional array.

Parameters
----------
x : array_like
    Array to be preprocessed.
message : str
    Error message if `x` cannot be interpreter as a 2-dimensional array.

Returns
-------
`numpy.ndarray`
    Preprocessed array.
   )r   
atleast_2dr   r   r    r   r!   s     r	   exact_2d_arrayr(   :   s8      	a&Avv{!!Hr   )	numpyr   finfor   epsr   r   r$   r(    r   r	   <module>r-      s,     	hhuo0:,r   