U
    hd                     @   s  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 dwddZ8dd Z9dd Z:eej;ddej<dfddZ=eej;ddxddZ>eej;ddyddZ?eej;ddej@fddZAeej;d dej@d!fd"d#ZBeej;d$dej@fd%d&ZCeej;d'dej@fd(d)ZDeej;d*dzd-d.ZEeej;d/d{d0d1ZFeej;d2d|d3d4ZGeej;d5d}d6d7ZHeej;d8d~d9d:ZIeej;d;dd<d=ZJeej;d>dd?d@ZKeej;dAddBdCZLeej;dDddEdFZMeej;dGddHdIZNeej;dJddKdLZOeej;dMddNdOZPeej;dPddQdRZQeej;dSddTdUZReej;dVddWdXZSeej;dYddZd[ZTeej;d\dd]d^ZUeej;d_dd`daZVeej;dbddcddZWeej;deddfdgZXeej;dhddidjZYeej;dkddldmZZeej;dnddodpZ[eej;dqddrdsZ\eej;dtddudvZ]dS )z;
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                 C   s|   t |tjr|j}|}t |tr0tt|}nt |tjrH|}t	|}|tj
tjfkr`td|tj
krp| }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   Zfloat32float64r
   )Zfunc_32Zfunc_64r5   	dist_nameZnp_dtnb_dtZ	next_func r:   Z/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/numba/np/random/generator_methods.py_get_proper_func   s    

r<   c                 C   sF   t t| tot| jtjt| to*| jdkt| tjgsBtdd S )Nr   zdArgument size is not one of the expected type(s):  an integer, an empty tuple or a tuple of integers)	anyr0   r   r5   r   Integerr   countr
   )sizer:   r:   r;   
check_size;   s    
rA   c                    sZ   t  tjr j t |ttfs&|g}t fdd|D sVtd| dd|  dS )z\
    Check if given object is one of the provided types.
    If not raises an TypeError
    c                    s   g | ]}t  |qS r:   )r0   ).0_typeobjr:   r;   
<listcomp>P   s     zcheck_types.<locals>.<listcomp>z	Argument z is not one of thez expected type(s): N)r0   r   r1   r2   listtupler=   r
   )rE   Z	type_listZarg_namer:   rD   r;   check_typesE   s    rI   ZintegersFc           
         s^  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rT|j}t|tjrf|j}t|t	rt
t|}|}n"t|tjr|}t|}ntd|tjkrtj ddnLzt|}W n tk
r   tdY nX ttd|j d |j|jt|r4d tjd	f fd
d	}	|	S t| d tjd	f fdd	}	|	S 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_   Zrandom_bounded_uintZ_fillFc                    s   t ||| |sP||d8 }||}||}|| } | j||d|d S ||}||}|| } | j||d|d S d S )N   r   r.   Z_randint_arg_checkbit_generatorinstrJ   rK   r@   r5   rL   rngZint_funclower_boundupper_boundr:   r;   impl   s    
 z/NumPyRandomGeneratorType_integers.<locals>.implc                    sz   t ||| |sL||d8 }||}||}|| } | j||||S ||}||}|| } | j||||S d S )NrO   rP   rR   rU   r:   r;   rX      s    
 )rI   r   r>   Booleanboolintr0   r1   r2   r3   r   r4   r5   r6   r   r
   Zbool_r.   Zrandom_bounded_bool_fillZiinfo
ValueErrorgetattrbitsminmaxr	   int64rA   )
rS   rJ   rK   r@   r5   rL   r9   Z_dtypeZi_inforX   r:   rU   r;   !NumPyRandomGeneratorType_integersV   sd       



  rb   shufflec                 C   s0   t |tjgd t |ttjgd ddd}|S )Nxaxisr   c                 S   s   |dk r||j  }||j d ks(|dk r0tdt|d|}t|d }tt|d ddD ]R}tt	
| j|}||krq`||df |d< ||df ||df< |||df< q`d S )Nr   rO   z)Axis is out of bounds for the given array)r   .rM   .)ndim
IndexErrorr4   ZswapaxesZ
empty_likerangelenr   Zintpr.   Zrandom_intervalrQ   )rS   rd   re   zbufijr:   r:   r;   rX      s    
z.NumPyRandomGeneratorType_shuffle.<locals>.impl)r   )rI   r   Arrayr[   r>   rS   rd   re   rX   r:   r:   r;    NumPyRandomGeneratorType_shuffle   s    
rp   Zpermutationc                    sD   t |tjtjgd t |ttjgd t|tj d fdd	}|S )Nrd   re   r   c                    s4    rt |}| | n| }| j||d |S )N)re   )r4   Zarangerc   copy)rS   rd   re   Znew_arrZIS_INTr:   r;   rX      s    
z2NumPyRandomGeneratorType_permutation.<locals>.impl)r   )rI   r   rn   r>   r[   r0   ro   r:   rr   r;   $NumPyRandomGeneratorType_permutation   s
    
rs   randomc                    sj   t tt|d\ t|tjr$|j}t|rFd tj	f fdd	}|S t
| d tj	f fdd	}|S d S )Nrt   c                    s    | j S NrQ   rS   r@   r5   	dist_funcr9   r:   r;   rX      s    z-NumPyRandomGeneratorType_random.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S Nr5   r4   emptyflatrh   r@   rQ   rS   r@   r5   outout_frl   ry   r:   r;   rX      s
    )r<   r   r   r0   r   r1   r2   r	   r4   r7   rA   rS   r@   r5   rX   r:   rx   r;   NumPyRandomGeneratorType_random   s     r   Zstandard_exponentialzigc                    s   t |tjtgd ttt|\ttt|\ t	|tj
rD|j}t|rjd tjdf fdd	}|S t| d tjdf fdd	}|S d S )Nmethodr   c                    s8   |dkr | j S |dkr,| j S tdd S )Nr   inv$Method must be either 'zig' or 'inv')rQ   r\   )rS   r@   r5   r   ry   dist_func_invr9   r:   r;   rX     s
    z;NumPyRandomGeneratorType_standard_exponential.<locals>.implc                    sp   t j||d}|j}|dkr<t|jD ]} | j||< q&n0|dkrdt|jD ]}| j||< qNntd|S )Nr{   r   r   r   )r4   r}   r~   rh   r@   rQ   r\   )rS   r@   r5   r   r   r   rl   )ry   r   r:   r;   rX     s    )rI   r   ZUnicodeTypestrr<   r   r   r   r   r0   r1   r2   r	   r4   r7   rA   )rS   r@   r5   r   rX   r:   r   r;   -NumPyRandomGeneratorType_standard_exponential   s$    r   Zstandard_normalc                    sh   t tt|\ t|tjr"|j}t|rDd tj	f fdd	}|S t
| d tj	f fdd	}|S d S )Nc                    s    | j S ru   rv   rw   rx   r:   r;   rX   /  s    z6NumPyRandomGeneratorType_standard_normal.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S rz   r|   r   r   r:   r;   rX   5  s
    )r<   r   r   r0   r   r1   r2   r	   r4   r7   rA   r   r:   rx   r;   (NumPyRandomGeneratorType_standard_normal&  s    r   Zstandard_gammac                    s   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d	}|S t| d tjf fdd	}|S d S )Nshapec                    s    | j |S ru   rv   )rS   r   r@   r5   rx   r:   r;   rX   J  s    z5NumPyRandomGeneratorType_standard_gamma.<locals>.implc                    s8   t j||d}|j}t|jD ]} | j|||< q|S rz   r|   )rS   r   r@   r5   r   r   rl   r   r:   r;   rX   P  s
    )rI   r   Floatr>   r[   floatr<   r   r   r0   r1   r2   r	   r4   r7   rA   )rS   r   r@   r5   rX   r:   rx   r;   'NumPyRandomGeneratorType_standard_gamma?  s    r   normal              ?c                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nlocscaler   r   c                 S   s   t | j||S ru   )r   rQ   rS   r   r   r@   r:   r:   r;   rX   c  s    z-NumPyRandomGeneratorType_normal.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S rz   )r4   r}   r7   r~   rh   r@   r   rQ   rS   r   r   r@   r   r   rl   r:   r:   r;   rX   i  s
    )r   r   N)r   r   NrI   r   r   r>   r[   r   r0   r1   r2   r	   rA   rS   r   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_normalZ  s    

r   uniformc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
NrJ   rK   r   r   c                 S   s   t | j||| S ru   )r   rQ   )rS   rJ   rK   r@   r:   r:   r;   rX   |  s    z.NumPyRandomGeneratorType_uniform.<locals>.implc                 S   s@   t j|t jd}|j}t|jD ]}t| j||| ||< q |S rz   )r4   r}   r7   r~   rh   r@   r   rQ   )rS   rJ   rK   r@   r   r   rl   r:   r:   r;   rX     s
    )r   r   N)r   r   Nr   )rS   rJ   rK   r@   rX   r:   r:   r;    NumPyRandomGeneratorType_uniforms  s    

r   Zexponentialc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j|S ru   )r   rQ   rS   r   r@   r:   r:   r;   rX     s    z2NumPyRandomGeneratorType_exponential.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S rz   )r4   r}   r7   r~   rh   r@   r   rQ   rS   r   r@   r   r   rl   r:   r:   r;   rX     s
    )r   N)r   Nr   rS   r   r@   rX   r:   r:   r;   $NumPyRandomGeneratorType_exponential  s    

r   gammac                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )	Nr   r   r   c                 S   s   t | j||S ru   )r   rQ   )rS   r   r   r@   r:   r:   r;   rX     s    z,NumPyRandomGeneratorType_gamma.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S rz   )r4   r}   r7   r~   rh   r@   r   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX     s
    )r   N)r   Nr   )rS   r   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_gamma  s    

r   betac                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nabc                 S   s   t | j||S ru   )r   rQ   )rS   r   r   r@   r:   r:   r;   rX     s    z+NumPyRandomGeneratorType_beta.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX     s
    
)N)Nr   )rS   r   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_beta  s    

r   fc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Ndfnumdfdenc                 S   s   t | j||S ru   )r   rQ   )rS   r   r   r@   r:   r:   r;   rX     s    z(NumPyRandomGeneratorType_f.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX     s
    
)N)Nr   )rS   r   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_f  s    

r   Z	chisquarec                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Ndfc                 S   s   t | j|S ru   )r   rQ   rS   r   r@   r:   r:   r;   rX     s    z0NumPyRandomGeneratorType_chisquare.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   rS   r   r@   r   r   rl   r:   r:   r;   rX     s
    
)N)Nr   rS   r   r@   rX   r:   r:   r;   "NumPyRandomGeneratorType_chisquare  s    

r   Zstandard_cauchyc                 C   sB   t |tjr|j}t|r(ddd}|S t| ddd}|S d S )Nc                 S   s
   t | jS ru   )r   rQ   )rS   r@   r:   r:   r;   rX     s    z6NumPyRandomGeneratorType_standard_cauchy.<locals>.implc                 S   s2   t |}|j}t|jD ]}t| j||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   )rS   r@   r   r   rl   r:   r:   r;   rX     s
    
)N)N)r0   r   r1   r2   r	   rA   )rS   r@   rX   r:   r:   r;   (NumPyRandomGeneratorType_standard_cauchy  s    

r   Zparetoc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S ru   )r   rQ   rS   r   r@   r:   r:   r;   rX     s    z-NumPyRandomGeneratorType_pareto.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   rS   r   r@   r   r   rl   r:   r:   r;   rX   $  s
    
)N)Nr   rS   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_pareto  s    

r   Zweibullc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S ru   )r   rQ   r   r:   r:   r;   rX   4  s    z.NumPyRandomGeneratorType_weibull.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   r   r:   r:   r;   rX   :  s
    
)N)Nr   r   r:   r:   r;    NumPyRandomGeneratorType_weibull-  s    

r   powerc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S ru   )r   rQ   r   r:   r:   r;   rX   J  s    z,NumPyRandomGeneratorType_power.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r   rQ   r   r:   r:   r;   rX   P  s
    
)N)Nr   r   r:   r:   r;   NumPyRandomGeneratorType_powerC  s    

r   Zlaplacec                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nr   r   r   r   c                 S   s   t | j||S ru   )r    rQ   r   r:   r:   r;   rX   a  s    z.NumPyRandomGeneratorType_laplace.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r    rQ   r   r:   r:   r;   rX   g  s
    
)r   r   N)r   r   Nr   r   r:   r:   r;    NumPyRandomGeneratorType_laplaceY  s    

r   Zlogisticc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nr   r   r   r   c                 S   s   t | j||S ru   )r!   rQ   r   r:   r:   r;   rX   x  s    z/NumPyRandomGeneratorType_logistic.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r!   rQ   r   r:   r:   r;   rX   ~  s
    
)r   r   N)r   r   Nr   r   r:   r:   r;   !NumPyRandomGeneratorType_logisticp  s    

r   Z	lognormalc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nmeansigmar   r   c                 S   s   t | j||S ru   )r"   rQ   )rS   r   r   r@   r:   r:   r;   rX     s    z0NumPyRandomGeneratorType_lognormal.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r"   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX     s
    
)r   r   N)r   r   Nr   )rS   r   r   r@   rX   r:   r:   r;   "NumPyRandomGeneratorType_lognormal  s    

r   Zrayleighc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j|S ru   )r#   rQ   r   r:   r:   r;   rX     s    z/NumPyRandomGeneratorType_rayleigh.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r#   rQ   r   r:   r:   r;   rX     s
    
)r   N)r   Nr   r   r:   r:   r;   !NumPyRandomGeneratorType_rayleigh  s    

r   Z
standard_tc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S ru   )r$   rQ   r   r:   r:   r;   rX     s    z1NumPyRandomGeneratorType_standard_t.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S ru   )r4   r}   r~   rh   r@   r$   rQ   r   r:   r:   r;   rX     s
    
)N)Nr   r   r:   r:   r;   #NumPyRandomGeneratorType_standard_t  s    

r   Zwaldc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j||S ru   )r%   rQ   )rS   r   r   r@   r:   r:   r;   rX     s    z+NumPyRandomGeneratorType_wald.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S ru   )r4   r}   r~   rh   r@   r%   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX     s
    
)N)Nr   )rS   r   r   r@   rX   r:   r:   r;   NumPyRandomGeneratorType_wald  s    

r   Z	geometricc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Npc                 S   s   t t| j|S ru   )r4   ra   r&   rQ   rS   r   r@   r:   r:   r;   rX     s    z0NumPyRandomGeneratorType_geometric.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S rz   )r4   r}   ra   r~   rh   r@   r&   rQ   rS   r   r@   r   r   rl   r:   r:   r;   rX     s
    )N)Nr   rS   r   r@   rX   r:   r:   r;   "NumPyRandomGeneratorType_geometric  s    

r   Zzipfc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t t| j|S ru   )r4   ra   r'   rQ   r   r:   r:   r;   rX     s    z+NumPyRandomGeneratorType_zipf.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S rz   )r4   r}   ra   r~   rh   r@   r'   rQ   r   r:   r:   r;   rX     s
    )N)Nr   r   r:   r:   r;   NumPyRandomGeneratorType_zipf  s    

r   
triangularc                 C   s   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rZ|j}t	|rpddd}|S t
| ddd}|S d S )	Nleftmoderightc                 S   s   t | j|||S ru   )r(   rQ   )rS   r   r   r   r@   r:   r:   r;   rX     s    z1NumPyRandomGeneratorType_triangular.<locals>.implc                 S   s8   t |}|j}t|jD ]}t| j|||||< q|S ru   )r4   r}   r~   rh   r@   r(   rQ   )rS   r   r   r   r@   r   r   rl   r:   r:   r;   rX     s    
  
)N)Nr   )rS   r   r   r   r@   rX   r:   r:   r;   #NumPyRandomGeneratorType_triangular  s    

r   Zpoissonc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nlamc                 S   s   t t| j|S ru   )r4   ra   r)   rQ   )rS   r   r@   r:   r:   r;   rX   -  s    z.NumPyRandomGeneratorType_poisson.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S rz   )r4   r}   ra   r~   rh   r@   r)   rQ   )rS   r   r@   r   r   rl   r:   r:   r;   rX   3  s
    )N)Nr   )rS   r   r@   rX   r:   r:   r;    NumPyRandomGeneratorType_poisson&  s    

r   Znegative_binomialc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nnr   c                 S   s   t t| j||S ru   )r4   ra   r*   rQ   )rS   r   r   r@   r:   r:   r;   rX   D  s    z8NumPyRandomGeneratorType_negative_binomial.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S rz   )r4   r}   ra   r~   rh   r@   r*   rQ   )rS   r   r   r@   r   r   rl   r:   r:   r;   rX   J  s
    )N)Nr   )rS   r   r   r@   rX   r:   r:   r;   *NumPyRandomGeneratorType_negative_binomial<  s    

r   Znoncentral_chisquarec                    s   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	dd  t
|rhd fdd	}|S t| d	 fdd	}|S d S )
Nr   noncc                 S   s$   | dkrt d|dk r t dd S )Nr   zdf <= 0nonc < 0r\   )r   r   r:   r:   r;   check_arg_boundsZ  s    zGNumPyRandomGeneratorType_noncentral_chisquare.<locals>.check_arg_boundsc                    s    || t t| j||S ru   )r4   r7   r,   rQ   )rS   r   r   r@   r   r:   r;   rX   b  s
    

 z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implc                    sF    || t j|t jd}|j}t|jD ]}t| j||||< q*|S rz   )r4   r}   r7   r~   rh   r@   r,   rQ   )rS   r   r   r@   r   r   rl   r   r:   r;   rX   j  s    
 
)N)NrI   r   r   r>   r[   r   r0   r1   r2   r   r	   rA   )rS   r   r   r@   rX   r:   r   r;   -NumPyRandomGeneratorType_noncentral_chisquareS  s    
r   Znoncentral_fc                    s   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rZ|j}t	dd  t
|rd	 fdd	}|S t| d
 fdd	}|S d S )Nr   r   r   c                 S   s4   | dkrt d|dkr t d|dk r0t dd S )Nr   z
dfnum <= 0z
dfden <= 0r   r   )r   r   r   r:   r:   r;   r   }  s    z?NumPyRandomGeneratorType_noncentral_f.<locals>.check_arg_boundsc                    s"    ||| t t| j|||S ru   )r4   r7   r-   rQ   )rS   r   r   r   r@   r   r:   r;   rX     s    
  z3NumPyRandomGeneratorType_noncentral_f.<locals>.implc                    sJ    ||| t j|t jd}|j}t|jD ]}t| j|||||< q,|S rz   )r4   r}   r7   r~   rh   r@   r-   rQ   )rS   r   r   r   r@   r   r   rl   r   r:   r;   rX     s      
)N)Nr   )rS   r   r   r   r@   rX   r:   r   r;   %NumPyRandomGeneratorType_noncentral_fu  s    
r   Z	logseriesc                    sn   t |tjtjttgd t|tjr*|j}t	dd  t
|rPd fdd	}|S t| d fdd	}|S d S )	Nr   c                 S   s&   | dk s| dkst | r"tdd S )Nr   rO   zp < 0, p >= 1 or p is NaN)r4   isnanr\   )r   r:   r:   r;   r     s    z<NumPyRandomGeneratorType_logseries.<locals>.check_arg_boundsc                    s    | t t| j|S ru   )r4   ra   r+   rQ   r   r   r:   r;   rX     s    z0NumPyRandomGeneratorType_logseries.<locals>.implc                    sB    | t j|t jd}|j}t|jD ]}t| j|||< q(|S rz   )r4   r}   ra   r~   rh   r@   r+   rQ   r   r   r:   r;   rX     s    )N)Nr   r   r:   r   r;   "NumPyRandomGeneratorType_logseries  s    
r   )r/   )r   )r   )r   r   N)r   r   N)r   N)r   N)N)N)N)N)N)N)N)r   r   N)r   r   N)r   r   N)r   N)N)N)N)N)N)N)N)N)N)N)^__doc__numpyr4   Z
numba.corer   Znumba.core.extendingr   r   Znumba.np.numpy_supportr   r   Znumba.np.random.generator_corer   r   r	   Znumba.core.errorsr
   Znumba.core.types.containersr   r   Z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-   Znumba.np.randomr.   r<   rA   rI   ZNumPyRandomGeneratorTypera   rb   rp   rs   r7   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;   <module>   s   


 W



-


  
  




















!
$
