§
    ƒÛg�
  ã                   ó†   — d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZ ddlmZ ed„ ¦   «         Zed	„ ¦   «         Zd
S )zd
This file provides internal compiler utilities that support certain special
operations with numpy.
é    )ÚtypesÚtyping)Úunpack_tuple)Ú	intrinsic)Úimpl_ret_new_ref)ÚRequireLiteralValueÚTypingError)Útuple_setitemc                 ó˜   ‡— ddl mŠ ˆfd„}t          |¦  «        }t          j        |dt          j        ¬¦  «        } ||¦  «        }||fS )z×A version of numpy.empty whose dtype is inferred by the type system.

    Expects `shape` to be a int-tuple.

    There is special logic in the type-inferencer to handle the "refine"-ing
    of undefined dtype.
    r   )Ú_empty_nd_implc                 óÎ   •— |j         }|                     ¦   «         sJ ‚t          ||d         ¦  «        } ‰| |||¦  «        }t          | |||                     ¦   «         ¦  «        S )Nr   )Úreturn_typeÚ
is_preciser   r   Ú	_getvalue)ÚcontextÚbuilderÚ	signatureÚargsÚarrtyÚshapesÚresr   s          €úM/granary/edev/quantum/lib/python3.11/site-packages/numba/np/unsafe/ndarray.pyÚcodegenzempty_inferred.<locals>.codegen   sg   ø€ àÔ%ˆØ×ÒÑ!Ô!Ð!Ð!Ð!Ý˜g t¨A¤wÑ/Ô/ˆàˆn˜W g¨u°fÑ=Ô=ˆÝ ¨°%¸¿º¹¼ÑIÔIÐIó    ÚC)ÚndimÚlayoutÚdtype)Únumba.np.arrayobjr   Úlenr   ÚArrayÚ	undefined)Ú	typingctxÚshaper   ÚndÚarray_tyÚsigr   s         @r   Úempty_inferredr(      sq   ø€ ð 1Ð0Ð0Ð0Ð0Ð0ðJð Jð Jð Jð Jõ 
ˆU‰Œ€BÝŒ{ ¨3µe´oÐFÑFÔF€HØ
ˆ(�5‰/Œ/€CØ�ˆ<Ðr   c                 óF  ‡‡— t          |t          j        ¦  «        st          d¦  «        ‚|j        dk    r't          d                     |j        ¦  «        ¦  «        ‚t          |j        ¦  «        Št          j	        |j
        ‰¬¦  «        Š ‰||¦  «        }ˆˆfd„}||fS )zÑConvert *array* into a tuple of *length*

    Returns ``UniTuple(array.dtype, length)``

    ** Warning **
    - No boundchecking.
      If *length* is longer than *array.size*, the behavior is undefined.
    z$*length* argument must be a constanté   zNot supported on array.ndim={})r   Úcountc                 ó&  •— d„ }|j         d         t          j        ‰g}t          j        ‰g|¢R Ž }|                      t          j        ¦  «        }|                      ‰¦  «        }|d          |‰¦  «        |g}	|                      ||||	¦  «        }
|
S )Nc                 ó\   — |}t          |¦  «        D ]}t          ||| |         ¦  «        }Œ|S )N)Úranger
   )ÚarrayÚlengthÚempty_tupleÚoutÚis        r   Úimplz-to_fixed_tuple.<locals>.codegen.<locals>.impl?   s8   € ØˆCÝ˜6‘]”]ð 6ð 6�Ý# C¨¨E°!¬HÑ5Ô5��ØˆJr   r   )r   r   Úintpr   r   Úget_value_typeÚget_constant_undefÚcompile_internal)r   r   r   r   r4   Úinner_argtypesÚ	inner_sigÚll_idx_typer1   Ú
inner_argsr   Ú
tuple_sizeÚ
tuple_types              €€r   r   zto_fixed_tuple.<locals>.codegen>   s¡   ø€ ð	ð 	ð 	ð $œ.¨Ô+­U¬Z¸ÐDˆÝÔ$ ZÐA°.ÐAÐAÐAˆ	Ø×,Ò,­U¬ZÑ8Ô8ˆà×0Ò0°Ñ<Ô<ˆØ˜1”g˜{˜{¨:Ñ6Ô6¸ÐDˆ
à×&Ò& w°°iÀÑLÔLˆØˆ
r   )Ú
isinstancer   ÚIntegerLiteralr   r   r	   ÚformatÚintÚliteral_valueÚUniTupler   )r#   r/   r0   r'   r   r=   r>   s        @@r   Úto_fixed_tuplerE   )   s¸   øø€ õ �f�eÔ2Ñ3Ô3ð JÝ!Ð"HÑIÔIÐIà„z�Q‚€ÝÐ:×AÒAÀ%Ä*ÑMÔMÑNÔNÐNõ �VÔ)Ñ*Ô*€JÝ” e¤k¸ÐDÑDÔD€JØ
ˆ*�U˜FÑ
#Ô
#€Cðð ð ð ð ð ð" �ˆ<Ðr   N)Ú__doc__Ú
numba.corer   r   Únumba.core.cgutilsr   Únumba.core.extendingr   Únumba.core.imputilsr   Únumba.core.errorsr   r	   Únumba.cpython.unsafe.tupler
   r(   rE   © r   r   ú<module>rN      sÉ   ððð ð %Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ø +Ð +Ð +Ð +Ð +Ð +Ø *Ð *Ð *Ð *Ð *Ð *Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >à 4Ð 4Ð 4Ð 4Ð 4Ð 4ð ðð ñ „ðð4 ð%ð %ñ „ð%ð %ð %r   