
    ܙd                     4   d Z ddlZddlmZ ddlmZmZ ddlm	Z	m
Z
 ddlmZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 ddl6m7Z7 dTdZ8d Z9d Z: eej;        d          dej<        dfd            Z= eej;        d          dUd            Z> eej;        d          dUd            Z? eej;        d          dej@        fd            ZA eej;        d          dej@        dfd            ZB eej;        d          dej@        fd            ZC eej;        d          dej@        fd            ZD eej;        d           	 	 dVd#            ZE eej;        d$          	 	 dVd%            ZF eej;        d&          dWd'            ZG eej;        d(          dWd)            ZH eej;        d*          dXd+            ZI eej;        d,          dXd-            ZJ eej;        d.          dXd/            ZK eej;        d0          dXd1            ZL eej;        d2          dXd3            ZM eej;        d4          dXd5            ZN eej;        d6          dXd7            ZO eej;        d8          dVd9            ZP eej;        d:          dVd;            ZQ eej;        d<          dVd=            ZR eej;        d>          dWd?            ZS eej;        d@          dXdA            ZT eej;        dB          dXdC            ZU eej;        dD          dXdE            ZV eej;        dF          dXdG            ZW eej;        dH          dXdI            ZX eej;        dJ          dXdK            ZY eej;        dL          dXdM            ZZ eej;        dN          dXdO            Z[ eej;        dP          dXdQ            Z\ eej;        dR          dXdS            Z]dS )Yz;
Implementation of method overloads for Generator objects.
    N)types)overload_methodregister_jitable)as_dtype
from_dtype)
next_floatnext_double)is_nonelike)TypingError)TupleUniTuple)!!random_standard_exponential_inv_frandom_standard_exponential_invrandom_standard_exponentialrandom_standard_normal_frandom_standard_gammarandom_standard_normalrandom_uniformrandom_standard_exponential_frandom_standard_gamma_frandom_normalrandom_exponentialrandom_gammarandom_betarandom_powerrandom_frandom_chisquarerandom_standard_cauchyrandom_paretorandom_weibullrandom_laplacerandom_logisticrandom_lognormalrandom_rayleighrandom_standard_trandom_waldrandom_geometricrandom_zipfrandom_triangularrandom_poissonrandom_negative_binomialrandom_logseriesrandom_noncentral_chisquarerandom_noncentral_f)random_methods	the givenc                    t          |t          j                  r|j        }|}t          |t                    r"t          t          j        |                    }n+t          |t          j                  r|}t          |          }|t          j
        t          j        fvrt          d          |t          j
        k    r| }n|}||fS )a  
        Most of the standard NumPy distributions that accept dtype argument
        only support either np.float32 or np.float64 as dtypes.

        This is a helper function that helps Numba select the proper underlying
        implementation according to provided dtype.
    zLArgument dtype is not one of the expected type(s):  np.float32 or np.float64)
isinstancer   Omittedvaluetyper   npdtypeNumberClassr   float32float64r   )func_32func_64r7   	dist_namenp_dtnb_dt	next_funcs          Alib/python3.11/site-packages/numba/np/random/generator_methods.py_get_proper_funcrB      s     %'' E%  28E??++	E5,	-	-  RZ,,, 6 7 7 	7 
			e    c                    t          t          | t                    ot          | j        t          j                  t          | t                    o
| j        dk    t          | t          j                  g          st          d          d S )Nr   zdArgument size is not one of the expected type(s):  an integer, an empty tuple or a tuple of integers)	anyr2   r   r7   r   Integerr   countr   )sizes    rA   
check_sizerI   ;   s    
4** 64:u}554'';DJ!O4//1 2 2 P  O P P 	P	P PrC   c                      t           t          j                  r j         t          |t          t
          f          s|g}t           fd|D                       st          d| dd| z             dS )z\
    Check if given object is one of the provided types.
    If not raises an TypeError
    c                 0    g | ]}t          |          S  )r2   ).0_typeobjs     rA   
<listcomp>zcheck_types.<locals>.<listcomp>P   s#    >>>5
3&&>>>rC   z	Argument z is not one of thez expected type(s): N)r2   r   r3   r4   listtuplerE   r   )rO   	type_listarg_names   `  rA   check_typesrU   E   s    
 #u}%% ii$//  K	>>>>I>>>?? =BhBBB;	;;< = = 	== =rC   integersFc                   
 t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j        t          gd           t          |t          j                  r|j        }t          |t          j                  r|j        }t          |t                    r$t          t          j        |                    }|}n;t          |t          j                  r|}t          |          }nt          d          |t          j        k    rt"          j        
ddn_	 t          j        |          }n# t(          $ r t          d          w xY wt+          t"          d|j         d          
|j        |j        t3          |          rd t          j        d	f
fd
	}	|	S t7          |           d t          j        d	f
fd	}	|	S )NlowhighendpointzArgument dtype is not one of the expected type(s): np.int32, np.int64, np.int16, np.int8, np.uint32, np.uint64, np.uint16, np.uint8, np.bool_   random_bounded_uint_fillFc                 (   t          j        |||	           |sC| |d          z  } ||          } ||          }||z
  } | j        ||d|          d         S  ||          } ||          }||z
  } | j        ||d|          d         S )N   r   r/   _randint_arg_checkbit_generator
instrX   rY   rH   r7   rZ   rngint_funclower_boundupper_bounds
          rA   implz/NumPyRandomGeneratorType_integers.<locals>.impl   s    -c4.9;H H H 
Ka eCjjuT{{Sjx 2CaGGJJeCjjuT{{Sjx 2CaGGJJrC   c                    t          j        |||	           |s=| |d          z  } ||          } ||          }||z
  } | j        ||||          S  ||          } ||          }||z
  } | j        ||||          S )Nr`   ra   rd   s
          rA   rj   z/NumPyRandomGeneratorType_integers.<locals>.impl   s    -c4.9;H H H 
Ka eCjjuT{{Sjx 2CdEJJJeCjjuT{{Sjx 2CdEJJJrC   )rU   r   rF   Booleanboolintr2   r3   r4   r5   r   r6   r7   r8   r   r   bool_r/   random_bounded_bool_filliinfo
ValueErrorgetattrbitsminmaxr
   int64rI   )re   rX   rY   rH   r7   rZ   r?   _dtypei_inforj   rg   rh   ri   s             @@@rA   !NumPyRandomGeneratorType_integersrz   V   sR    emmT30168 8 8u}emS"#)+ + +5=$/<<<$&& z%'' % &28E??++	E5,	-	- &% % & & 	& !:	*Xf%%FF 	* 	* 	* ) * * *	* >CCCCE Ejj4 #'+x%	K 	K 	K 	K 	K 	K 	K 	K 4'+x%	K 	K 	K 	K 	K 	K 	K 	K s   $E9 9Fshufflec                     t          |t          j        gd           t          |t          t          j        gd           dd}|S )Nxaxisr   c                    |dk     r
||j         z   }||j         dz
  k    s|dk     rt          d          t          j        |d|          }t          j        |d                   }t          t          |          dz
  dd          D ]X}t          j        t          j
        | j        |                    }||k    r5||df         |d<   ||df         ||df<   |||df<   Yd S )Nr   r`   z)Axis is out of bounds for the given array)r   .r[   .)ndim
IndexErrorr6   swapaxes
empty_likerangelenr   intpr/   random_intervalrc   )re   r}   r~   zbufijs          rA   rj   z.NumPyRandomGeneratorType_shuffle.<locals>.impl   s    !88!&=D!&1*qHIIIK1d##mAfI&&s1vvz1b)) 	 	A
>9$:L:;= = > >AAvvCyCH!S&	AafIAafII	 	rC   r   )rU   r   Arrayrn   rF   )re   r}   r~   rj   s       rA    NumPyRandomGeneratorType_shuffler      sL    EK=#&&&sEM*F333   $ KrC   permutationc                     t          |t          j        t          j        gd           t          |t          t          j        gd           t          |t          j                  dfd	}|S )Nr}   r~   r   c                     r*t          j        |          }|                     |           n+|                                }|                     ||           |S )N)r~   )r6   aranger{   copy)re   r}   r~   new_arrIS_INTs       rA   rj   z2NumPyRandomGeneratorType_permutation.<locals>.impl   sU     	-illGLL!!!!ffhhGLLtL,,,rC   r   )rU   r   r   rF   rn   r2   )re   r}   r~   rj   r   s       @rA   $NumPyRandomGeneratorType_permutationr      sm    EK/555sEM*F3335=))F      KrC   randomc                    t          t          t          |d          \  t          |t          j                  r|j        }t          |          rd t          j	        ffd	}|S t          |           d t          j	        ffd	}|S )Nr   c                 6      | j                             S Nrc   re   rH   r7   	dist_funcr?   s      rA   rj   z-NumPyRandomGeneratorType_random.<locals>.impl        54#566777rC   c                     t          j        ||          }|j        }t          |j                  D ]} | j                  ||<   |S Nr7   r6   emptyflatr   rH   rc   re   rH   r7   outout_fr   r   s         rA   rj   z-NumPyRandomGeneratorType_random.<locals>.impl   R    (4u---CHE38__ 9 9$9T%788aJrC   )rB   r   r	   r2   r   r3   r4   r
   r6   r:   rI   re   rH   r7   rj   r   r?   s       @@rA   NumPyRandomGeneratorType_randomr      s    '
K(-x9 9Iu$&& z4  
 	8 	8 	8 	8 	8 	8 	84 
 	 	 	 	 	 	 rC   standard_exponentialzigc                    t          |t          j        t          gd           t	          t
          t          |          \  t	          t          t          |          \  t          |t          j
                  r|j        }t          |          rd t          j        dffd	}|S t          |           d t          j        dffd	}|S )Nmethodr   c                     |dk    r  | j                             S |dk    r  | j                             S t          d          )Nr   inv$Method must be either 'zig' or 'inv')rc   rr   )re   rH   r7   r   r   dist_func_invr?   s       rA   rj   z;NumPyRandomGeneratorType_standard_exponential.<locals>.impl  s^    uYYt'9::;;;5u]]4+=>>??? !GHHHrC   c                 $   t          j        ||          }|j        }|dk    r+t          |j                  D ]} | j                  ||<   n@|dk    r+t          |j                  D ]} | j                  ||<   nt          d          |S )Nr   r   r   r   )r6   r   r   r   rH   rc   rr   )	re   rH   r7   r   r   r   r   r   r   s	          rA   rj   z;NumPyRandomGeneratorType_standard_exponential.<locals>.impl  s    (4u---CHEsx = =A(y);<<E!HH=5sx A AA,}T-?@@E!HHA !!GHHHJrC   )rU   r   UnicodeTypestrrB   r   r   r   r   r2   r3   r4   r
   r6   r:   rI   )re   rH   r7   r   rj   r   r   r?   s        @@@rA   -NumPyRandomGeneratorType_standard_exponentialr      s    *C0(;;;+)' M5 ((E(C(-/ /Iu $&& z4  
5 	I 	I 	I 	I 	I 	I 	I 	I 4 
5 	 	 	 	 	 	 	 rC   standard_normalc                    t          t          t          |          \  t          |t          j                  r|j        }t          |          rd t          j	        ffd	}|S t          |           d t          j	        ffd	}|S )Nc                 6      | j                             S r   r   r   s      rA   rj   z6NumPyRandomGeneratorType_standard_normal.<locals>.impl/  r   rC   c                     t          j        ||          }|j        }t          |j                  D ]} | j                  ||<   |S r   r   r   s         rA   rj   z6NumPyRandomGeneratorType_standard_normal.<locals>.impl5  r   rC   )rB   r   r   r2   r   r3   r4   r
   r6   r:   rI   r   s       @@rA   (NumPyRandomGeneratorType_standard_normalr   &  s    '(@(>(-/ /Iu $&& z4  
 	8 	8 	8 	8 	8 	8 	84 
 	 	 	 	 	 	 rC   standard_gammac                 x   t          |t          j        t          j        t          t
          gd           t          t          t          |          \  t          |t          j
                  r|j        }t          |          rd t          j        ffd	}|S t          |           d t          j        ffd	}|S )Nshapec                 8      | j         |                    S r   r   )re   r   rH   r7   r   r?   s       rA   rj   z5NumPyRandomGeneratorType_standard_gamma.<locals>.implJ  s"    54#5u==>>>rC   c                     t          j        ||          }|j        }t          |j                  D ]} | j        |          ||<   |S r   r   )re   r   rH   r7   r   r   r   r   s          rA   rj   z5NumPyRandomGeneratorType_standard_gamma.<locals>.implP  sV    (4u---CHE38__ @ @$9T%7??aJrC   )rU   r   FloatrF   rn   floatrB   r   r   r2   r3   r4   r
   r6   r:   rI   )re   r   rH   r7   rj   r   r?   s        @@rA   'NumPyRandomGeneratorType_standard_gammar   ?  s     U]C?III'(?(=(-/ /Iu $&& z4 #'rz 	? 	? 	? 	? 	? 	? 	?4#'rz 	 	 	 	 	 	 rC   normal              ?c                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nlocscaler   r   c                 .    t          | j        ||          S r   )r   rc   re   r   r   rH   s       rA   rj   z-NumPyRandomGeneratorType_normal.<locals>.implc  s     !3S%@@@rC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r:   r   r   rH   r   rc   re   r   r   rH   r   r   r   s          rA   rj   z-NumPyRandomGeneratorType_normal.<locals>.impli  sW    (4rz222CHE38__ I I();S%HHaJrC   r   r   NrU   r   r   rF   rn   r   r2   r3   r4   r
   rI   re   r   r   rH   rj   s        rA   NumPyRandomGeneratorType_normalr   Z  s     ek5=#u=uEEEU]C?III$&& z4 	A 	A 	A 	A4	 	 	 	 rC   uniformc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )NrX   rY   r   r   c                 4    t          | j        |||z
            S r   )r   rc   )re   rX   rY   rH   s       rA   rj   z.NumPyRandomGeneratorType_uniform.<locals>.impl|  s    !$"4c4#:FFFrC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |||z
            ||<   |S r   )r6   r   r:   r   r   rH   r   rc   )re   rX   rY   rH   r   r   r   s          rA   rj   z.NumPyRandomGeneratorType_uniform.<locals>.impl  s[    (4rz222CHE38__ O O)$*<c4#:NNaJrC   r   r   )re   rX   rY   rH   rj   s        rA    NumPyRandomGeneratorType_uniformr   s  s     ek5=#u=uEEEu{EM3>GGG$&& z4 	G 	G 	G 	G4	 	 	 	 rC   exponentialc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   r   c                 ,    t          | j        |          S r   )r   rc   re   r   rH   s      rA   rj   z2NumPyRandomGeneratorType_exponential.<locals>.impl  s    %d&8%@@@rC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r:   r   r   rH   r   rc   re   r   rH   r   r   r   s         rA   rj   z2NumPyRandomGeneratorType_exponential.<locals>.impl  sU    (4rz222CHE38__ I I-d.@%HHaJrC   r   Nr   re   r   rH   rj   s       rA   $NumPyRandomGeneratorType_exponentialr     s    U]C?III$&& z4 	A 	A 	A 	A4	 	 	 	 rC   gammac                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   r   r   c                 .    t          | j        ||          S r   )r   rc   )re   r   r   rH   s       rA   rj   z,NumPyRandomGeneratorType_gamma.<locals>.impl  s     2E5AAArC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r:   r   r   rH   r   rc   )re   r   r   rH   r   r   r   s          rA   rj   z,NumPyRandomGeneratorType_gamma.<locals>.impl  sW    (4rz222CHE38__ J J'(:E5IIaJrC   r   r   )re   r   r   rH   rj   s        rA   NumPyRandomGeneratorType_gammar     s    U]C?IIIU]C?III$&& z4 	B 	B 	B 	B4	 	 	 	 rC   betac                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nabc                 .    t          | j        ||          S r   )r   rc   )re   r   r   rH   s       rA   rj   z+NumPyRandomGeneratorType_beta.<locals>.impl  s    t11a888rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r   rc   )re   r   r   rH   r   r   r   s          rA   rj   z+NumPyRandomGeneratorType_beta.<locals>.impl  sN    (4..CHE38__ A A&t'91a@@aJrC   r   r   )re   r   r   rH   rj   s        rA   NumPyRandomGeneratorType_betar     s    EKU;SAAAEKU;SAAA$&& z4 	9 	9 	9 	94	 	 	 	 rC   fc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Ndfnumdfdenc                 .    t          | j        ||          S r   )r   rc   )re   r   r   rH   s       rA   rj   z(NumPyRandomGeneratorType_f.<locals>.impl  s    D.u===rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r   rc   )re   r   r   rH   r   r   r   s          rA   rj   z(NumPyRandomGeneratorType_f.<locals>.impl  sN    (4..CHE38__ F F#D$6uEEaJrC   r   r   )re   r   r   rH   rj   s        rA   NumPyRandomGeneratorType_fr     s    U]C?IIIU]C?III$&& z4 	> 	> 	> 	>4	 	 	 	 rC   	chisquarec                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Ndfc                 ,    t          | j        |          S r   )r   rc   re   r   rH   s      rA   rj   z0NumPyRandomGeneratorType_chisquare.<locals>.impl  s    #D$6;;;rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r   rc   re   r   rH   r   r   r   s         rA   rj   z0NumPyRandomGeneratorType_chisquare.<locals>.impl  sL    (4..CHE38__ D D+D,>CCaJrC   r   r   re   r   rH   rj   s       rA   "NumPyRandomGeneratorType_chisquarer     s    U[%-e<dCCC$&& z4 	< 	< 	< 	<4	 	 	 	 rC   standard_cauchyc                     t          |t          j                  r|j        }t	          |          rdd}|S t          |           dd}|S )Nc                 *    t          | j                  S r   )r   rc   )re   rH   s     rA   rj   z6NumPyRandomGeneratorType_standard_cauchy.<locals>.impl  s    )$*<===rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j                  ||<   |S r   )r6   r   r   r   rH   r   rc   )re   rH   r   r   r   s        rA   rj   z6NumPyRandomGeneratorType_standard_cauchy.<locals>.impl  sJ    (4..CHE38__ F F1$2DEEaJrC   r   )r2   r   r3   r4   r
   rI   )re   rH   rj   s      rA   (NumPyRandomGeneratorType_standard_cauchyr     sq     $&& z4 	> 	> 	> 	>4	 	 	 	 rC   paretoc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   c                 ,    t          | j        |          S r   )r   rc   re   r   rH   s      rA   rj   z-NumPyRandomGeneratorType_pareto.<locals>.impl  s     !3Q777rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r   rc   re   r   rH   r   r   r   s         rA   rj   z-NumPyRandomGeneratorType_pareto.<locals>.impl$  sL    (4..CHE38__ @ @();Q??aJrC   r   r   re   r   rH   rj   s       rA   NumPyRandomGeneratorType_paretor    s    EKU;SAAA$&& z4 	8 	8 	8 	84	 	 	 	 rC   weibullc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   c                 ,    t          | j        |          S r   )r    rc   r  s      rA   rj   z.NumPyRandomGeneratorType_weibull.<locals>.impl4  s    !$"4a888rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r    rc   r  s         rA   rj   z.NumPyRandomGeneratorType_weibull.<locals>.impl:  sL    (4..CHE38__ A A)$*<a@@aJrC   r   r   r  s       rA    NumPyRandomGeneratorType_weibullr  -  s    EKU;SAAA$&& z4 	9 	9 	9 	94	 	 	 	 rC   powerc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   c                 ,    t          | j        |          S r   )r   rc   r  s      rA   rj   z,NumPyRandomGeneratorType_power.<locals>.implJ  s     2A666rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r   rc   r  s         rA   rj   z,NumPyRandomGeneratorType_power.<locals>.implP  sJ    (4..CHE38__ ? ?'(:A>>aJrC   r   r   r  s       rA   NumPyRandomGeneratorType_powerr  C  s    EKU;SAAA$&& z4 	7 	7 	7 	74	 	 	 	 rC   laplacec                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   r   r   r   c                 .    t          | j        ||          S r   )r!   rc   r   s       rA   rj   z.NumPyRandomGeneratorType_laplace.<locals>.impla  s    !$"4c5AAArC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r!   rc   r   s          rA   rj   z.NumPyRandomGeneratorType_laplace.<locals>.implg  sN    (4..CHE38__ J J)$*<c5IIaJrC   r   r   r   s        rA    NumPyRandomGeneratorType_laplacer  Y  s    ek5=#u=uEEEU]C?III$&& z4 	B 	B 	B 	B4	 	 	 	 rC   logisticc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   r   r   r   c                 .    t          | j        ||          S r   )r"   rc   r   s       rA   rj   z/NumPyRandomGeneratorType_logistic.<locals>.implx  s    "4#5sEBBBrC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r"   rc   r   s          rA   rj   z/NumPyRandomGeneratorType_logistic.<locals>.impl~  sN    (4..CHE38__ K K*4+=sEJJaJrC   r   r   r   s        rA   !NumPyRandomGeneratorType_logisticr  p  s    ek5=#u=uEEEU]C?III$&& z4 	C 	C 	C 	C4	 	 	 	 rC   	lognormalc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nmeansigmar   r   c                 .    t          | j        ||          S r   )r#   rc   )re   r  r   rH   s       rA   rj   z0NumPyRandomGeneratorType_lognormal.<locals>.impl  s    #D$6eDDDrC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r#   rc   )re   r  r   rH   r   r   r   s          rA   rj   z0NumPyRandomGeneratorType_lognormal.<locals>.impl  sN    (4..CHE38__ M M+D,>eLLaJrC   r   r   )re   r  r   rH   rj   s        rA   "NumPyRandomGeneratorType_lognormalr#    s    u{EM3>GGGU]C?III$&& z4 	E 	E 	E 	E4	 	 	 	 rC   rayleighc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   r   c                 ,    t          | j        |          S r   )r$   rc   r   s      rA   rj   z/NumPyRandomGeneratorType_rayleigh.<locals>.impl  s    "4#5u===rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r$   rc   r   s         rA   rj   z/NumPyRandomGeneratorType_rayleigh.<locals>.impl  sL    (4..CHE38__ F F*4+=uEEaJrC   r   r   r   s       rA   !NumPyRandomGeneratorType_rayleighr(    s    U]C?III$&& z4 	> 	> 	> 	>4	 	 	 	 rC   
standard_tc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   c                 ,    t          | j        |          S r   )r%   rc   r   s      rA   rj   z1NumPyRandomGeneratorType_standard_t.<locals>.impl  s    $T%7<<<rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   r   r   rH   r%   rc   r   s         rA   rj   z1NumPyRandomGeneratorType_standard_t.<locals>.impl  sL    (4..CHE38__ E E,T-?DDaJrC   r   r   r   s       rA   #NumPyRandomGeneratorType_standard_tr-    s    U[%-e<dCCC$&& z4 	= 	= 	= 	=4	 	 	 	 rC   waldc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr  r   c                 .    t          | j        ||          S r   )r&   rc   )re   r  r   rH   s       rA   rj   z+NumPyRandomGeneratorType_wald.<locals>.impl  s    t14???rC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r   r   rH   r&   rc   )re   r  r   rH   r   r   r   s          rA   rj   z+NumPyRandomGeneratorType_wald.<locals>.impl  sN    (4..CHE38__ H H&t'94GGaJrC   r   r   )re   r  r   rH   rj   s        rA   NumPyRandomGeneratorType_waldr2    s    u{EM3>GGGU]C?III$&& z4 	@ 	@ 	@ 	@4	 	 	 	 rC   	geometricc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Npc                 P    t          j        t          | j        |                    S r   )r6   rw   r'   rc   )re   r5  rH   s      rA   rj   z0NumPyRandomGeneratorType_geometric.<locals>.impl  s     8,T-?CCDDDrC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   rw   r   r   rH   r'   rc   )re   r5  rH   r   r   r   s         rA   rj   z0NumPyRandomGeneratorType_geometric.<locals>.impl  sU    (4rx000CHE38__ C C+D,>BBaJrC   r   r   )re   r5  rH   rj   s       rA   "NumPyRandomGeneratorType_geometricr8    s    EKU;SAAA$&& z4 	E 	E 	E 	E4	 	 	 	 rC   zipfc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nr   c                 P    t          j        t          | j        |                    S r   )r6   rw   r(   rc   r  s      rA   rj   z+NumPyRandomGeneratorType_zipf.<locals>.impl  s    8K(:A>>???rC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   rw   r   r   rH   r(   rc   r  s         rA   rj   z+NumPyRandomGeneratorType_zipf.<locals>.impl  sS    (4rx000CHE38__ > >&t'91==aJrC   r   r   r  s       rA   NumPyRandomGeneratorType_zipfr=    s    EKU;SAAA$&& z4 	@ 	@ 	@ 	@4	 	 	 	 rC   
triangularc                    t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nleftmoderightc                 0    t          | j        |||          S r   )r)   rc   )re   r@  rA  rB  rH   s        rA   rj   z1NumPyRandomGeneratorType_triangular.<locals>.impl  s    $T%7tUKKKrC   c                     t          j        |          }|j        }t          |j                  D ]}t          | j        |||          ||<   |S r   )r6   r   r   r   rH   r)   rc   )re   r@  rA  rB  rH   r   r   r   s           rA   rj   z1NumPyRandomGeneratorType_triangular.<locals>.impl  sW    (4..CHE38__ @ @,T-?-14@ @aJrC   r   r   )re   r@  rA  rB  rH   rj   s         rA   #NumPyRandomGeneratorType_triangularrE    s    u{EM3>GGGu{EM3>GGGU]C?III$&& z4 	L 	L 	L 	L4	 	 	 	 rC   poissonc                     t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nlamc                 P    t          j        t          | j        |                    S r   )r6   rw   r*   rc   )re   rH  rH   s      rA   rj   z.NumPyRandomGeneratorType_poisson.<locals>.impl-  s    8N4+=sCCDDDrC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   rw   r   r   rH   r*   rc   )re   rH  rH   r   r   r   s         rA   rj   z.NumPyRandomGeneratorType_poisson.<locals>.impl3  sU    (4rx000CHE38__ C C)$*<cBBaJrC   r   r   )re   rH  rH   rj   s       rA    NumPyRandomGeneratorType_poissonrK  &  s    ek5=#u=uEEE$&& z4 	E 	E 	E 	E4	 	 	 	 rC   negative_binomialc                 d   t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          |          rdd}|S t          |           dd}|S )Nnr5  c                 R    t          j        t          | j        ||                    S r   )r6   rw   r+   rc   )re   rN  r5  rH   s       rA   rj   z8NumPyRandomGeneratorType_negative_binomial.<locals>.implD  s"    84T5GANNOOOrC   c                     t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   rw   r   r   rH   r+   rc   )re   rN  r5  rH   r   r   r   s          rA   rj   z8NumPyRandomGeneratorType_negative_binomial.<locals>.implJ  sW    (4rx000CHE38__ N N3D4F1MMaJrC   r   r   )re   rN  r5  rH   rj   s        rA   *NumPyRandomGeneratorType_negative_binomialrQ  <  s    EKU;SAAAEKU;SAAA$&& z4 	P 	P 	P 	P4	 	 	 	 rC   noncentral_chisquarec                    t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          d             t          |          rdfd	}|S t          |           dfd	}|S )Nr   noncc                 Z    | dk    rt          d          |dk     rt          d          d S )Nr   zdf <= 0nonc < 0rr   )r   rT  s     rA   check_arg_boundszGNumPyRandomGeneratorType_noncentral_chisquare.<locals>.check_arg_boundsZ  s7    77Y'''!88Z((( 8rC   c                 l     ||           t          j        t          | j        ||                    S r   )r6   r:   r-   rc   )re   r   rT  rH   rX  s       rA   rj   z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implb  sF    R&&&:9$:L:<dD D E E ErC   c                      ||           t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        ||          ||<   |S r   )r6   r   r:   r   r   rH   r-   rc   )re   r   rT  rH   r   r   r   rX  s          rA   rj   z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implj  sr    R&&&(4rz222CHE38__ A A6t7I794A AaJrC   r   rU   r   r   rF   rn   r   r2   r3   r4   r   r
   rI   )re   r   rT  rH   rj   rX  s        @rA   -NumPyRandomGeneratorType_noncentral_chisquarer\  S  s    U[%-e<dCCCu{EM3>GGG$&& z) ) ) 4 	E 	E 	E 	E 	E 	E 4	 	 	 	 	 	 rC   noncentral_fc                    t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          d             t          |          rdfd	}|S t          |           dfd	}|S )Nr   r   rT  c                     | dk    rt          d          |dk    rt          d          |dk     rt          d          d S )Nr   z
dfnum <= 0z
dfden <= 0rV  rW  )r   r   rT  s      rA   rX  z?NumPyRandomGeneratorType_noncentral_f.<locals>.check_arg_bounds}  sN    A::\***A::\***!88Z((( 8rC   c                 p     |||           t          j        t          | j        |||                    S r   )r6   r:   r.   rc   )re   r   r   rT  rH   rX  s        rA   rj   z3NumPyRandomGeneratorType_noncentral_f.<locals>.impl  sJ    UE4000:1$2D27F F G G GrC   c                      |||           t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |||          ||<   |S r   )r6   r   r:   r   r   rH   r.   rc   )	re   r   r   rT  rH   r   r   r   rX  s	           rA   rj   z3NumPyRandomGeneratorType_noncentral_f.<locals>.impl  sv    UE4000(4rz222CHE38__ C C.t/A/4eTC CaJrC   r   r[  )re   r   r   rT  rH   rj   rX  s         @rA   %NumPyRandomGeneratorType_noncentral_frb  u  s   U]C?IIIU]C?IIIu{EM3>GGG$&& z) ) ) 4 	G 	G 	G 	G 	G 	G 4	 	 	 	 	 	 rC   	logseriesc                 (   t          |t          j        t          j        t          t
          gd           t          |t          j                  r|j        }t          d             t          |          rdfd	}|S t          |           dfd	}|S )Nr5  c                 d    | dk     s| dk    st          j        |           rt          d          d S )Nr   r`   zp < 0, p >= 1 or p is NaN)r6   isnanrr   )r5  s    rA   rX  z<NumPyRandomGeneratorType_logseries.<locals>.check_arg_bounds  s5    q55AFFbhqkkF8999 FrC   c                 h     |           t          j        t          | j        |                    S r   )r6   rw   r,   rc   )re   r5  rH   rX  s      rA   rj   z0NumPyRandomGeneratorType_logseries.<locals>.impl  s2    Q8,T-?CCDDDrC   c                      |           t          j        |t           j                  }|j        }t	          |j                  D ]}t          | j        |          ||<   |S r   )r6   r   rw   r   r   rH   r,   rc   )re   r5  rH   r   r   r   rX  s         rA   rj   z0NumPyRandomGeneratorType_logseries.<locals>.impl  sg    Q(4rx000CHE38__ C C+D,>BBaJrC   r   r[  )re   r5  rH   rj   rX  s       @rA   "NumPyRandomGeneratorType_logseriesri    s    EKU;SAAA$&& z: : : 4 	E 	E 	E 	E 	E 	E 4	 	 	 	 	 	 rC   )r0   r   r   r   r   )^__doc__numpyr6   
numba.corer   numba.core.extendingr   r   numba.np.numpy_supportr   r   numba.np.random.generator_corer   r	   r
   numba.core.errorsr   numba.core.types.containersr   r   numba.np.random.distributionsr   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.   numba.np.randomr/   rB   rI   rU   NumPyRandomGeneratorTyperw   rz   r   r   r:   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r#  r(  r-  r2  r8  r=  rE  rK  rQ  r\  rb  ri  rL   rC   rA   <module>ru     s              B B B B B B B B 7 7 7 7 7 7 7 7 B B B B B B B B . . . . . . ) ) ) ) ) ) 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 + * * * * *   >P P P= = =" /<<<@,.HuP P P =<Pn /;;   <;8 /??   @?( /::/32:    ;:. /1GHH=A8:
9>) ) ) IH)Z /1BCC8<BJ    DC0 /1ABB>B24*   CB4 /::9<)-   ;:0 /;;9<*.   <;0 /??   @?, /99   :9. /88   98. /55   65. /==   >=* /1BCC   DC* /::   ;:* /;;   <;* /99   :9* /;;   <;, /<<   =<, /==   >=, /<<   =<* />>   ?>* /88   98, /==   >=* /88   98* />>   ?>0 /;;   <;* /1DEE   FE, /1GHH   IHB /@@! ! ! A@!H /==   >=  rC   