o
    ×°“iÉ  ã                   @   s0   d dl Z d dlmZ e  dddd¡Zdd„ ZdS )	é    N)Ú_utilzT A, N r, N czN outzout = A != 0 ? r - c : 0Úcupyx_scipy_linalg_band_posc           	      C   s¾   t  | ¡} | jdkrdS t | ¡ | jd r| j}n| }|j\}}t jd|…d|…f \}}t	|||ƒ}| jd rLt
t  |¡ƒ}t
t  |¡ƒ }||fS t
t  |¡ƒ}t
t  |¡ƒ }||fS )aø  Return the lower and upper bandwidth of a 2D numeric array.
    Parameters
    ----------
    a : ndarray
        Input array of size (M, N)
    Returns
    -------
    lu : tuple
        2-tuple of ints indicating the lower and upper bandwidth. A zero
        denotes no sub- or super-diagonal on that side (triangular), and,
        say for M rows (M-1) means that side is full. Same example applies
        to the upper triangular part with (N-1).

    .. seealso:: :func:`scipy.linalg.bandwidth`
    r   )r   r   ÚF_CONTIGUOUS)ÚcupyÚasarrayÚsizer   Ú
_assert_2dÚflagsÚTÚshapeÚmgridÚ_kernel_cupy_band_pos_cÚintÚamaxÚamin)	ÚaÚAÚmÚnÚrow_numÚcol_numÚbandptsÚ
upper_bandÚ
lower_band© r   úS/home/ubuntu/.local/lib/python3.10/site-packages/cupyx/scipy/linalg/_array_utils.pyÚ	bandwidth   s"   





ýr   )r   Úcupy.linalgr   ÚElementwiseKernelr   r   r   r   r   r   Ú<module>   s    ü