+
    :i                    ,   ^ RI t ^ RIt^ RIHtHtHtHtHt ^ RIH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHtHt ^ RIt^ RIHt ^ RI t Rt!^ t"] PF                  .t$/ t%. ROt&RR.t'. ROt(. ROt). ROt*]'](,           ]),           ]*,           R	R
.,           t+]R 4       t,R t-]R 4       t. ! R R]/4      t0 ! R R]04      t1 ! R R]14      t2 ! R R]/4      t3 ! R R]/4      t4]5! ]Pl                  Pn                  Pq                  4       4      ]Pr                  .,           t:]Pv                  Pn                  Pq                  4       t<]Pz                  Pn                  Pq                  4       t>]P~                   U u. uF  q P                  NK  	  up tAR# u up i )    N)typesirconfigcgutilserrors)mk_unique_varfind_topo_orderdprint_func_irget_global_func_typguardrequireget_definitionfind_callnamefind_build_sequence
find_constis_namedtuple_classbuild_definitionsfind_potential_aliasesget_canonical_aliasGuardException)compute_cfg_from_blocks)npydecl	signature)	intrinsicrandrandnrandint
triangularc                  aa \        \        V\        P                  P                  4      4       \        \        V\        P                  P                  4      4       VP
                  '       d   \        P                  M\        P                  oVP
                  '       d   \        P                  M\        P                  oVV3R lp\        SW4      V3# )a  
Calculate index value "idx" relative to a size "size" value as
(idx % size), where "size" is known to be positive.
Note that we use the mod(%) operation here instead of
(idx < 0 ? idx + size : idx) because we may have situations
where idx > size due to the way indices are calculated
during slice/range analysis.

Both idx and size have to be Integer types.
size should be from the array size vars that array_analysis
adds and the bitwidth should match the platform maximum.
c                   < V P                  S4      pV P                  S4      pSP                  '       d   VP                  V^ ,          V4      pMVP                  V^ ,          V4      pSP                  '       d   VP                  V^,          V4      pMVP                  V^,          V4      pVP	                  V4      p\
        P                  P                  V^ 4      p	VP                  RWi4      p
VP                  RWg4      pVP                  RWh4      pVP                  WV4      pVP                  WVP                  Wg4      4      pVP                  WV4      pV# )r   <z>=z<=)get_data_typesignedsextzextnegllvmliter   Constanticmp_signedselectadd)contextbuildersigargsll_idx_unified_tyll_unified_tyidxsizeneg_sizezeroidx_negativepos_oversizeneg_oversizepos_resneg_resmodidx_unified
unified_tys   &&&&            Z/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/parfors/array_analysis.pycodegenwrap_index.<locals>.codegenf   s(   #11+>--j9,,tAw(9:C,,tAw(9:C<<Q7D<<Q7D;;t${{##M15 **3:**4;**4?..S9..W[[5KLnn\G<
    )	r   
isinstancer   scalarsIntegerr#   intpuintpr   )	typingctxr2   r3   r?   r<   r=   s   &&& @@r>   
wrap_indexrH   Q   s     JsEMM1123JtU]]2234  ${{{J #


%**K0 Z+W44rA   c                 F    V ^ 8  d   W) 8:  d   ^ # W,           # W8  d   V# V # r    )r2   r3   s   &&r>   wrap_index_literalrL      s*    
Qw%<:;KJrA   c                   \        V4      ^8  d   \        P                  ! V4      3p\        V^ ,          4      ^8  g   Q h\        ;QJ d*    R V^ ,          R,           4       F  '       d   K   RM	  RM! R V^ ,          R,           4       4      '       g   Q h\	        V^ ,          ^ ,          \        P
                  4      '       g   \        P                  ! R4      hR p\        \        P                  .VO5!  V3# )z
A function that asserts the inputs are of equivalent size,
and throws runtime error when they are not. The input is
a vararg that contains an error message, followed by a set
of objects of either array, tuple or integer.
c              3      "   T FM  p\        V\        P                  \        P                  \        P                  \        P
                  34      x  KO  	  R # 5iN)rB   r   ArrayCompatible	BaseTuple	SliceTyperD   ).0as   & r>   	<genexpr>assert_equiv.<locals>.<genexpr>   sJ       A 	1!!OOOOMM	
 	 	 s   AA   NNFTz&first argument must be a StringLiteralc           	        a aa	a
 \        V4      ^8X  g   Q h\        P                  ! SV^ ,          4      pVP                  ^ ,          pVP                  ^ ,          ^ ,          P                  o	VV 3R lo
VV V	V
3R lp\        ^\        V4      ^,
          4       F4  pV! WG,          WW,          WG^,           ,          WW^,           ,          4       K6  	  S P                  S\        P                  R4      pV# )rX   c                 ,  < \        V\        P                  4      '       d;   SP                  V4      ! SSV 4      p\        P
                  ! SVP                  4      # \        V\        P                  4      '       d   \        P
                  ! SV 4      # V .# rO   )rB   r   rP   
make_arrayr   unpack_tupleshaperQ   )rT   atyaryr-   r,   s   && r>   unpack_shapes4assert_equiv.<locals>.codegen.<locals>.unpack_shapes   sq    #u4455((-gwB++GSYY??C11++GQ77s
rA   c           
        < S! W4      pS! W#4      p\        V4      \        V4      8X  g   Q h\        WE4       F  w  rgSP                  R Wg4      pSP                  V4      ;_uu_ 4       w  rV	;_uu_ 4         RRR4       V
;_uu_ 4        SP                  P                  S\        S34       RRR4       RRR4       K  	  R#   + '       g   i     LS; i  + '       g   i     L1; i  + '       g   i     K  ; i)z==N)lenzipicmp_unsignedif_else	call_convreturn_user_excAssertionError)rT   r^   bbtyashapesbshapesmnm_eq_nthenorelser-   r,   msgr`   s   &&&&       r>   pairwise/assert_equiv.<locals>.codegen.<locals>.pairwise   s    #A+G#A+Gw<3w<///g/ ..tQ:__V,, ))99#^cV   -, 0  -,,s<   (C(5C7C(	#C,C(CC(C% C((C9N)	rc   r   r\   r/   literal_valuerangeget_constant_genericr   NoneType)r,   r-   r.   r/   tuptup_typert   irrs   r`   s   ff&&     @@r>   r?   assert_equiv.<locals>.codegen   s    4yA~~""7DG488A;hhqk!n**		 	 q#h-!+,ASVX[#!e*h1uoF -((%..$GrA   )
rc   r   StarArgTupleallrB   StringLiteralr   TypingErrorr   none)rG   valr?   s   &* r>   assert_equivr      s     3x!| !!#&(s1v;??3  Q333  Q     c!fQi!4!455  !IJJ D UZZ&#&//rA   c                   v   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tRtV tR# )EquivSetzHEquivSet keeps track of equivalence relations between
a set of objects.
Nc                V    V'       d   TM/ V n         V'       d   TM/ V n        W0n        R# )zTCreate a new EquivSet object. Optional keyword arguments are for
internal use only.
N)
obj_to_ind
ind_to_objnext_ind)selfr   r   r   s   &&&&r>   __init__EquivSet.__init__   s!     )3*(2* !rA   c                    \        4       # )z)Return an empty EquivSet object.
        )r   r   s   &r>   emptyEquivSet.empty   s     zrA   c                    \        \        P                  ! V P                  4      \        P                  ! V P                  4      V P
                  R7      # )Return a new copy.
        )r   r   next_id)r   copydeepcopyr   r   r   r   s   &r>   cloneEquivSet.clone   s8     }}T__5}}T__5MM
 	
rA   c                8    R P                  V P                  4      # )zEquivSet({}))formatr   r   s   &r>   __repr__EquivSet.__repr__   s    $$T__55rA   c                     V P                   / 8H  # )z=Return true if the set is empty, or false otherwise.
        )r   r   s   &r>   is_emptyEquivSet.is_empty   s     "$$rA   c                :    V P                   P                  VR4      # )z[Return the internal index (greater or equal to 0) of the given
object, or -1 if not found.
)r   get)r   xs   &&r>   _get_indEquivSet._get_ind   s     ""1b))rA   c                    WP                   9   d   V P                   V,          pV# V P                  pV ;P                  ^,          un        V# )ziReturn the internal index (greater or equal to 0) of the given
object, or create a new one if not found.
)r   r   )r   r   r|   s   && r>   _get_or_add_indEquivSet._get_or_add_ind   sA     "A  AMMQMrA   c                .  a  \        V4      ^8  g   Q h\        ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      p\        V4      p\        P                  ^8  d   \        RW4       VS P                  9   g   . S P                  V&   \        W!4       F  w  rEWC8X  dN   VS P                  V,          9   g4   S P                  V,          P                  V4       VS P                  V&   KV  KX  VS P                  9   d[   S P                  V,           F4  pVS P                  V&   S P                  V,          P                  V4       K6  	  S P                  V K  VS P                  V&   S P                  V,          P                  V4       K  	  R# )zHBase method that inserts a set of equivalent objects by modifying
self.
c              3   F   <"   T F  pSP                  V4      x  K  	  R # 5irO   )r   rS   r   r   s   & r>   rU   #EquivSet._insert.<locals>.<genexpr>  s     ;dT))!,,d   !z_insert:N)
rc   tupleminr   DEBUG_ARRAY_OPTprintr   rd   appendr   )r   objsindsindr|   objr   s   f&     r>   _insertEquivSet._insert
  s<    4y1}}u;d;uu;d;;$i!!Q&*d)t&#%DOOC $oFAxts33OOC(//4+.DOOC( 4 '!__Q//-0*,33A6 0 * ,/DOOC(OOC(//4 &rA   c                6  a V Uu. uF  q P                  V4      NK  	  pp\        V4      oSR8w  d;   \        ;QJ d    V3R lV 4       F  '       d   K   R# 	  R# ! V3R lV 4       4      # \        V Uu. uF  q"V^ ,          8H  NK  	  up4      # u upi u upi )zVTry to derive if given objects are equivalent, return true
if so, or false otherwise.
c              3   ,   <"   T F	  qS8H  x  K  	  R # 5irO   rK   )rS   r|   r   s   & r>   rU   $EquivSet.is_equiv.<locals>.<genexpr>1  s     .ACxs   FTr   )r   maxr   )r   r   r   r   r   s   &*  @r>   is_equivEquivSet.is_equiv*  s     +//$Qa $/$i"93..33.3.3....d3dT!Wd344 0
 4s   B6Bc                    V P                  V4      pV^ 8  d7   V P                  V,          pV F  p\        V\        4      '       g   K  Vu # 	  R# )zfCheck if obj is equivalent to some int constant, and return
the constant if found, or None otherwise.
N)r   r   rB   int)r   r   r   r   r   s   &&   r>   get_equiv_constEquivSet.get_equiv_const5  sH     mmC !8??3'Da%%H  rA   c                ~    V P                  V4      pV^ 8  d   \        V P                  V,          4      # \        4       # ).Return the set of equivalent objects.
        )r   setr   )r   r   r   s   && r>   get_equiv_setEquivSet.get_equiv_setA  s4     mmC !8ts+,,urA   c                $    V P                  V4      # )zInsert a set of equivalent objects by modifying self. This
method can be overloaded to transform object type before insertion.
)r   )r   r   s   &*r>   insert_equivEquivSet.insert_equivI  s     ||D!!rA   c                  a  S P                  4       pS P                  Vn        VP                  P                  4        F  p\        ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      p/ p\        WC4       F2  w  rgWe9   d   WV,          P                  V4       K$  V^ 8  g   K-  V.WV&   K4  	  VP                  4        F&  p\        V4      ^8  g   K  VP                  V4       K(  	  K  	  V# )zReturn the intersection of self and the given equiv_set,
without modifying either of them. The result will also keep
old equivalence indices unchanged.
c              3   F   <"   T F  pSP                  V4      x  K  	  R # 5irO   r   r   s   & r>   rU   %EquivSet.intersect.<locals>.<genexpr>X  s     84aq))4r   )	r   r   r   valuesr   rd   r   rc   r   )	r   	equiv_setnew_setr   r   r   r|   r   vs	   f&       r>   	intersectEquivSet.intersectO  s    
 **,==((//1D5848558488DJD?M((+!V%&CJM	 (  &&(q6A:OOA& ) 2 rA   )r   r   r   )NNr   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r>   r   r      sQ     !

6%
*	5@	5
" rA   r   c                      a a ] tR tRt oRtRV 3R lltR tR tR tR t	V 3R lt
V 3R	 ltR
 tV 3R ltV 3R ltV 3R ltR tR tR tR tV 3R ltR tR tRtVtV ;t# )ShapeEquivSetih  aP  Just like EquivSet, except that it accepts only numba IR variables
and constants as objects, guided by their types. Arrays are considered
equivalent as long as their shapes are equivalent. Scalars are
equivalent only when they are equal in value. Tuples are equivalent
when they are of the same size, and their elements are equivalent.
c                   < Wn         V'       d   TM/ V n        V'       d   TM/ V n        V'       d   TM/ V n        \        \
        V `  WEV4       R# )zCreate a new ShapeEquivSet object, where typemap is a dictionary
that maps variable names to their types, and it will not be modified.
Optional keyword arguments are for internal use only.
N)typemapdefs
ind_to_varind_to_constsuperr   r   )	r   r   r   r   r   r   r   r   	__class__s	   &&&&&&&&r>   r   ShapeEquivSet.__init__q  sA      !Db	 )3*,8LbmT+JGLrA   c                .    \        V P                  / 4      # )z'Return an empty ShapeEquivSet.
        )r   r   r   s   &r>   r   ShapeEquivSet.empty  s     T\\2..rA   c                z   \        V P                  \        P                  ! V P                  4      \        P                  ! V P                  4      \        P
                  ! V P                  4      \        P
                  ! V P                  4      V P                  \        P
                  ! V P                  4      R7      # )r   )r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   ind_toconstr   s   &r>   r   ShapeEquivSet.clone  sq     LL499%yy1}}T__5}}T__5MMt'7'78
 	
rA   c                d    R P                  V P                  V P                  V P                  4      # )z1ShapeEquivSet({}, ind_to_var={}, ind_to_const={}))r   r   r   r   r   s   &r>   r   ShapeEquivSet.__repr__  s*    BIIOOT__d.?.?
 	
rA   c                Z  a aa \        V\        P                  4      '       g   \        V\        4      '       Ed   \        V\        4      '       d   TMVP                  oSS P
                  9  d   S3# S P
                  S,          p\        V\        P                  \        P                  34      '       d   \        V\        P                  4      '       d   VP                  M
\        V4      pV^ 8X  d   S3# \        ;QJ d     . V3R l\        V4       4       F  NK  	  5# ! V3R l\        V4       4       4      # S3# \        V\        P                  4      '       d:   \        VP                  \        4      '       d   VP                  # VP                  3# \        V\        4      '       d9   V 3R lo\        ;QJ d    . V3R lV 4       F  NK  	  5# ! V3R lV 4       4      # \        V\        4      '       d   V3# \         P"                  ^8  d   \%        R\'        V4       R24       R# )zReturn a set of names for the given obj, where array and tuples
are broken down to their individual shapes or elements. This is
safe because both Numba array shapes and Python tuples are immutable.
c              3   H   <"   T F  pR P                  SV4      x  K  	  R# 5i)z{}#{}N)r   )rS   r|   names   & r>   rU   +ShapeEquivSet._get_names.<locals>.<genexpr>  s      N+Qa!8!8+s   "c                 \   < SP                  V 4      p\        V4      ^ 8w  d
   V^ ,          # V# rJ   )
_get_namesrc   )r   namesr   s   & r>   	get_names+ShapeEquivSet._get_names.<locals>.get_names  s*    *u:? 8OrA   c              3   4   <"   T F  pS! V4      x  K  	  R # 5irO   rK   )rS   r   r   s   & r>   rU   r     s     3s!1ss   zIgnoring untracked object type z in ShapeEquivSetrK   )rB   r   Varstrr   r   r   rQ   rP   ndimrc   r   rw   Constvaluer   r   r   r   type)r   r   typr   r   r   s   f&  @@r>   r   ShapeEquivSet._get_names  s   
 c266""jc&:&:$S#..3CHHD4<<'w,,t$C#1F1FGHH%c5+@+@AA  X  19 7N 5 N%+ N5N5 N%+ NNNwRXX&&#))U++yy 		|#U## 53s35353s333S!!6M!!Q&1$s)<MNP	rA   c                  <a \        V4      ^8  g   Q hV Uu. uF  q P                  V4      NK  	  ppV Uu. uF  q"R8w  g   K  VNK  	  pp\        V4      ^8:  d   R# V Uu. uF  p\        V4      NK  	  ppV^ ,          o\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g2   \        P                  ^8  d   \        RP                  V4      4       R# \        S4       F5  pV Uu. uF  qwV,          NK  	  pp\        \        V `*  ! V!  '       d   K4   R# 	  R# u upi u upi u upi u upi )zGOverload EquivSet.is_equiv to handle Numba IR variables and
constants.
Fc              3   .   <"   T F
  pSV8H  x  K  	  R # 5irO   rK   rS   r   r   s   & r>   rU   )ShapeEquivSet.is_equiv.<locals>.<genexpr>  s     ,e419e   Tz#is_equiv: Dimension mismatch for {}rK   )rc   r   r   r   r   r   r   rw   r   r   r   )
r   r   r   	obj_namesr   ndimsr|   obj_namer   r   s
   &*      @r>   r   ShapeEquivSet.is_equiv  s    4y1}}156A__Q'	6 )5	1"WQQ		5y>Q)23U3Qxs,e,sss,e,,,%%*;BB4HItA1:;Xa[[E;6>>   75 4 <s   D9D>D>#EEc                ~   < V P                  V4      p\        V4      ^8w  d   R# \        \        V `  V^ ,          4      # )zdIf the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise.
N)r   rc   r   r   r   r   r   r   r   s   && r>   r   ShapeEquivSet.get_equiv_const  s7     $u:?]D9%(CCrA   c                    V P                  V4      p\        V4      ^8w  d   R# V P                  V^ ,          4      pV P                  P	                  V. 4      pV. 8w  d
   V^ ,          # R# )zdIf the given object is equivalent to some defined variable,
return the variable, or None otherwise.
N)r   rc   r   r   r   )r   r   r   r   vss   &&   r>   get_equiv_varShapeEquivSet.get_equiv_var  s]     $u:?mmE!H%__  b)br!u*d*rA   c                ~   < V P                  V4      p\        V4      ^8w  d   R# \        \        V `  V^ ,          4      # )r   N)r   rc   r   r   r   r  s   && r>   r   ShapeEquivSet.get_equiv_set  s7     $u:?]D7aAArA   c                  < . pV F7  pW0P                   9   g   K  VP                  V P                   V,          4       K9  	  . pRp\        4       p\        V4       F  pWpP                  9   dZ   V P                  V,           FB  pVP
                  V9   d   K  VP                  V4       VP                  VP
                  4       KD  	  WpP                  9   g   K~  Ve   Q hV P                  V,          pK  	  \        \        V `+  V4       V P                   V^ ,          ,          p	\        V4       F"  pWpP                  9   g   K  V P                  V K$  	  W@P                  V	&   Ve   WPP                  V	&   R# R# )zCOverload EquivSet._insert to manage ind_to_var dictionary.
        N)r   r   r   sortedr   r   r+   r   r   r   r   )r   r   r   r   varlistconstvalr   r|   r   new_indr   s   &&        r>   r   ShapeEquivSet._insert   s3    Coo%DOOC01  AOO#++AFFeOq)		!&&) , %%%''',,Q/  	mT*40//$q'*TAOO#OOA&  $+ )1g&  rA   c                  <a \        V4      ^8  g   Q hV Uu. uF  q P                  V4      NK  	  ppV Uu. uF  q"R8w  g   K  VNK  	  pp\        V4      ^8:  d   R# \        V Uu. uF  p\        V4      NK  	  up. 4      pV Uu. uF  p\        V4      NK  	  ppV^ ,          o\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   Q RP                  V4      4       h. p. pV F  p\        V\        4      '       g   V3pV F  p	\        V	\        P                  4      '       dQ   V	P                  V9   g@   V	P                  V P                  9   d   VP                  ^ V	4       MVP                  V	4       \        V	\        P                  4      '       g   K  V	P                  V9   d   K  VP                  V	P                  4       K  	  K  	  V F  pVP                  p
W9   g   K  WP                   9   d   K)  V
.V P"                  V P$                  &   V P$                  V P                   V
&   V.V P&                  V P$                  &   V ;P$                  ^,          un        K  	  V F  pW9   g   K  WP                   9   d   K  V.V P"                  V P$                  &   V P$                  V P                   V&   WP(                  V P$                  &   V ;P$                  ^,          un        K  	  Rp\+        S4       F8  pV Uu. uF  qV,          NK  	  pp\,        \.        V `b  ! V!  pT;'       g    TpK:  	  V# u upi u upi u upi u upi u upi )zOverload EquivSet.insert_equiv to handle Numba IR variables and
constants. Input objs are either variable or constant, and at least
one of them must be variable.
Nc              3   .   <"   T F
  pSV8H  x  K  	  R # 5irO   rK   r  s   & r>   rU   -ShapeEquivSet.insert_equiv.<locals>.<genexpr>)  s      
$!DAIur  FTzDimension mismatch for {}rK   )rc   r   sumlistr   r   rB   r   r   r   r   r   insertr   r   r   r   r   r   r   r   rw   r   r   r   )r   r   r   r  r   r  r  	constlistr   varr   constsome_changer|   r	  ie_resr   r   s   &*              @r>   r   ShapeEquivSet.insert_equiv  s   
 4y1}}156A__Q'	6 )5	1"WQQ		5y>Qi0iT!Wi0"5!*+AQ+Qxs 
$
sss 
$
 
 
 	4&--d3	4 
 	Cc5))fc266**CHH4Gxx499,q#.s+c288,,cii96L$$SYY/   C88D}doo&=26.(,%25."  E~u'?27.)-&38!!$--0"  tA1:;Xa[[E;=$<eDF%//K 
 c 75 1+P <s"   MMM(MM"M'c                (    V P                  V4      RJ# )zEReturn true if the shape of the given variable is available.
        N)	get_shaper   r   s   &&r>   	has_shapeShapeEquivSet.has_shapeU  s     ~~d#4//rA   c                .    \        V P                  V4      # )zdReturn a tuple of variables that corresponds to the shape
of the given array, or None if not found.
)r   
_get_shaper(  s   &&r>   r'  ShapeEquivSet.get_shapeZ  s     T__d++rA   c                x   V P                  V4      p\        VR8g  4       . pV F  p\        W@P                  9   4       V P                  V,          pV. 8w  d   VP                  V^ ,          4       KN  \        W@P                  9   4       V P                  V,          pVP                  V4       K  	  \        V4      # )ztReturn a tuple of variables that corresponds to the shape
of the given array, or raise GuardException if not found.
rK   )get_shape_classesr   r   r   r   r   )r   r   r   r]   r|   r  s   &&    r>   r,  ShapeEquivSet._get_shape`  s     %%d+
AA()#BRxRU#.../&&q)R   U|rA   c                  a  \        V\        P                  4      '       d   VP                  pVS P                  9   d   S P                  V,          MRp\        V\
        P                  \
        P                  \
        P                  34      '       g   . # \        V\
        P                  4      '       d   VP                  ^ 8X  d   . # S P                  V4      p\        ;QJ d    . V 3R lV 4       F  NK  	  5pV# ! V 3R lV 4       4      pV# )zInstead of the shape tuple, return tuple of int, where
each int is the corresponding class index of the size object.
Unknown shapes are given class index -1. Return empty tuple
if the input name is a scalar variable.
Nc              3   F   <"   T F  pSP                  V4      x  K  	  R # 5irO   r   )rS   r   r   s   & r>   rU   2ShapeEquivSet.get_shape_classes.<locals>.<genexpr>  s     ;UTT]]4((Ur   )rB   r   r   r   r   r   rQ   rR   rP   r   r   r   )r   r   r   r   r   s   f&   r>   r/  ShapeEquivSet.get_shape_classesr  s     dBFF##99D$(DLL$8dll4 ds%2G2G   Ic50011chh!mI%u;U;u ;U;;rA   c                ~  < \         \        V `  V4      p/ pVP                  P	                  4        F  w  rE\        V4      ^ 8  g   Q hV^ ,          pW`P                  9   g   Q hWaP                  9   g   Q hV P                  V,          pVP                  V,          pWpP                  9   g   Q hWP                  9   g   Q h. p	VP                  V,           U
u. uF  qP                  NK  	  pp
V P                  V,           F'  p
V
P                  V9   g   K  V	P                  V
4       K)  	  WV&   K  	  W2n        V# u up
i )z<Overload the intersect method to handle ind_to_var.
        )
r   r   r   r   itemsrc   r   r   r   r   )r   r   newsetr   r|   r   r   jkr  r   r   r   s   &&          r>   r   ShapeEquivSet.intersect  s!    }d5i@
((..0GAt9q= =q'C//))).....$A$$S)A''',,,,,G%.%9%9!%<=%<VV%<E=__Q''66U?NN1% ( $qM 1 ' >s   D:c                   \        V\        P                  4      '       d   VP                  pWP                  9   Ed   V P                  V;;,          ^,          uu&   \        V P                  V4      4      pV EFg  pW@P                  9   g   K  VP                  V4       V P                  V,          pV P                  V V P                  V,          P                  V4       V P                  V,          . 8X  d   V P                  V WPP                  9   g   Q hV P                  V,           Uu. uF  qfP                  NK  	  ppW9   g   K  VP                  V4      pV P                  V,          V V P                  V,          . 8X  g   EK  V P                  V WPP                  9   g   EK3  V P                  V,           F  p	V P                  V	 K  	  V P                  V EKj  	  R# ^V P                  V&   R# u upi )aU  Increment the internal count of how many times a variable is being
defined. Most variables in Numba IR are SSA, i.e., defined only once,
but not all of them. When a variable is being re-defined, it must
be removed from the equivalence relation and added to the redefined
set but only if that redefinition is not known to have the same
equivalence classes. Those variables redefined are removed from all
the blocks' equivalence sets later.

Arrays passed to define() use their whole name but these do not
appear in the equivalence sets since they are stored there per
dimension. Calling _get_names() here converts array names to
dimensional names.

This function would previously invalidate if there were any multiple
definitions of a variable.  However, we realized that this behavior
is overly restrictive.  You need only invalidate on multiple
definitions if they are not known to be equivalent. So, the
equivalence insertion functions now return True if some change was
made (meaning the definition was not equivalent) and False
otherwise. If no change was made, then define() need not be
called. For no change to have been made, the variable must
already be present. If the new definition of the var has the
case where lhs and rhs are in the same equivalence class then
again, no change will be made and define() need not be called
or the variable invalidated.
N)rB   r   r   r   r   r  r   r   r+   r   remover   index)
r   r   	redefinedname_resone_namer|   r   r   r8  r   s
   &&&       r>   defineShapeEquivSet.define  s   6 dBFF##99D99IIdOq ODOOD12H$ .MM  1A1OOA&--h7q)R/ OOA.///-1__Q-?@-?VV-?E@}!KK- OOA.q1??1-3 $ 2 OO3+/??1+=+=C(,(< ,>$(OOA$61 %4  DIIdO As   .G8c                l    VP                  4        F  w  r4V^ 8  g   K  V P                  W24       K!  	  R# )zUnion with the given defs dictionary. This is meant to handle
branch join-point, where a variable may have been defined in more
than one branches.
N)r6  rA  )r   r   r>  r9  r   s   &&&  r>   
union_defsShapeEquivSet.union_defs  s)    
 JJLDA1uA) !rA   )r   r   r   r   )NNNNr   N)r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r)  r'  r,  r/  r   rA  rD  r   r   __classcell__r   r   s   @@r>   r   r   h  so     M8/



)V*D	+B287r0
,$,.: x* *rA   r   c                      a a ] tR tRt oRtRV 3R lltR tR tR tR t	RV 3R llt
RV 3R	 lltV 3R
 ltR tV 3R ltRtVtV ;t# )SymbolicEquivSeti  a  Just like ShapeEquivSet, except that it also reasons about variable
equivalence symbolically by using their arithmetic definitions.
The goal is to automatically derive the equivalence of array ranges
(slicing). For instance, a[1:m] and a[0:m-1] shall be considered
size-equivalence.
c
                   < V'       d   TM/ V n         V'       d   TM/ V n        V'       d   TM/ V n        / V n        / V n        \
        \        V `  WWgW4       R# )zCreate a new SymbolicEquivSet object, where typemap is a dictionary
that maps variable names to their types, and it will not be modified.
Optional keyword arguments are for internal use only.
N)def_byref_by
ext_shapesrel_mapwrap_mapr   rI  r   )r   r   rK  rL  rM  r   r   r   r   r   r   s   &&&&&&&&&&r>   r   SymbolicEquivSet.__init__  sS    & !'fB
 !'fB )3*
  .::	
rA   c                ,    \        V P                  4      # )z*Return an empty SymbolicEquivSet.
        )rI  r   r   s   &r>   r   SymbolicEquivSet.empty  s      --rA   c                    R P                  V P                  V P                  V P                  V P                  V P
                  4      # )zHSymbolicEquivSet({}, ind_to_var={}, def_by={}, ref_by={}, ext_shapes={}))r   r   r   rK  rL  rM  r   s   &r>   r   SymbolicEquivSet.__repr__   s9    ((.)		
rA   c                   \        V P                  \        P                  ! V P                  4      \        P                  ! V P                  4      \        P                  ! V P
                  4      \        P                  ! V P                  4      \        P                  ! V P                  4      \        P                  ! V P                  4      \        P                  ! V P                  4      V P                  R7	      # )r   )rK  rL  rM  r   r   r   r   r   )rI  r   r   rK  rL  rM  r   r   r   r   r   r   r   s   &r>   r   SymbolicEquivSet.clone,  s      LL99T[[)99T[[)yy1499%yy1}}T__5}}T__5MM

 
	
rA   c                .    \        V P                  V4      # )zZRetrieve a definition pair for the given variable,
or return None if it is not available.
)r   _get_or_set_relr(  s   &&r>   get_relSymbolicEquivSet.get_rel;  s     T))400rA   c                  <a aa \        V\        P                  4      '       d   VP                  p\	        S P
                  P                  V^ 4      ^8H  4       VS P                  9   d   S P                  V,          # \	        VRJ4       R oVV3R lo\        W!4      pV^ 3p\        V\        P                  4      '       Ed   VP                  R8X  d   \        W#S P                  R7      w  rVVR8X  d   VR8X  d   \        ;QJ d!    . V 3R lVP                   4       F  NK  	  5M! V 3R lVP                   4       4      pR
V9   d   R# S P                  P                  V. 4      pVP!                  V4       \#        V4      ^ 8  d   S P%                  V4       VS P                  V&   MVP                  R	8X  d   S P'                  VP(                  V4      p	S P'                  VP*                  V4      p
V	e   V
f   R# VP,                  \.        P0                  8X  d
   S! W4      pMtVP,                  \.        P2                  8X  d	   S! W4      pML\        V\        P4                  4      '       d-   \        VP6                  \8        4      '       d   VP6                  p\	        VRJ4       VS P                  V&   \        V\8        4      '       g5   \        V\        4      '       Ed!   V^ ,          V8w  g   V^,          ^ 8w  Ed   \        V\        4      '       d   Vw  rVS P:                  9   g   . S P:                  V&   S P:                  V,          P!                  W) 34       S P=                  V4      pV^ 8  d   S P>                  V,          p. pV FO  pVS P:                  9   g   K  TS P:                  V,           UUu. uF  w  ppVV) 8X  g   K  VNK  	  upp,          pKQ  	  \#        V4      ^8  d   \@        \B        S `K  V4       V# u uppi )zRetrieve a definition pair for the given variable,
and if it is not already available, try to look it up
in the given func_ir, and remember it for future use.
Nc                     \        V \        4      p\        V\        4      pV'       d   V'       d	   W,           # Vw  rEW@V,           3# V w  rEV'       d   WAV,           3# R # rO   rB   r   )r   y
x_is_const
y_is_constr!  offsets   &&    r>   plus.SymbolicEquivSet._get_or_set_rel.<locals>.plusN  sU    '3/
'3/
! u() #Z00$%MS! #Z00#rA   c                    < \        V\        4      '       d
   S! W) 4      # \        V \        4      '       dC   \        V\        4      '       d-   V ^ ,          V^ ,          8X  d   S! V ^,          V^,          4      # R# r   N)rB   r   r   )r   r^  minusrb  s   &&r>   rf  /SymbolicEquivSet._get_or_set_rel.<locals>.minus^  s]    a%%2;&q%(("1e,,!! 1qt,,rA   callr   rH   znumba.parfors.array_analysisc              3   p   <"   T F+  pSP                   P                  VP                  R4      x  K-  	  R# 5i)rX   Nr   )r   r   r   r   s   & r>   rU   3SymbolicEquivSet._get_or_set_rel.<locals>.<genexpr>u  s,      &ENDOO//;;Ys   36binopr   )"rB   r   r   r   r   r   r   rK  r   Expropr   r   r   r/   rM  r   rc   r   rX  lhsrhsfnoperatorr+   subr   r   r   rL  r   r   r   rI  )r   r   func_irexprr   fnamemod_namer=  r   ro  rp  r!  ra  r   r   r   r   r|   rf  rb  r   s   f&&               @@r>   rX   SymbolicEquivSet._get_or_set_relA  s(   
 dBFF##99D		dA&!+,4;;;;t$$G4'($ 
  "'0D1IE$((77f$&3t||'OE -$(FF % &EIYY& &EIYY& ! ;#' $ 3 3E2 >T*u:> LL/16.WW'..txxAC..txxAC {ck#HLL0 $SHLL0 %cD"((++
4::s0K0K

E%& %DKK%%%5%((1X%qQ eU++$)MS4;;.+-C(KK$++T7O<--,Cax#s3 "#'C"dkk1 %26++c2B*"2BA'(VG| %&A2B*" !" $( u:>!"2DA%HL*"s   8P

P
c                  < \        V\        P                  4      '       d   VP                  pMTp\        \
        V `  WR4       V'       Ed*   V P                  P                  V^ 4      ^8X  Ed   \        V\        P                  4      '       d   \        V P                  WS4      p\        V\        4      '       d   V P                  WV.4       \        V\        P                  4      '       d   V P                  V4      pWpP                   9   g   V.V P                   V&   WpP"                  V&   WpP$                  9   d%   V P$                  V,          P'                  V4       R# V.V P$                  V&   R# R# R# R# )a6  Besides incrementing the definition count of the given variable
name, it will also retrieve and simplify its definition from func_ir,
and remember the result for later equivalence comparison. Supported
operations are:
  1. arithmetic plus and minus with constants
  2. wrap_index (relative to some given size)
TN)rB   r   r   r   r   rI  rA  r   r   r   Numberr   rX  r   r   r   r   r   r   r   )	r   r!  r>  rt  r   r   r   r   r   s	   &&&&&   r>   rA  SymbolicEquivSet.define  s    c266""88DD,T=G		dA&!+3--$..>E%%%d]+#rvv&&**40.,06DOOC(,/OOD)//)OOC(//4  -05DOOC( . , rA   c                  < \        4       p\        4       pV FX  pV P                  V4      pVR8X  d   VP                  V4       K.  WR9   d   K6  VP                  V4       VP                  V4       KZ  	  \        V4      ^8:  d   R# \	        V4      p\
        \        V `  V4       V P                  V P                  V^ ,          4      ,          p/ pR pV F  pW@P                  9   d   V P                  V,          p\        V\        4      '       dh   Vw  rV! Wj) 4      P                  V	4       WP                  9   d<   V P                  V	,           F$  w  rV! WjV,           ) 4      P                  V4       K&  	  W@P                  9   g   K  V P                  V,           F  w  rV! Wj4      P                  V	4       K  	  K  	  VP                  4        F  pV P                  V4       K  	  R# )zOverload _insert method to handle ind changes between relative
objects.  Returns True if some change is made, false otherwise.
Fc                 2    W9   d   W,          pV# . pW V&   V# rO   rK   )dr9  r   s   && r>   
get_or_set,SymbolicEquivSet._insert.<locals>.get_or_set  s(    vD H !HrA   Tr   )r   r   r+   rc   r  r   rI  r   r   rK  rB   r   r   rL  r   )r   r   indsetuniqsr   r   offset_dictr  r   r   ra  r   r|   r   r   s   &&            r>   r   SymbolicEquivSet._insert  s    C--$Cby		#m		#

3  u:?U-e4t}}U1X67 	 Ckk!C(eU++%*NT{G4;;DA{{*&*kk$&7&7FQ&{qjMBII!L '8kk!&*kk#&6&6NT{3::4@ '7  !'')ELL *rA   c                    \        V\        P                  \        P                  34      '       g   Q hW P                  V&   R# )z-remember shapes of SetItem IR nodes.
        N)rB   r   StaticSetItemSetItemrM  )r   r   r]   s   &&&r>   set_shape_setitem"SymbolicEquivSet.set_shape_setitem  s2     # 0 0"**=>>>>$rA   c                  < \        V\        P                  \        P                  34      '       d+   \	        WP
                  9   4       V P
                  V,          # \        V\        P                  4      '       g   Q hV P                  VP                  ,          p\        V\        P                  4      '       d   V3# \        \        V `7  V4      # )zGOverload _get_shape to retrieve the shape of SetItem IR nodes.
        )rB   r   r  r  r   rM  r   r   r   r   rR   r   rI  r,  )r   r   r   r   s   && r>   r,  SymbolicEquivSet._get_shape  s     cB,,bjj9::C??*+??3''c266****,,sxx(C#u//v-t?DDrA   )rK  rM  rL  rN  rO  )NNNNNNNr   rO   NN)r   r   r   r   r   r   r   r   r   rY  rX  rA  r   r  r,  r   r   rF  rG  s   @@r>   rI  rI    sH     +
Z.



1kZB,\%E ErA   rI  c                   *   a  ] tR tRt o RtR tRtV tR# )WrapIndexMetai  an  
Array analysis should be able to analyze all the function
calls that it adds to the IR.  That way, array analysis can
be run as often as needed and you should get the same
equivalencies.  One modification to the IR that array analysis
makes is the insertion of wrap_index calls.  Thus, repeated
array analysis passes should be able to analyze these wrap_index
calls.  The difficulty of these calls is that the equivalence
class of the left-hand side of the assignment is not present in
the arguments to wrap_index in the right-hand side.  Instead,
the equivalence class of the wrap_index output is a combination
of the wrap_index args.  The important thing to
note is that if the equivalence classes of the slice size
and the dimension's size are the same for two wrap index
calls then we can be assured of the answer being the same.
So, we maintain the wrap_map dict that maps from a tuple
of equivalence class ids for the slice and dimension size
to some new equivalence class id for the output size.
However, when we are analyzing the first such wrap_index
call we don't have a variable there to associate to the
size since we're in the process of analyzing the instruction
that creates that mapping.  So, instead we return an object
of this special class and analyze_inst will establish the
connection between a tuple of the parts of this object
below and the left-hand side variable.
c                    Wn         W n        R # rO   )
slice_sizedim_size)r   r  r  s   &&&r>   r   WrapIndexMeta.__init__/  s    $ rA   )r  r  N)r   r   r   r   r   r   r   r   r   s   @r>   r  r    s     6! !rA   r  c                   z  a  ] tR tRt o ^ t R tR tR tRcR ltR t	R t
R	 tR
 tR t ! R R]4      tR tR tR tR tR tRdR ltR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R( t*R) t+R* t,R+ t-R, t.R- t/R. t0R/ t1R0 t2R1 t3R2 t4R3 t5R4 t6R5 t7R6 t8R7 t9R8 t:R9 t;R: t<R; t=R< t>R= t?R> t@R? tAR@ tBRA tCRB tDRC tERD tFRE tGRF tHRG tIRH tJRI tKRJ tLRK tMRL tNRM tORN tPRO tQRP tRRQ tSRR tTRS tURT tVRU tWRV tXRW tYRX tZRY t[RZ t\R[ t]ReR\ lt^ReR] lt_R^ t`R_ taR` tbRa tcRbtdV teR# )fArrayAnalysisi4  c                |    Wn         W n        W0n        W@n        / V n        / V n        / V n        / V n        / V n        R # rO   )	r,   rt  r   	calltypes
equiv_setsarray_attr_callsobject_attrsprependspruned_predecessors)r   r,   rt  r   r  s   &&&&&r>   r   ArrayAnalysis.__init__>  s>    "  "#% rA   c                (    V P                   V,          # )zAReturn the equiv_set object of an block given its label.
        )r  )r   block_labels   &&r>   r   ArrayAnalysis.get_equiv_setO  s     {++rA   c                    \        4       pV F:  pV P                   F'  pV P                  V,          pVP                  W24       K)  	  K<  	  R# )zTake a set of variables in redefineds and go through all
the currently existing equivalence sets (created in topo order)
and remove that variable from all of them since it is multiply
defined within the function.
N)r   r  rA  )r   
redefinedsunusedr}   eslabeless   &&    r>   remove_redefinedsArrayAnalysis.remove_redefinedsT  s=     A??__W-		!$ + rA   Nc                d   Vf   V P                   P                  p\        V P                   P                  4      V P                   n        Vf   \	        V P
                  4      pMTp\        VV P                   P                  V P
                  V P                   4      w  V n        V n	        \        P                  p\        ;P                  ^,          un        \        P                  ^8  d   \        RV4       \        V P                   RV4       \        P                  ^8  dD   \        R\!        V P
                  P#                  4       4      4       \        RV P$                  4       \'        V4      p\)        WR7      pV P+                  WaWS4       \        P                  ^8  dT   V P-                  4        \        R\!        V P
                  P#                  4       4      4       \        RV P$                  4       \        V P                   R	V4       \        P                  ^8  d   \        R
V4       R# R# )zqrun array shape analysis on the given IR blocks, resulting in
modified IR and finalized EquivSet for each block.
NzStarting ArrayAnalysis:zbefore array analysiszArrayAnalysis variable types: zArrayAnalysis call types: )cfgz#ArrayAnalysis post variable types: zArrayAnalysis post call types: zafter array analysiszEnding ArrayAnalysis:)rt  blocksr   _definitionsrI  r   r   	arg_names	alias_maparg_aliasesr  aa_countr   r   r   r
   r  r6  r  r   r	   _run_on_blocksdump)r   r  r   init_equiv_setaa_count_saver  
topo_orders   &&&    r>   runArrayAnalysis.run`  s    >\\((F$5dll6I6I$J!-dll;N&N+ALL""LLLL	,
(( &..!#!!Q&+];t||%<fE!!Q&0&9K9K9M2N .?%f-$V5
JD!!Q&IIK5t||))+, 3T^^Dt||%;VD!!Q&)=9 'rA   c                    V F\  p\         P                  ^8  d   \        RV4       W%,          pVP                  pV P	                  W6WWV4      pV P                  Wh4       K^  	  R# )   zProcessing block:N)r   r   r   scope_determine_transform_combine_to_new_block)	r   r  r  r  r  labelblockr  pending_transformss	   &&&&&    r>   r  ArrayAnalysis._run_on_blocks  s]    E%%*)51MEKKE!%!:!:E." &&uA  rA   c                    . pV FK  w  rEpV F  pVP                  V4       K  	  VP                  V4       V F  pVP                  V4       K  	  KM  	  W1n        R# )zGCombine the new instructions from previous pass into a new block
body.
N)r   body)r   r  r  new_bodyinstprepostinstrs   &&&     r>   r  #ArrayAnalysis._combine_to_new_block  sV     1ODt& OOD!& 	  2 
rA   c           	     $   RpVP                  V4      pW0P                  9   d   V P                  V,          pM. p\        P                  ^8  d   \	        RV4       V EF0  w  r\        P                  ^8  d   \	        RW4       W9   d   K/  WP
                  9   g   KA  V P
                  V	,          P                  4       p\        P                  ^8  d   \	        RV4       W3V P                  9   dL   V P                  W3,          pV F1  p\        4       pV P                  W4WV4       V P                  V4       K3  	  Vf   TpK  VP                  V4      p\        4       pVP                  VP                  V4       V P                  V4       EK3  	  Vf   TpW`P
                  V&   . pVP                   FX  p\        4       pV P                  W4WmV4      w  pp\        V4      ^ 8  d   V P                  V4       VP!                  VVV34       KZ  	  V# )zGDetermine the transformation for each instruction in the block
        Nzpreds:zp, q:zp in equiv_sets)predecessorsr  r   r   r   r  r   r  r   _analyze_instr  r   rD  r   r  rc   r   )r   r  r  r  r  r  r   predsprunedpqfrom_setinstrsr  r>  r  r  r  s   &&&&&&            r>   r  "ArrayAnalysis._determine_transform  s    	  ',,,--e4FF !!Q&(E"FQ%%*gq${OO#??1-335))Q.+X6:.!]]A:6F &$'E	**!() ..y9 !' $ (I ) 3 3H =I #I((	B **95; @ &I!*  JJDI**iyIC
 9~!&&y1%%tS$&78  "!rA   c                2    \        RV P                  4       R# )z@dump per-block equivalence sets for debugging purposes.
        zArray Analysis: N)r   r  r   s   &r>   r  ArrayAnalysis.dump  s     	 $//2rA   c                    W0P                   VP                  &   V.V P                  P                  VP                  &   \	        4       pVP                  W%V P                  V4       R # rO   )r   r   rt  r  r   rA  )r   r   r!  r   r   r  s   &&&&& r>   _defineArrayAnalysis._define  sI    !$SXX/4g!!#((+U
$,,<rA   c                   &   a  ] tR tRt o R tRtV tR# )ArrayAnalysis.AnalyzeResulti  c                    Wn         R # rO   kwargs)r   r  s   &,r>   r   $ArrayAnalysis.AnalyzeResult.__init__  s     KrA   r  N)r   r   r   r   r   r   r   r   s   @r>   AnalyzeResultr    s     	! 	!rA   r  c           
     b  a aaaaa&a' . p. p\         P                  ^8  d   \        RS4       \        S\        P
                  4      '       Edq   SP                  pS P                  VP                  ,          p	Rp
\        V	\        P                  4      '       d   V	P                  ^ 8X  d   Rp
EM3\        SP                  \        P                  4      '       d   S P                  SSSP                  V4      pV'       d   \        \        V\         P"                  4      4       RVP$                  9   d   VP$                  R,          p
RVP$                  9   d#   VP'                  VP$                  R,          4       RVP$                  9   d#   VP'                  VP$                  R,          4       RVP$                  9   d   VP$                  R,          Sn        EM\        SP                  \        P(                  \        P*                  34      '       d   SP                  p
EM\        SP                  \        P,                  4      '       d   SP                  P                  p\        V\.        4      '       d?   \0        ;QJ d    R V 4       F  '       d   K   RM	  R	M! R V 4       4      '       d   Tp
EM/\        V\2        4      '       d   V3p
EM\        SP                  \        P4                  4      '       d   \        V	\        P6                  P8                  4      '       d8   \        V	P:                  \        P<                  4      '       d   SP                  p
M\        V	\        P6                  P>                  4      '       d`   \1        V	P                   Uu. uF-  p\        V\        P<                  \        P@                  34      NK/  	  up4      '       d   SP                  p
\        V
\        P*                  4      '       d   \        V
P                  \.        4      '       dU   V
PB                  o'\.        ;QJ d!    . V'3R
 lV
P                   4       F  NK  	  5M! V'3R
 lV
P                   4       4      p
EM\        V
P                  \2        4      '       d   V
3p
MRp
M\        V
\        P(                  4      '       d@   \        S P                  V
P                  ,          \        P<                  4      '       d   V
3p
M~\        V
\D        4      '       di    SPG                  WS PH                  V	4       SPK                  VP                  4      pVR8w  d&   VSPL                  V
PN                  V
PP                  3&   Wg3# \        V	\        P                  4      '       d   V
eh   \        V
\        P(                  4      '       dH   \        S P                  V
P                  ,          \        P6                  PR                  4      '       d   EMzV
eN   \        V
\.        4      '       g8   \        V
\        P(                  4      '       d5   SPU                  V
4      '       g   S PW                  SWP                  W4      p
EM
\        V	\        P8                  4      '       dQ   V
'       dH   \        V	P:                  \        P<                  4      '       d   S PW                  SV\Y        V	4      W4      p
M\        V	\        P6                  P>                  4      '       dq   \1        V	P                   Uu. uF-  p\        V\        P<                  \        P@                  34      NK/  	  up4      '       d   S PW                  SV\Y        V	4      W4      p
 R	pV
e   SP[                  W4      pV'       d   SPG                  WS PH                  V	4       Wg3# \        S\        P\                  \        P^                  34      '       Ed`   \        S\        P^                  4      '       d   SP`                  MSPb                  p\e        S Pf                  SSSP                  V4      pV'       g   . . 3# V^ ,          eA   \        S\        P\                  \        P^                  34      '       g   Q hV^ ,          Sn0        V^,          pVP$                  R,          pRVP$                  9   d   VP$                  R,          pSPi                  SP                  4      pVR8X  d   SPk                  SV4       V. 3# VEe-   S P                  SP                  P                  ,          p\        \        V\        P                  4      4       VP                  pVV.pSP                  P                  SP                  P                  .pS Pm                  SSSPB                  VV4      p\        RVP$                  9   4       \        RVP$                  9   4       VP$                  R,          p
VP$                  R,          p\Y        V
4      pVV8  g   Q hSPk                  SV
4       VV,           . 3# V. 3# \        S\        Pn                  4      '       Edu   V&VVVVV 3R lpSPp                  o&\e        \r        S PH                  S&4      pV'       EgI   SPu                  S&4      p. pV F  p\        V\v        4      '       dx   VS P                  9   dg   \e        \r        S PH                  VR	R7      p\        V\        P(                  4      '       d   VP                  pV'       d   VPy                  V4       K  K  VPy                  V4       K  	  \{        \}        R V4      4      p \{        V4      P                  V 4      p!\Y        V!4      ^8X  d   \        V!4      ^ ,          pM;\Y        V 4      ^8X  d,   \e        \r        S PH                  \        V 4      ^ ,          4      p\        V\        P                  4      '       d   VP                  R8X  d   V! V4       Wg3# \        V\        P                  4      '       d   VP                  R8X  d   \e        \r        S PH                  VP                  4      p"V"e   V"P                  \        J d   \Y        VP                  4      ^8X  dj   \e        \r        S PH                  VP                  ^ ,          4      p#V#e:   \        V#\        P                  4      '       d   V#P                  R8X  d	   V! V#4       Wg3# \        V\        P*                  4      '       d   VP                  p\        V\2        4      '       g   \        V\        4      '       dg   V'       d   SP                  MSP                  p$V$S P                  9   d&   S P                  V$,          Py                  S4       Wg3# S.S P                  V$&   Wg3# \        S4      \        9   d.   \        \        S4      ,          p%V%! SSS P                  S 4      w  rgWg3# u upi u upi )r  zanalyze_inst:Nr]   r  r  rp  c              3   B   "   T F  p\        V\        4      x  K  	  R # 5irO   r]  )rS   r   s   & r>   rU   .ArrayAnalysis._analyze_inst.<locals>.<genexpr>  s     CFq
1c 2 2Fs   FTc              3   R   <"   T F  p\         P                  ! VS4      x  K  	  R # 5irO   )r   r   )rS   r   locs   & r>   rU   r  2  s     !HKq"((1c"2"2Ks   $'c                 6  < R pV P                   \        P                  8X  d   SP                  pSP                  p^pM9V P                   \        P
                  8X  d   SP                  pSP                  p^ pSP                  V P                  P                  ,          pSP                  V P                  P                  ,          pVEeP   \        V\        P                  4      '       d!   \        V\        P                  4      '       gA   \        V\        P                  4      '       d   \        V\        P                  4      '       d   SP                  pV P                  V P                  3pSP                  SVS
V4      pVP!                  \"        P$                  ! \"        P&                  ! XV4      S	V4      4       VSP(                  SV3&   \"        P$                  ! \"        P&                  ! ^V,
          V4      S	V4      .SP(                  SX3&   R # R # R # R # rO   )rq  rr  eqtruebrfalsebrner   ro  r   rp  rB   r   rD   rQ   r  _make_assert_equivr   r   Assignr   r  )cond_defbrotherbrcond_vallhs_typrhs_typr  r/   assertscond_varr   r  r  r  r   s   &        r>   handle_call_binop6ArrayAnalysis._analyze_inst.<locals>.handle_call_binop  s   ;;(++-B"llG H[[HKK/B"kkG H,,x||'8'89,,x||'8'89>"7EMM::&w>> #7EOO<<&w@@ ((C$LL(,,7D"55sItG NN		"((8S"98SI 29DMM5"+.		"((1x<"=xM7DMM5'"23 A = "rA   )lhs_onlyc                 "    \        V \        4      # rO   )rB   r   )r   s   &r>   <lambda>-ArrayAnalysis._analyze_inst.<locals>.<lambda>  s    z!S/ArA   rl  rh  rK   r   )Jr   r   r   rB   r   r  targetr   r   r   rP   r   r   rm  _analyze_exprr   r  r  r  extendr   r   Globalr   r   r   Arg
containersUniTupledtyperD   TupleIntegerLiteralr  r  rA  rt  r   rO  r  r  rQ   r)  _gen_shape_callrc   r   r  r  r=  	index_varr   _index_to_shaper'  r  _broadcast_assert_shapesBranchcondr   r   r   r   r   filter
differencer  rn  funcboolr/   r  r  r  r   array_analysis_extensions)(r   r  r  r   r  r>  r  r  ro  r   r]   resultgvaluer   lhs_indneeds_definer=  target_shapevalue_shape
target_typtarget_ndimshapesr   broadcast_resultr  ro   r  r  equivsr   r   var_defdefvars	defconsts	glbl_bool	condition	pruned_brfr  r  s(   fffff&                                @@r>   r  ArrayAnalysis._analyze_inst  sa
   !!Q&/4(dBII&&++C,,sxx(CE#u4455#((a-DJJ00++E9djj#NJv}/J/JKL&--/ &g 6-

6==#78.FMM&$9:-%+]]5%9
DJJ(:;;

DJJ		22)) vu--CCFCCCCCFCCC"E,,#IEDJJ//sE$4$4$=$=>>"399emm<< JJEsE$4$4$:$:;;!$,!*A ("]]E,@,@AC!*,  
 !JJE%**ekk511))C!E!HEKK!HEE!HEKK!HHES11"HE EE266**zUZZ(%--0 0 E=11   sC#,,SXX6b=   &&))5>>: y #u4455%"5"&&11"UZZ0%2B2B2L2L  M!%//"5"&&11 ) 3 3E : : !00!3%E C00Z		5==AA 00!3C%E 3 0 0 6 677 YY(& $A(<(<=?&(  
 ,,sCHe  L (55cA  sCH yG r//<==(rzz::

  $$eYUF 2vay$!$)9)92::(FGGGG#AY
AYF!==1L%mmE*#--djj9Kb ++D,?Bw(!\\$++*:*:;

:u/D/DEF(oo&4))4::??;#'#@#@9dhh$  #3#:#::;!1!8!889(//8*11%8J"a'''++D%8W}b((Bwbii((! !F yyH^T\\8DH8"00:"D!$,,1E"'*DLL$# &grvv66&-llG" KK0 # D) # f%A4HII009	y>Q&#Iq1H\Q&$&d7mA6F H (BGG,,1G!(+8 y7 Hbgg..8;;&3H!.$,,N	(Y__-D8==)Q.$).$,,*2--*:%<	%1&y"'':: ) 7-i8" y h11'~~Hh,,
8T0J0J08dkkI D$<$<<00;BB5I y @Eg00; y $Z44)$t*5A$	4<<>ICy{,|(s   3x'!3x,c                    R P                  VP                  4      p \        W4      p\	        YaY#T4      #   \         d     R# i ; i)z_analyze_op_{}N)r   rn  getattrAttributeErrorr   )r   r  r   ru  ro  rv  rq  s   &&&&&  r>   r  ArrayAnalysis._analyze_expr  sJ     ''0	%B R	55  		s   5 AAc                   VP                   R 8X  dU   V P                  VP                  P                  4      '       d*   V P	                  WVP
                  VP                  ./ 4      # VP                   R8X  d2   VP                  VP                  4      p\        P                  VR7      # VP                   R9   dL   V P                  VP                  P                  4      '       d!   \        P                  VP                  R7      # V P                  VP                  4      '       d   \        VP                  P                  V P                  4      pWcP                   3V P                  9   d3   \        P                  V P                  WcP                   3,          R7      # V P                  VP                  ,          p. pV P                  W$VP                  RV4      pWPP                  WcP                   3&   \        P                  WXR7      # R# )Tr]   r]   N)r]   r  )realimag)attr_isarrayr   r    _analyze_op_call_numpy_transposer  r'  r  r  r   r  r  r   r  r   )	r   r  r   ru  ro  r]   canonical_valuer   r  s	   &&&&&    r>   _analyze_op_getattr!ArrayAnalysis._analyze_op_getattr  s   99djjoo > >88$((TZZL"  YY'!''

3E ..U.;;YY**t}}TZZ__/M/M !..TZZ.@@]]388$$1

O  +t/@/@@$22++_ii,HI 3   ll388,,,CHHdD CH!!?II">?$222JJrA   c                B    \         P                  VP                  R 7      # )r%  )r  r  r   r   r  r   ru  ro  s   &&&&&r>   _analyze_op_castArrayAnalysis._analyze_op_cast/  s    ***<<rA   c                :   VP                   pV P                  VP                  ,          p\        V\        P
                  4      '       dR   \        \        V4      VP                  8H  4       \        VP                  V4      4       \        P                  VR 7      # R# r%  N)r   r   r   rB   r   rQ   r   rc   countr)  r  r  )r   r  r   ru  ro  r!  r   s   &&&&&  r>   _analyze_op_exhaust_iter&ArrayAnalysis._analyze_op_exhaust_iter2  sm    jjll388$c5??++CH

*+I'',- ..S.99rA   c                   \         P                  ! V\        V4      V4      p\         P                  ! W4      p\        P
                  ! V4      p	VP                  \         P                  ! VVVR 7      4       V P                  VVV	V4       Wy3# )r   r  r  )	r   r   r   r   r   r   r   r  r  )
r   arg_valr  r  stmtsr   r   static_literal_slice_part_varstatic_literal_slice_part_valstatic_literal_slice_part_typs
   &&&&&&&   r>   gen_literal_slice_part$ArrayAnalysis.gen_literal_slice_part;  s     )+umD6I3(O%(*(>%(-(<(<W(E%II34	
 	)))		
 -KKrA   c           	     B    V P                  W!,
          VVVVR R7      vrxV# )static_slice_size)r   )r>  )	r   lhs_relrhs_relr  r  r:  r   the_var_s	   &&&&&&&  r>   gen_static_slice_size#ArrayAnalysis.gen_static_slice_sizeX  s7     11$ 2 
 rA   c
                   \        V\        4      '       d   Q h\        P                  ! V\	        R 4      V4      p
\        P
                  P                  \        P                  WqVR7      p\        P                  p\        WV4      V P                  V&   VP                  \        P                  ! WVR7      4       V P                  WW4       W3# )explicit_negr  r8  )rB   r   r   r   r   rm  rl  rr  r+   r   rE   r   r  r   r  r  )r   argarg_relarg_typsize_typr  r  dsizer:  r   explicit_neg_varexplicit_neg_valexplicit_neg_typs   &&&&&&&&&&   r>   gen_explicit_negArrayAnalysis.gen_explicit_nege  s     h,,,,66%~)FL77==us=K !::+4,
'( 	II,3O	
 	)9	
  11rA   c                P   R p\        V\        4      '       Ed   V^ 8X  d   RpEM{\        V\        4      '       d   Rp\        W44      pW8w  d   \        P                  ^8  d   \        R4       RpV P                  WWV4      w  ppV^ 8X  g
   V^8X  g   Q hV^ 8X  d   VVP                  ^,          3Vn        MVP                  ^ ,          V3Vn        VP                  V,          pTpVP                  V4      pMV^ 8  d   Rp\        P                  ^8  d   \        R4       V P                  VVVVVV	VV
V4	      w  ppV^ 8X  d   VVP                  ^,          3Vn        MVP                  ^ ,          V3Vn        VP                  V,          pTpVP                  V4      pVVVVVV3# )FTz.Replacing slice to hard-code known slice size.z,Replacing slice due to known negative index.)
rB   r   rL   r   r   r   r>  r/   rY  rS  )r   ro  r  rB  	dsize_relreplacement_sliceslice_indexneed_replacementr  r  r:  r   rN  rO  knownwilliteral_varliteral_typrP  rR  s   &&&&&&&&&&&&&&      r>   update_replacement_slice&ArrayAnalysis.update_replacement_slice  s   $ gs## !|Is++(< >--2NO'+$/3/J/J%	0,K '!+{a/???"a''-22152). .2215'2).
 ,00=C)G'//4G1#' ))Q.HI595J5J
62 "2 !#()..q1.%* *..q1(.%*
 (,,[9*#++C0
 	
rA   c                  a aaaa-a.a/ VP                   o-\        S P                  V4      p\        S P                  VS P                  R7      w  rx\        VR8H  ;'       d    VR9   4       \        \        VP                  4      ^8H  4       VP                  ^ ,          p	VP                  ^,          p
S P                  SP                  ,          pS P                  V	P                  ,          pS P                  V
P                  ,          p\        P                  ^8  d$   \        RV RS RV RV	 RV
 R	V R
V RV 24       \        P                  ! V4      pRp\        V\        P                   4      '       d   \"        P$                  ! S\'        R4      S-4      p\"        P(                  ! ^ S-4      pVP+                  \"        P,                  ! VVS-R7      4       S P/                  SV\        P0                  ! ^ 4      V4       Tp	\        P0                  ! ^ 4      pWP                  ^,          3Vn        Rp\        P                  ^8  d   \        R4       \        V\        P                   4      '       dA   Sp
TpVP                  ^ ,          V
3Vn        Rp\        P                  ^8  d   \        R4       SP3                  V	4      pSP3                  V
4      pSP3                  S4      p\        P                  ^8  d   \        RVRVRV4       S P5                  V	VVVV^ VS-SVSVS4      w  p	pppppS P5                  V
VVVV^VS-SVSVS4      w  p
ppppp\        P                  ^8  d   \        RV4       \        RV4       V'       g   RpM\"        P$                  ! S\'        R4      S-4      p\        P6                  \        P6                  3pS P                  VP8                  P                  ,          P;                  S P<                  V/ 4      pVS P>                  V&   VP+                  \"        P,                  ! VVS-R7      4       S P                  VP                  ,          S P                  VP                  &   \        P                  ^8  d   \        RRVRV4       V'       dA   V'       d9   \        P                  ^8  d   \        R4       S PA                  VVS-SVS4      V3# V^ 8X  dH   \        V\B        4      '       d2   SPE                  SV^ ,          4      '       d   V^,          ^ 8X  d   SR3# \        P6                  pTp\"        P$                  ! S\'        R4      S-4      p\"        PF                  PI                  \J        PL                  WS-R7      p\O        VW4      S P>                  V&   S P/                  SVVV4       SP3                  V4      p\        P                  ^8  d   \        RV\Q        V4      4       \"        P$                  ! S\'        R4      S-4      o/\"        PR                  ! R\T        S-R7      p\W        \T        4      p S P<                  PY                  V VV3/ 4      o.S P/                  SS/V V4       VVV-VV V.V/3R lp!V!! WV4      w  p"p#p$V!! WV4      w  p%p&p'VP+                  \"        P,                  ! VVS-R7      4       VP+                  \"        P,                  ! VS/S-R7      4       V$e)   VP+                  \"        P,                  ! V$V"S-R7      4       V'e)   VP+                  \"        P,                  ! V'V%S-R7      4       \"        P$                  ! S\'        R 4      S-4      p(\"        PF                  PI                  \J        PL                  V%V"S-R7      p)\O        VV&V#4      S P>                  V)&   S P/                  SV(VV)4       VP+                  \"        P,                  ! V)V(S-R7      4       \        V\B        4      '       d   \        P                  ^8  d   \        R!SPZ                  4       Rp*SPZ                  P]                  4        FG  w  p+p,V+^,          V^,          8X  g   K  SPE                  V+^ ,          V^ ,          4      '       g   KE  T,p* M	  V*eX   \        P                  ^8  d   \        R"V*4       SP_                  VV*^ ,          4       SP_                  V(V*^,          4       V(V3# VV(3SPZ                  V&   V(V3# )#a  Reason about the size of a slice represented by the "index"
variable, and return a variable that has this size data, or
raise GuardException if it cannot reason about it.

The computation takes care of negative values used in the slice
with respect to the given dimensional size ("dsize").

Extra statements required to produce the result are appended
to parent function's stmts list.
ri  slicebuiltinszslice_size index=z dsize=z index_def=z lhs=z rhs=z
 size_typ=z	 lhs_typ=z	 rhs_typ=Fr5   r8  Tz$Replacing slice because lhs is None.rB  rC  rV  z
lhs_known:z
rhs_known:NrW  zafter rewriting negativesz'lhs and rhs known so return static sizer  rJ  size_relwraprH   c                   < V'       g|   \         P                  ! S	\        R 4      S4      p\        P                  p\         P
                  P                  SV S./ S4      pS
P                  SW4V4       SS
P                  V&   W4V3# WR3# )r!  N)	r   r   r   r   rE   rm  rh  r  r  )r   val_typrZ  r!  var_typ	new_valuerO  r   r  r  r   r.   wrap_vars   &&&   r>   gen_wrap_if_not_known7ArrayAnalysis.slice_size.<locals>.gen_wrap_if_not_known  sx    ffUM%$8#>**GGLLC<SI	 Yi@,/y)i00d++rA   post_wrap_slice_sizezsize_rel is tuplezestablishing equivalence to)0r  r   rt  r   r   r   rc   r/   r   r   r   r   r   r   rB   r   ry   r   r   r   r   r   r  r  r   rY  r^  rE   r	  get_call_typer,   r  rF  r   r   rm  rl  rr  rs  r   r   r  rH   r   resolve_function_typerN  r6  r   )0r   r=  rO  r   r  r:  	index_defrv  rw  ro  rp  rN  r  r  rW  rY  zero_varr5   rB  rC  rV  	lhs_known	rhs_knownreplacement_slice_varnew_arg_typsrs_calltype	slice_typorig_slice_typsize_varsize_valrc  wrap_deffntyrj  var1var1_typvalue1var2var2_typvalue2post_wrap_size_varpost_wrap_size_valrel_map_entryrme	rme_tupler  r.   ri  s0   f&fff&                                       @@@r>   r  ArrayAnalysis.slice_size  s    ii"4<<7	'LL)T\\
 	 ==X*%=>INN#q()nnQnnQ<<

+,,sxx(,,sxx(!!Q&%eWGE7 ;(kse5 >&Zy	7)M N !MM)4  gu~~..vve]6%:C@H88As#DLLhCHILLHe.B.B1.EtLC**1-G&)+A+A!+D%E"#%%*<= gu~~..CG&7&<&<Q&?%E"#%%*<=##C(##C(%%e,	!!Q&7IwY ))
	
. ))
	
  !!Q&,	*,	*  $(! %'FF}%893%! "JJ

3L,,y~~':':;IIlBK 1<DNN,-LL		+0 8<||EJJ7ODLL.334!!Q&+ %%*?@**Wc5% &	  qL7E**""5'!*55
a$;JJ	"66%|!<cB77==sS=A#,Y#Ix Y)X>$$X.!!Q&*hX766%v!6<99\:3?":.ll00>8,b
 	Y$9	, 	, "7sY!Oh!6sY!OhRYYXhCHIRYYXhCHILL#FGLL#FGVV=!78#
  WW]]8<<+/+//2 + 4 .7x.
)* 	)96H	
 	II(1C	
 h&&%%*)9+<+<= M"+"3"3"9"9";Yq6Xa[(Y-?-?FHQK. . %.M #< ( ))Q.7G&&xq1AB&&'9=;KL "#888 089K.L	!!(+!#888rA   c                |  a aaa S P                   VP                  ,          p\        \        V\        P
                  4      4       S P                   VP                  ,          pSP                  V4      pSP                  V4      p\        V\        P                  4      '       d   V3p	V3p
M{\        \        V\        P                  4      4       \        S P                  V4      w  r\        VR8H  4       \        ;QJ d    . V 3R lV
 4       F  NK  	  5M! V 3R lV
 4       4      p	\        \        V4      \        V	4      u;8H  ;'       d    \        V4      8H  Mu 4       . oVVV V3R lp. p. pRp\        V	VVV
4       FP  w  ppppV! VVV4      w  ppVP                  V4       Ve   RpVP                  V4       K?  VP                  V4       KR  	  V'       d   \        V4      ^8  d   \        P                   ! S\#        R4      V^ ,          P$                  4      p\        P&                  P)                  W^ ,          P$                  4      pSP                  \        P*                  ! VVV^ ,          P$                  R7      4       VS P                   VP                  &   MV^ ,          pMRp\        V4      p\        \,        ;QJ d    R	 V 4       F  '       d   K   RM	  RM! R	 V 4       4      '       * 4       \        ;QJ d    . R
 V 4       F  NK  	  5M! R
 V 4       4      pV\.        P1                  VSR7      3# )aT  For indexing like var[index] (either write or read), see if
the index corresponds to a range/slice shape.
Returns a 2-tuple where the first item is either None or a ir.Var
to be used to replace the index variable in the outer getitem or
setitem instruction.  The second item is also a tuple returning
the shape and prepending instructions.
build_tuplec              3   ^   <"   T F"  pSP                   VP                  ,          x  K$  	  R # 5irO   )r   r   r   s   & r>   rU   0ArrayAnalysis._index_to_shape.<locals>.<genexpr>  s!     ?3aT\\!&&113s   *-c                    < \        V \        P                  4      '       d   SP                  WSSS4      # \        V \        P                  4      '       d   R# \        R4       R # )NFr  )rB   r   rR   r  rz  r   )r   r=  rO  r   r  r   r:  s   &&&r>   to_shape/ArrayAnalysis._index_to_shape.<locals>.to_shape  sI    #u//uYuMMC..!! rA   FNTreplacement_build_tupler8  c              3   (   "   T F  qR J x  K
  	  R # 5irO   rK   rS   r   s   & r>   rU   r  ?  s     15aT	5s   c              3   0   "   T F  qf   K  Vx  K  	  R # 5irO   rK   r  s   & r>   rU   r  @  s     8Aaas   
r]   r  )r   r   r   rB   r   rP   r,  rR   rQ   r   rt  r   rc   rd   r   r   r   r   r  rm  r  r  r   r  r  )r   r  r   r!  ind_varr   ind_typ	ind_shape	var_shapeseq_typsseqrn  r  
shape_listindex_var_listreplace_indexr3   rO  orig_ind
shape_partindex_var_partreplacement_build_tuple_varnew_build_tupler]   r:  s   fff&&                   @r>   r  ArrayAnalysis._index_to_shape  s    ll388$
3 5 567,,w||,((1	((-	gu//zH*CJw89)$,,@GCB-'(u?3?uu?3??HI#h-AA3y>AB	 	 
,/090903-5(S$x
 *2#tU)C&Jj)
 ) $%%n5%%h/!-5( >"Q&.0ff!";<aL$$/+ #%''"5"5"aL$4$4# II-:%aL,, BI8==>.<Q.?+*.'j!CC151CCC15111288888+++%U+CE 	ErA   c                    V P                  WVP                  VP                  4      pV^ ,          e   V^ ,          Vn        V^,          # rJ   )r  r   r=  )r   r  r   ru  ro  r  s   &&&&& r>   _analyze_op_getitem!ArrayAnalysis._analyze_op_getitemD  s=    %%e

DJJO!9 DJayrA   c                   VP                   pV P                  VP                  ,          p\        V\        P
                  4      '       gJ   V P                  WVP                   VP                  4      pV^ ,          e   V^ ,          Vn        V^,          # VP                  V4      p\        VP                  \        4      '       dH   \        VP                  \        V4      8  4       \        P                  WP                  ,          R7      # \        VP                  \        4      '       d'   \        P                  WP                  ,          R7      # \        R4       R# )r   Nr%  F)r   r   r   rB   r   rQ   r  r  r,  r=  r   r   rc   r  r  ra  )	r   r  r   ru  ro  r!  r   r  r]   s	   &&&&&    r>   _analyze_op_static_getitem(ArrayAnalysis._analyze_op_static_getitemJ  s    jjll388$#u//))$**dnnF ay$!'!9$$S)djj#&&DJJU+, ..U::5F.GG

E** ..U::5F.GGrA   c                   \        VP                  \        9   4       V P                  VP                  P
                  4      '       g    VP                  \        P                  8X  d!   \        P                  VP                  R 7      # R# r3  )
r   rq  UNARY_MAP_OPr)  r   r   rr  r+   r  r  r/  s   &&&&&r>   _analyze_op_unaryArrayAnalysis._analyze_op_unary\  sV    <'( ==))TWW-D ..TZZ.@@rA   c                    \        VP                  \        9   4       V P                  WVP                  VP
                  VP                  .VP                  4      # rO   )r   rq  BINARY_MAP_OP_analyze_broadcastr  ro  rp  r/  s   &&&&&r>   _analyze_op_binopArrayAnalysis._analyze_op_binopd  sD    =()&&dhh488(<dgg
 	
rA   c                    \        VP                  \        9   4       V P                  WVP                  VP
                  VP                  .VP                  4      # rO   )r   rq  INPLACE_BINARY_MAP_OPr  r  ro  rp  r/  s   &&&&&r>   _analyze_op_inplace_binop'ArrayAnalysis._analyze_op_inplace_binopj  sE    001&&dhh488(<dgg
 	
rA   c                Z    V P                  WVP                  VP                  4       R 4      # rO   )r  r  	list_varsr/  s   &&&&&r>   _analyze_op_arrayexpr#ArrayAnalysis._analyze_op_arrayexprp  s)    &&dhh(8$
 	
rA   c           	        VP                    F  p\        V\        P                  4      '       g   K%  \        V P                  VP
                  ,          \        P                  4      '       g   Kb  V P                  VP
                  ,          P                  ^8  g   K   R# 	  . pVP                    F5  p\        \        V P                  V4      pVe   VP                  V4       K5   Mz	  \        V Uu. uF#  p\        P                  ! WSP                  4      NK%  	  up4      p\         P#                  V\        P                  ! \        V4      VP                  4      R7      # \         P#                  \        VP                   4      R7      # u upi )rX   Nr]   rp  r%  )r6  rB   r   r   r   r   r   rP   r   r   r   rt  r   r   r   r  r  r  )	r   r  r   ru  ro  r   constsr!  outs	   &&&&&    r>   _analyze_op_build_tuple%ArrayAnalysis._analyze_op_build_tupleu  s   
 A1bff%%t||AFF3U5J5JKKLL(--1  ::Cj$,,4A}a   ?1!XX.?@C ..HHU6]DHH5 /  
 **tzz1B*CC @s   2)F
c           
     
   ^ RI Hp VP                  p\        V P                  V4      p\        V\        P                  \        P                  34      '       dE   \        VP                  4      '       d*   \        P                  \        VP                  4      R7      # \        V\        P                  \        P                  34      '       df   \        VP                  V4      '       dJ   VP                  pV P                  VVVP                  VP                   V\#        VP$                  4      4      # \'        V P                  W0P(                  R7      w  rRp\        V
\        P*                  4      '       dU   \        V P(                  V
P,                  ,          \.        P0                  4      '       d   V
.VP                  ,           pRp
RpMVP                  pRP3                  W4      P5                  RR	4      p	V	\6        9   d   V P9                  WVP                   VR
4      #  \;        W	4      p\?        TTTTP                   T\#        TP$                  4      R7      pT'       d   TR,          Tn        T#   \<         d     R
# i ; i)r   )StencilFuncr%  ri  FnumpyTz_analyze_op_call_{}_{}.rE  N)r  r   r  r/   kwsrW   ) numba.stencils.stencilr  r	  r   rt  rB   r   r  FreeVarr   r   r  r  r   r/   _analyze_stencilr  dictr  r   r   r   r   r   rP   r   replaceUFUNC_MAP_OPr  r   r!  r   )r   r  r   ru  ro  r  callee
callee_defr/   rv  rw  added_mod_namerq  r  s   &&&&&         r>   _analyze_op_callArrayAnalysis._analyze_op_call  s
   6#DLL&9
BJJ/
 
!*"2"233 ..U4995E.FFj299bjj"9::zk@
 @
 99D((  TXX  (LL$
 h''JLL')>)>-
 -
 :		)DH!N99D(//@HH
 L **5+/88T4A AT) #HHNF  H	M! " s   "I3 3JJc                .   \        \        V4      ^8H  4       V^ ,          pV P                  VP                  ,          p\        \	        V\
        P                  4      4       VP                  V4      p\        P                  V^ ,          V^ ,          R7      # )rX   r  )
r   rc   r   r   rB   r   rP   r,  r  r  )	r   r  r   r  r/   r  r!  r   r]   s	   &&&&&&   r>   _analyze_op_call_builtins_len+ArrayAnalysis._analyze_op_call_builtins_len  sp    D	Q1gll388$
3 5 567$$S)**quQx*HHrA   c                4    VP                   ! VR ,          !   R# )rW   N)r   r   r  r   r  r/   r  s   &&&&&&r>   :_analyze_op_call_numba_parfors_array_analysis_assert_equivHArrayAnalysis._analyze_op_call_numba_parfors_array_analysis_assert_equiv  s     	R)rA   c                   \        \        V4      ^8H  4       V^ ,          P                  pV^,          P                  pVP                  V4      pVP                  V4      p	W3VP                  9   dk   VP                  W3,          p
\        WP
                  9   4       VP
                  V
,          p\        V. 8g  4       \        P                  V^ ,          3R7      # \        P                  \        W4      R7      # )zCAnalyze wrap_index calls added by a previous run of
Array Analysis
r%  )	r   rc   r   r   rO  r   r  r  r  )r   r  r   r  r/   r  r  r  slice_eqdim_eqwrap_indr  s   &&&&&&      r>   8_analyze_op_call_numba_parfors_array_analysis_wrap_indexFArrayAnalysis._analyze_op_call_numba_parfors_array_analysis_wrap_index  s     	D	Q!W\\
7<<,,Z8**84 !3!33 ))8*<=HH 4 445%%h/BB"H ..beX.>>
 !..#H5 /  rA   c                    R p\        V4      ^ 8  d   V^ ,          pMRV9   d
   VR,          pV'       d   \        P                  VR7      # \        P                  ! RVR7      h)Nr]   r%  z'Must specify a shape for array creationrJ  )rc   r  r  r   UnsupportedRewriteError)r   r  r   r  r/   r  	shape_vars   &&&&&& r>   _analyze_numpy_create_array)ArrayAnalysis._analyze_numpy_create_array  s[    	t9q=QI^GI ..Y.??,,5
 	
rA   c                (    V P                  WW4V4      # rO   r  r  s   &&&&&&r>   _analyze_op_call_numpy_empty*ArrayAnalysis._analyze_op_call_numpy_empty	      //c
 	
rA   c                (    V P                  WW4V4      # rO   r  r  s   &&&&&&r>   7_analyze_op_call_numba_np_unsafe_ndarray_empty_inferredEArrayAnalysis._analyze_op_call_numba_np_unsafe_ndarray_empty_inferred	  s     //c
 	
rA   c                (    V P                  WW4V4      # rO   r  r  s   &&&&&&r>   _analyze_op_call_numpy_zeros*ArrayAnalysis._analyze_op_call_numpy_zeros	  r  rA   c                (    V P                  WW4V4      # rO   r  r  s   &&&&&&r>   _analyze_op_call_numpy_ones)ArrayAnalysis._analyze_op_call_numpy_ones	  r  rA   c                    \        V4      ^ 8  d   V^ ,          pM)RV9   d   VR,          pM\        P                  ! RVR7      hRV9   d   VR,          pMTp\        P	                  Wg3R7      # )r   Nz,Expect one argument (or 'N') to eye functionrJ  Mr%  )rc   r   r  r  r  )r   r  r   r  r/   r  r  r  s   &&&&&&  r>   _analyze_op_call_numpy_eye(ArrayAnalysis._analyze_op_call_numpy_eye"	  sl    t9q=QACZCA00>  #:CAA**!*88rA   c                f    \        V4      ^ 8  g   Q hV^ ,          p\        P                  Wf3R7      # )r   r%  rc   r  r  )r   r  r   r  r/   r  r  s   &&&&&& r>   _analyze_op_call_numpy_identity-ArrayAnalysis._analyze_op_call_numpy_identity2	  s3     4y1}}G**!*88rA   c                n   \        V4      ^ 8  g   Q hV^ ,          p\        V\        P                  4      '       g   Q hV P                  VP
                  ,          p\        V\        P                  4      '       d   VP                  ^8X  do   RV9   d$   VR,          pVP                  V^ 4      '       g   R# VP                  V4      w  rVP                  W4      '       d   \        P                  V	3R7      #  R# VP                  ^8X  d+   VP                  V4      w  p	\        P                  W3R7      # R# )r   r9  Nr%  )rc   rB   r   r   r   r   r   rP   r   r   r,  r  r  )r   r  r   r  r/   r  rT   atypr9  rn   ro   s   &&&&&&     r>   _analyze_op_call_numpy_diag)ArrayAnalysis._analyze_op_call_numpy_diag9	  s    4y1}}G!RVV$$$$||AFF#dE1122yyA~#:CA$--a33#"--a0%%a++(66aT6BB ,
  a ++A.$22!2@@rA   c                |   \        V4      ^ 8  g   Q hV^ ,          pV P                  VP                  ,          p\        V\        P
                  4      '       d   \        P                  RR7      # \        V\        P                  4      '       d.   VP                  V4      '       d   \        P                  VR7      # R# )r   r%  NrX   )
rc   r   r   rB   r   rD   r  r  rP   r)  )r   r  r   r/   r  r!  r   s   &&&&&  r>   _analyze_numpy_array_like'ArrayAnalysis._analyze_numpy_array_likeN	  s    4y1}}1gll388$c5==)) ..T.::U2233	8K8K9
 9
 !..S.99rA   c                   \        V4      ^8X  g   Q hV^ ,          pV P                  VP                  ,          p\        V\        P
                  4      '       g   Q hVP                  ^8X  dU   VP                  V4      '       d>   VP                  R8X  d   \        P                  WfR7      # \        P                  VR7      # R# )rX   Cr  r%  N)rc   r   r   rB   r   rP   r   r)  layoutr  r  )r   r  r   r  r/   r  r!  r   s   &&&&&&  r>   _analyze_op_call_numpy_ravel*ArrayAnalysis._analyze_op_call_numpy_ravelZ	  s    4yA~~1gll388$#u44555588q=Y0055zzS  %222FF$222==rA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>   _analyze_op_call_numpy_copy)ArrayAnalysis._analyze_op_call_numpy_copyj	  s    --eJJrA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>   !_analyze_op_call_numpy_empty_like/ArrayAnalysis._analyze_op_call_numpy_empty_likem	       --eJJrA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>   !_analyze_op_call_numpy_zeros_like/ArrayAnalysis._analyze_op_call_numpy_zeros_liker	  r  rA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>    _analyze_op_call_numpy_ones_like.ArrayAnalysis._analyze_op_call_numpy_ones_likew	  r  rA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>    _analyze_op_call_numpy_full_like.ArrayAnalysis._analyze_op_call_numpy_full_like|	  r  rA   c                &    V P                  WWE4      # rO   r  r  s   &&&&&&r>   %_analyze_op_call_numpy_asfortranarray3ArrayAnalysis._analyze_op_call_numpy_asfortranarray	  r  rA   c                   \        V4      pV^8  g   Q hV^8X  db   V P                  V^,          P                  ,          p\        V\        P
                  4      '       d   \        P                  V^,          R7      # . pRp	\        ^\        V4      4       F  p
WJ,          p\        \        V P                  V4      p\        V\        P                  4      '       g   KH  VP                  ^ 8  g   K[  V	R8X  d   T
p	Kf  Rp\        P                   ! WP"                  R7      h	  V	^ 8  Ed   V^ ,          P"                  p\        P$                  ! V\'        R4      V4      p\        P(                  V P                  VP                  &   \        P*                  ! \        P,                  P/                  V^ ,          RV4      W4      pVP1                  V4       \        ^\        V4      4       F  p
W8X  d   K  \        P$                  ! V\'        R4      V4      p\        P(                  V P                  VP                  &   \        P,                  P3                  \4        P6                  WV
,          V4      p\        P*                  ! VVV4      p\9        \        P(                  \        P(                  \        P(                  4      V P:                  V&   VP1                  V4       TpK  	  WV	&   \        P                  \=        VR,          4      VR7      # )	rX   r%  z7The reshape API may only include one negative argument.rJ  calc_size_varr3   rW   r  r   )rc   r   r   rB   r   rQ   r  r  rw   r   r   rt  r   r   r   r   r  r  r   r   rE   r  rm  r   r   rl  rr  floordivr   r  r   )r   r  r   r  r/   r  ro   r   r:  neg_one_index	arg_indexreshape_argreshape_arg_defrs   r  init_calc_vardiv_calc_size_var	new_binopdiv_calcs   &&&&&&             r>   _analyze_op_call_numpy_reshape,ArrayAnalysis._analyze_op_call_numpy_reshape	  sR   I1uu6,,tAw||,C#u//$22a2AA q#d),I/K#NDLL+NO/28844"((1,$*(1 ,$<<__  - A q'++CFF5-*H#NM/4zzDLL++,IIQ5}M LL' #1c$i0	-$&FF=93%! 8=zz.334 GGMM%%}9os	 99Y0A3G,5JJ

EJJ-y) X& 1% 1* #0**tBxe*LLrA   c                   V^ ,          pV P                   VP                  ,          p\        V\        P                  4      '       g   Q R4       hVP                  V4      p\        V4      ^8X  d)   \        P                  \        \        V4      4      R7      # VR,           U	u. uF  p	\        \        V P                  V	4      NK   	  p
p	\        V
^ ,          \        4      '       d   \        V
^ ,          4      p
RV
9   d   R# V
 Uu. uF  qV,          NK  	  pp\        P                  \        V4      R7      # u up	i u upi )r   zInvalid np.transpose argumentr%  rW   N)r   r   rB   r   rP   r,  rc   r  r  r   reversedr   r   rt  r  )r   r  r   r  r/   r  in_arrr   r]   rT   axesr|   rets   &&&&&&       r>   r*  .ArrayAnalysis._analyze_op_call_numpy_transpose	  s    all6;;'&&
 
 	+*	+ 
 $$V,t9> ..U8E?5K.LL<@HEHqj$,,2HEd1gu%%Q=D4<!%&AQxx&**s*<< F
 's   "$D6D;c                d    \        V4      ^ 8  d    \        P                  \        V4      R7      # R# )r   r%  N)rc   r  r  r   r  s   &&&&&&r>   "_analyze_op_call_numpy_random_rand0ArrayAnalysis._analyze_op_call_numpy_random_rand	  s*     t9q= ..U4[.AArA   c                (    V P                  WW4V4      # rO   )r.  r  s   &&&&&&r>   #_analyze_op_call_numpy_random_randn1ArrayAnalysis._analyze_op_call_numpy_random_randn	  s     66c
 	
rA   c                    R V9   d   \         P                  VR ,          R7      # \        V4      V8  d   \         P                  WA,          R7      # R# )r3   r%  N)r  r  rc   )r   posr  r   r/   r  s   &&&&&&r>   "_analyze_op_numpy_random_with_size0ArrayAnalysis._analyze_op_numpy_random_with_size	  sG     S= ..S[.AAt9s? ..TY.??rA   c                (    V P                  ^ WWE4      # rJ   r5  r  s   &&&&&&r>   "_analyze_op_call_numpy_random_ranf0ArrayAnalysis._analyze_op_call_numpy_random_ranf	       66u
 	
rA   c                (    V P                  ^ WWE4      # rJ   r8  r  s   &&&&&&r>   +_analyze_op_call_numpy_random_random_sample9ArrayAnalysis._analyze_op_call_numpy_random_random_sample
  r;  rA   c                (    V P                  ^ WWE4      # rJ   r8  r  s   &&&&&&r>   $_analyze_op_call_numpy_random_sample2ArrayAnalysis._analyze_op_call_numpy_random_sample
  r;  rA   c                (    V P                  ^ WWE4      # rJ   r8  r  s   &&&&&&r>   $_analyze_op_call_numpy_random_random2ArrayAnalysis._analyze_op_call_numpy_random_random
  r;  rA   c                (    V P                  ^ WWE4      # rJ   r8  r  s   &&&&&&r>   -_analyze_op_call_numpy_random_standard_normal;ArrayAnalysis._analyze_op_call_numpy_random_standard_normal
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   '_analyze_op_call_numpy_random_chisquare5ArrayAnalysis._analyze_op_call_numpy_random_chisquare
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   %_analyze_op_call_numpy_random_weibull3ArrayAnalysis._analyze_op_call_numpy_random_weibull$
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   #_analyze_op_call_numpy_random_power1ArrayAnalysis._analyze_op_call_numpy_random_power+
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   '_analyze_op_call_numpy_random_geometric5ArrayAnalysis._analyze_op_call_numpy_random_geometric2
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   )_analyze_op_call_numpy_random_exponential7ArrayAnalysis._analyze_op_call_numpy_random_exponential9
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   %_analyze_op_call_numpy_random_poisson3ArrayAnalysis._analyze_op_call_numpy_random_poisson@
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   &_analyze_op_call_numpy_random_rayleigh4ArrayAnalysis._analyze_op_call_numpy_random_rayleighG
  r;  rA   c                (    V P                  ^WWE4      # r  r8  r  s   &&&&&&r>   $_analyze_op_call_numpy_random_normal2ArrayAnalysis._analyze_op_call_numpy_random_normalN
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   %_analyze_op_call_numpy_random_uniform3ArrayAnalysis._analyze_op_call_numpy_random_uniformU
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   "_analyze_op_call_numpy_random_beta0ArrayAnalysis._analyze_op_call_numpy_random_beta\
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   &_analyze_op_call_numpy_random_binomial4ArrayAnalysis._analyze_op_call_numpy_random_binomialc
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   _analyze_op_call_numpy_random_f-ArrayAnalysis._analyze_op_call_numpy_random_fj
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   #_analyze_op_call_numpy_random_gamma1ArrayAnalysis._analyze_op_call_numpy_random_gammaq
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   '_analyze_op_call_numpy_random_lognormal5ArrayAnalysis._analyze_op_call_numpy_random_lognormalx
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   %_analyze_op_call_numpy_random_laplace3ArrayAnalysis._analyze_op_call_numpy_random_laplace
  r;  rA   c                (    V P                  ^WWE4      # r^  r8  r  s   &&&&&&r>   %_analyze_op_call_numpy_random_randint3ArrayAnalysis._analyze_op_call_numpy_random_randint
  r;  rA   c                (    V P                  ^WWE4      # )   r8  r  s   &&&&&&r>   (_analyze_op_call_numpy_random_triangular6ArrayAnalysis._analyze_op_call_numpy_random_triangular
  r;  rA   c           	        \        V4      ^ 8  g   Q hV^ ,          P                  p\        V P                  V^ ,          4      w  rg\        V4      p\	        V^ 8  4       ^ p	RV9   dF   \        VR,          \        4      '       d   VR,          p	MK\        V P                  VR,          4      p	M-\        V4      ^8  d   \        V P                  V^,          4      p	\	        \        V	\        4      4       \	        VR8H  4       V U
u. uF  qP                  V
4      NK  	  pp
V	^ 8  d   \        V^ ,          4      V	,           p	\	        ^ T	u;8*  ;'       d    \        V^ ,          4      8  Mu 4       . p. pV^8X  d   V^ ,          pVP                  V^ ,          4      pVP                  ^ 4       \        \        V4      4       FU  pW8X  d5   VP                  W,          4      pV'       d   V'       d
   VV,          MRpK=  V P                  W+^ ,          4      pKW  	  VP                  X4       M\        \        V^ ,          4      4       F  pW8X  d)   T P                  Y+ Uu. uF  qV,          NK  	  up4      pMBV Uu. uF  qV,          NK  	  ppVP                  V P                  WVV4      4       V^ ,          pVP                  V4       K  	  \        P!                  \#        V4      \%        V. 4      R7      # u up
i u upi u upi r   axisr  Nr  )rc   r  r   rt  r   rB   r   r   r,  r   poprw   	_sum_sizer   _call_assert_equivr  r  r   r  )r   r  r   r  r/   r  r  rn  ro   r  r   r  r  	new_shaper]   r|   rn   r3   sizess   &&&&&&             r>   "_analyze_op_call_numpy_concatenate0ArrayAnalysis._analyze_op_call_numpy_concatenate
  sv    4y1}}1gkk%dllDG<HAS=#f+s++6{!$,,F<Y]dllDG4D
4%&m#$3673a&&q)37!8vay>D(DT**Cq	N*+	61IE))&)4AIIaL3u:&9!11%(;A%&11q54D>>)AY?D ' T"3vay>*9>>!&#A&!HH&#AD 4::6%1XX6E:NN//IuM !8D  & + **	"GR  + 
 	
? 8, $B ;s   K7K<:Lc                   \        V4      ^ 8  g   Q hV^ ,          P                  p\        V P                  V^ ,          4      w  rg\        V4      p\	        V^ 8  4       ^ p	RV9   dF   \        VR,          \        4      '       d   VR,          p	MK\        V P                  VR,          4      p	M-\        V4      ^8  d   \        V P                  V^,          4      p	\	        \        V	\        4      4       \	        VR8H  4       V U
u. uF  qP                  V
4      NK  	  pp
V P                  WW&4      pV^ ,          pV	^ 8  d   \        V4      V	,           ^,           p	\	        ^ T	u;8*  ;'       d    \        V4      8*  Mu 4       \        V^ V	 4      V.,           \        WR 4      ,           p\        P                  \        V4      VR7      # u up
i r~  )rc   r  r   rt  r   rB   r   r   r,  r  r  r  r  r   )r   r  r   r  r/   r  r  rn  ro   r  r   r  r  r]   r  s   &&&&&&         r>   _analyze_op_call_numpy_stack*ArrayAnalysis._analyze_op_call_numpy_stack
  sn   4y1}}1gkk%dllDG<HAS=#f+s++6{!$,,F<Y]dllDG4D
4%&m#$3673a&&q)37))%iEq	!8u:$q(DT''SZ'(q'1#-U5\0BB	**y1Aw*OO 8s   G
c                   \        V4      ^8X  g   Q h\        V P                  V^ ,          4      w  rg\        V4      p\        V^ 8  4       V P                  V^ ,          P
                  ,          p	\        \        V	\        P                  4      4       V	P                  ^8  d   V P                  WW4V4      # ^ VR&   V P                  WW4V4      # rX   r  )rc   r   rt  r   r   r   rB   r   rP   r   r  r  
r   r  r   r  r/   r  r  rn  ro   r   s
   &&&&&&    r>   _analyze_op_call_numpy_vstack+ArrayAnalysis._analyze_op_call_numpy_vstack
  s    4yA~~%dllDG<HAll3q6;;'
3 5 56788a<44#S  CK::#S rA   c                   \        V4      ^8X  g   Q h\        V P                  V^ ,          4      w  rg\        V4      p\        V^ 8  4       V P                  V^ ,          P
                  ,          p	\        \        V	\        P                  4      4       V	P                  ^8  d   ^ VR&   M^VR&   V P                  WW4V4      # r  )rc   r   rt  r   r   r   rB   r   rP   r   r  r  s
   &&&&&&    r>   _analyze_op_call_numpy_hstack+ArrayAnalysis._analyze_op_call_numpy_hstack
  s    4yA~~%dllDG<HAll3q6;;'
3 5 56788a<CKCK66c
 	
rA   c                   \        V4      ^8X  g   Q h\        V P                  V^ ,          4      w  rg\        V4      p\        V^ 8  4       V P                  V^ ,          P
                  ,          p	\        \        V	\        P                  4      4       V	P                  ^8X  d`   ^VR&   V P                  WW4V4      p
\        V
4       \        ^.\        V
P                  R,          4      ,           4      V
P                  R&   V
# V	P                  ^8X  d   ^VR&   V P                  WW4V4      # ^VR&   V P                  WW4V4      # )rX   r  r]   )rc   r   rt  r   r   r   rB   r   rP   r   r  r   r  r  r  )r   r  r   r  r/   r  r  rn  ro   r   r  s   &&&&&&     r>   _analyze_op_call_numpy_dstack+ArrayAnalysis._analyze_op_call_numpy_dstack  s   4yA~~%dllDG<HAll3q6;;'
3 5 56788q=CK66#SF FO%*A3fmmG6L1M+M%NFMM'"MXX]CK44#S  CK::#S rA   c                    R # rO   rK   r  s   &&&&&&r>   _analyze_op_call_numpy_cumsum+ArrayAnalysis._analyze_op_call_numpy_cumsum      rA   c                    R # rO   rK   r  s   &&&&&&r>   _analyze_op_call_numpy_cumprod,ArrayAnalysis._analyze_op_call_numpy_cumprod"  r  rA   c                    \        V4      p^2pV^8  d   V^,          pMRV9   d
   VR,          p\        P                  V3R7      # )2   numr%  r  )r   r  r   r  r/   r  ro   r  s   &&&&&&  r>   _analyze_op_call_numpy_linspace-ArrayAnalysis._analyze_op_call_numpy_linspace&  sH     Iq5q'Cc\e*C**#*88rA   c           
     T   \        V4      pV^8  g   Q hV^ ,          P                  p\        \        V Uu. uF  qpP	                  VP
                  4      NK  	  up4      4       V Uu. uF  qpP                  VP
                  ,          NK!  	  ppV U	u. uF  qP                  NK  	  p
p	\        \        ;QJ d    R V
 4       F  '       d   K   RM	  RM! R V
 4       4      4       V
^ ,          ^8X  d   V
^,          ^8X  d   R# V Uu. uF  qrP                  V4      NK  	  ppV
^ ,          ^8X  dl   V P                  WW+^ ,          ^ ,          V^,          R,          .4      p\        P                  \        V^,          ^ R V^,          RR ,           4      VR7      # V
^,          ^8X  d[   V P                  WW+^ ,          R,          V^,          ^ ,          .4      p\        P                  \        V^ ,          ^ R 4      VR7      # V
^ ,          ^8X  dt   V
^,          ^8X  df   V P                  WW+^ ,          ^,          V^,          ^ ,          .4      p\        P                  V^ ,          ^ ,          V^,          ^,          3VR7      # V
^ ,          ^8  d    R# u upi u upi u up	i u upi )r  c              3   *   "   T F	  q^ 8  x  K  	  R# 5ire  rK   r  s   & r>   rU   ;ArrayAnalysis._analyze_op_call_numpy_dot.<locals>.<genexpr>8  s     (4aE4s   FTNr  r   )rc   r  r   r   r)  r   r   r   r,  r  r  r  r   )r   r  r   r  r/   r  ro   r   typstydimsr  r  s   &&&&&&       r>   _analyze_op_call_numpy_dot(ArrayAnalysis._analyze_op_call_numpy_dot1  sM   IAvv1gkkD9Dq]]166*D9:;.23dQVV$$d3"&'$B$'(4((4(()7a<DGqL3784a&&q)487a<--Iq	!fQim'DG !..F1IaOfQin<= /   7a<--Iq	"vay|'DG !..F1IaO, /   7a<DGqL--Iq	!fQil'CG !..ay|VAYq\2 /   7Q;C :3' 9s   #J(%JJ J%c                |   VP                   P                  R R4      pVP                  P                  p\	        V\
        4      '       d   V3p. p	\        V4      ^ 8  d   \        V4      \        V4      8X  g   Q h\        W4       F]  w  rV P                  VP                  ,          p\	        V\        P                  4      '       g   KD  W9   d   KL  V	P                  V4       K_  	  \        V	4      p\        V^ 8  4       V P                  WW)4      pVP                  V	^ ,          4      p\         P#                  WR7      # )standard_indexingr  rK   )optionsr   	kernel_irr  rB   r   rc   rd   r   r   r   rP   r   r   r  r'  r  r  )r   r  r   stencil_funcr  r/   r  std_idx_arrskernel_arg_namesrel_idx_arrsrK  r!  r   ro   r  r]   s   &&&&&&&         r>   r  ArrayAnalysis._analyze_stencilX  s    $++//0CRH'11;;lC(((?L4y1}Tc2B.C!CCC,3HC,,sxx(C#u4455###C( 4 A))%iN##LO4***DDrA   c                    \        \        V4      ^8  4       \        P                  VP	                  V^ ,          4      R7      # )rX   r%  )r   rc   r  r  r,  r  s   &&&&&&r>   !_analyze_op_call_numpy_linalg_inv/ArrayAnalysis._analyze_op_call_numpy_linalg_invm  s7     	D	Q**1E1Ed1g1N*OOrA   c           
       a  \        \        V 3R lV4      4      p\        V4      ^8X  Ed    VP                  R8X  Ed   S P                  V^ ,          P
                  ,          pS P                  V^,          P
                  ,          pVP                  ^ 8X  d-   \        P                  VP                  V^,          4      R7      # VP                  ^ 8X  d-   \        P                  VP                  V^ ,          4      R7      #  V U	u. uF  qP                  V	4      NK  	  p
p	RV
9   d   R# \        V
R4      p\        P                  VR7      # \        \        V 3R lV4      4      p\        \        V4      ^ 8  4       V U	u. uF  qP
                  NK  	  pp	V U	u. uF*  p	S P                  V	P
                  ,          P                  NK,  	  pp	\        V4      p\        V^ 8  4        V U	u. uF  qP                  V	4      NK  	  p
p	. pRT
9   d   . p\!        T
4       Fs  w  ppTfY   TT,          pS P                  TP
                  ,          pS P#                  TTTP                  RT4      pTP%                  T4       Kb  TP%                  T4       Ku  	  Tp
S P'                  YY:T4      pT'       d>   RTP(                  9   d   TP(                  R,          pM. pTT,           TP(                  R&   T# u up	i   \         d     R# i ; iu up	i u up	i u up	i   \         d2    \        P                  T^ ,          S P                  YY,4      R7      u # i ; i)	zInfer shape equivalence of arguments based on Numpy broadcast rules
and return shape of output
https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
c                 :   < SP                  V P                  4      # rO   )_istupler   rT   r   s   &r>   r  2ArrayAnalysis._analyze_broadcast.<locals>.<lambda>x      T]]166%:rA   r+   r%  Nc                 :   < SP                  V P                  4      # rO   )r)  r   r  s   &r>   r  r    r  rA   r  r  rK   )r  r  rc   r   r   r   r4  r  r  r'  r  r   r   r   r   r  	enumerater  r   r  r  )r   r  r   r  r/   rq  tupstup0typtup1typr   r  concat_shapesarrsr   r  max_dimr  
new_shapesr|   sr!  r   r]   r  prev_pres   f&&&&&                   r>   r   ArrayAnalysis._analyze_broadcasts  s   
 F:DABt9>bkkU2 ll47<<0Gll47<<0G}}!$22#--d1g6 3   }}!$22#--d1g6 3  	:>?$Q--a0$?6> #FB$22' 3   F:DABD	A!%&A&3784aQVV$))48d)!	6:;d))!,dF; 6> J!&)19q'C,,sxx0C 00!3$E %%e,%%a( *  F..c5
  %!==/#&>FMM% i @ "  '8 < 	 ..1g++E	H /  	sZ   K2 K-	K2 )!K2 ?L0L	%L )LL -K2 2L LL 9MMc                   . p. p\        V Uu. uF  p\        V4      NK  	  up4      p	Rp
\        V	4       F  p. p. p\        WT4       Fu  w  rV\        V4      8  g   K  V\        V4      ^,
          V,
          ,          pVP	                  V4      pV^8X  d   Tp
KS  VP                  V4       VP                  V4       Kw  	  V. 8X  d)   V
f   Q hVP                  V
4       VP                  R4       VP                  V P                  WW,VR7      4       VP                  V^ ,          4       K  	  \        P                  \        \        V4      4      \        V. 4      R7      # u upi )ztProduce assert_equiv for sizes in each dimension, taking into
account of dimension coercion and constant size of 1.
N1r   r  )r   rc   rw   rd   r   r   r  r  r  r   r(  r  )r   r  r   r  r  r   r  r  r]   r  const_size_oner|   r  
size_namesr   r3   
const_sizes   &&&&&&           r>   r  &ArrayAnalysis._broadcast_assert_shapes  sP    	v6ves5zv67wAEJ"51s5z> Ua!!34D!*!:!:4!@J!Q)-T*"))$/  2 {%111^,!!#&NN''	
 ( 
 U1X&+  , **+,GR  + 
 	
1 7s   E"c                n    V P                  WW4VR 7      p\        V4      ^8  d   VP                  ! V!   V# )r  )r  rc   r   )r   r  r  r   r/   r   instss   &&&&&& r>   r   ArrayAnalysis._call_assert_equiv  s>    ''	u ( 
 t9q=""D)rA   c           
        \         P                  ^8  d   \        RWE4       Vf   V Uu. uF  qfP                  NK  	  pp. p. p\	        WT4       F  w  r\         P                  ^8  d   \        RW4       Rp
V FN  p\         P                  ^8  d   \        RWP                  Wk4      4       VP                  Wk4      '       g   KL  Rp
 M	  V
'       d   K  VP                  V4       VP                  V	4       K  	  \        V4      ^8  d#   \         P                  ^8  d   \        R4       . # RP                  RP                  V4      V4      p\        P                  ! W4      p\        P                  ! V4      p\        P                  ! V\        R	4      V4      pWP                   VP                  &   \#        V.V Uu. uF  q`P                   VP                  ,          NK!  	  up,           4      p\        P$                  P'                  V4      p\        P                  ! V\        R
4      V4      p\        P(                  ! R\*        VR7      p\-        \*        4      pV P.                  P1                  VV3/ 4      pV P3                  VVVV4       \        P                  ! V\        R4      V4      p\        P4                  P7                  VV.V,           / VR7      pV P3                  VV\        P8                  V4       VV P:                  V&   \        P<                  ! WVR7      \        P<                  ! VVVR7      \        P<                  ! VVVR7      .# u upi u upi )r  zmake_assert_equiv:zname, x:Fzis equiv to?Tz@Will not insert assert_equiv as args are known to be equivalent.zSizes of {} do not match on {}z, rs   assertr   rJ  r+  r8  )r   r   r   r   rd   r   r   rc   r   joinr   r   r   r   r   r   r   r   r   
from_typesr  r   r   r,   rn  r  rm  rh  r   r  r  )r   r  r  r   _argsr   r   r/   r  r   seenr^  rs   msg_valmsg_typmsg_varargtypstup_typ
assert_var
assert_defr{  r.   r!  r   s   &&&&&&                  r>   r   ArrayAnalysis._make_assert_equiv  s   !!Q&&5=%*+UVVUE+	5(GD%%*j$*D))Q..!-?-?-EF%%a++D  4A  & ) t9q=%%*" I.55IIi #
 ((3$%%c*&&e 4c:%,W\\"	4$H4a\\!&&%9%94$HHI $$//8 VVE=#:C@
YY~|E
"<0ll00z2FY
D*= ffUM%0#6Z'T)923GYUZZ7 #u IIG=IIJzsCIIE#37
 	
g ,B %Is   M>%M
c           
        \        V\        P                  4      '       d   VP                  V4      p\        V\        P                  4      '       d   TpR pR pM\        V\        P                  4      '       d   TpR pR pM\        P
                  P                  VRVP                  4      p\        P                  ! VP                  \        RP                  VP                  4      4      VP                  4      p\        P                  P                  \        P                  V4      p. p	Rp
V'       d   \!        V4      pW;8  d   WKV,
          R  p\#        V4       EF  pRpV'       Ed   WL,          '       Ed   \        WL,          \        P                  4      '       d`   V P$                  WL,          P                  ,          p\        V\        P&                  \        P(                  34      '       d   WL,          pRpEM\        WL,          \*        4      '       d)   \        P,                  ! WL,          VP                  4      pMWL,          p\        V\        P,                  4      '       g   Q h\        P                  ! VP                  \        RP                  VP                  V4      4      VP                  4      pVP/                  \        P0                  ! VWP                  4      4       V P3                  W\        P                  V4       RpV'       g   \        P                  ! VP                  \        RP                  VP                  V4      4      VP                  4      p\        P
                  P5                  WlR VP                  4      pRp
R V P6                  V&   VP/                  \        P0                  ! VWP                  4      4       V P3                  W\        P                  V4       V	P/                  X4       EK  	  V
'       dM   V'       dE   VP9                  ^ \        P0                  ! WvVP                  4      4       V P3                  WXV4       \;        V	4      # )Nr]   z{}_shapeFTz	{}_size{})rB   r   r   r'  r  rm  r   r  r  r   r   r   r   r  r  rE   rc   rw   r   rz  rR   r   r   r   r  r  static_getitemr  r  r   )r   r   r!  r  r]   r  attr_varshape_attr_callshape_attr_typ	size_varsuse_attr_varnshapesr|   skipr   rx  ry  getitems   &&&&&&            r>   r  ArrayAnalysis._gen_shape_call(  s   eRVV$$''.E eRVV$$H"OErvv&&H"OE ggooc7CGGDOvv		=):):388)DEswwH #--66uzz5IN	%jG12uADueh//,,ux}}5C!#eoo'FGG#(8#!%(C00#%88EHcgg#>#(8%h9999!vv		%k&8&81&EF H
 KK		(Hgg FGLLejj(KD66II!+"4"4SXXq"ABGG
 ''00dCGGL#*.w'BIIgxABY%**gFX&E F OKK299_HILLnoNYrA   c                    V P                   V,          p\        V\        P                  P                  4      ;'       d    VP
                  ^ 8  # rJ   )r   rB   r   npytypesArrayr   r   varnamer   s   && r>   r)  ArrayAnalysis._isarrayl  s7    ll7##u~~334EEAErA   c                \    V P                   V,          p\        V\        P                  4      # rO   )r   rB   r   rQ   r  s   && r>   r  ArrayAnalysis._istuplep  s!    ll7##u//rA   c                \    ^ pV F#  pVP                  V4      pVf    R# W5,          pK%  	  V# )zjReturn the sum of the given list of sizes if they are all equivalent
to some constant, or None otherwise.
N)r   )r   r   r  r  r3   ro   s   &&&   r>   r  ArrayAnalysis._sum_sizet  s9     D))$/Ay  rA   )r  r  r  r  r,   r  rt  r  r  r  r   r  )static_literal_slice_partrO   )fr   r   r   r   r  r   r   r  r  r  r  r  r  r  objectr  r  r  r,  r0  r5  r>  rF  rS  r^  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r*  r.  r1  r5  r9  r=  r@  rC  rF  rI  rL  rO  rR  rU  rX  r[  r_  rb  re  rh  rk  rn  rq  rt  rw  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r)  r  r  r   r   r   s   @r>   r  r  4  s    H&",

%0:d	BB"H3
=! !HT6@=L:2>[
zG9RXEt$



D:=~I>







9 9*
 KK
K
K
K
K
HMT=&






















4
lP4"
4	9%NE*PJX!
F<
|B HF0 rA   r  r   )r   zerosonesfull)ranfrandom_samplesamplerandomstandard_normal)	chisquareweibullpower	geometricexponentialpoissonrayleigh)normaluniformbetabinomialr  gamma	lognormallaplace)Br  rr  
numba.corer   r   r   r   r   numba.core.ir_utilsr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   numba.core.analysisr   numba.core.typingr   r   r   numba.core.extendingr   r'   UNKNOWN_CLASSCONST_CLASSufunc	MAP_TYPESr  array_creationrandom_int_argsrandom_1arg_sizerandom_2arg_sizelastrandom_3arg_sizelastrandom_callsrH   rL   r   r  r   r   rI  r  r  r  NumpyRulesUnaryArrayOperator_op_mapkeysr4  r  NumpyRulesArrayOperatorr  NumpyRulesInplaceArrayOperatorr  supported_ufuncsr   r  )r  s   0r>   <module>r"     s     9 9    " 8 0  * [[M	  47#  	    ,	   ,5 ,5^
 =0 =0@Vv Vrz*H z*zkE} kE\	!F !BK!F K!\B G88@@EEGHLLL  //77<<>>>FFKKM $+$<$<=$<q

$<==s   8F