U
    |e                     @   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   float32float64r
   )Zfunc_32Zfunc_64r5   Z	dist_namenp_dtnb_dtZ	next_func r;   ^/var/www/website-v5/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    
rB   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
   )rF   	type_listarg_namer;   rE   r<   check_typesE   s    rL   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instrN   rO   rA   r5   rP   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 )NrS   rT   rV   rY   r;   r<   r\      s    
 )rL   r   r?   Booleanboolintr0   r1   r2   r3   r   r4   r5   r6   r   r
   bool_r.   Zrandom_bounded_bool_filliinfo
ValueErrorgetattrbitsminmaxr	   int64rB   )
rW   rN   rO   rA   r5   rP   r:   _dtypei_infor\   r;   rY   r<   !NumPyRandomGeneratorType_integersV   sd       



  rj   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   rS   z)Axis is out of bounds for the given array)r   .rQ   .)ndim
IndexErrorr4   swapaxes
empty_likerangelenr   intpr.   Zrandom_intervalrU   )rW   rl   rm   zbufijr;   r;   r<   r\      s    
z.NumPyRandomGeneratorType_shuffle.<locals>.impl)r   )rL   r   Arrayr_   r?   rW   rl   rm   r\   r;   r;   r<    NumPyRandomGeneratorType_shuffle   s    
r{   permutationc                    sD   t |tjtjgd t |ttjgd t|tj d fdd	}|S )Nrl   rm   r   c                    s4    rt |}| | n| }| j||d |S )N)rm   )r4   arangerk   copy)rW   rl   rm   new_arrZIS_INTr;   r<   r\      s    
z2NumPyRandomGeneratorType_permutation.<locals>.impl)r   )rL   r   ry   r?   r_   r0   rz   r;   r   r<   $NumPyRandomGeneratorType_permutation   s
    
r   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 )Nr   c                    s    | j S NrU   rW   rA   r5   	dist_funcr:   r;   r<   r\      s    z-NumPyRandomGeneratorType_random.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S Nr5   r4   emptyflatrr   rA   rU   rW   rA   r5   outout_frw   r   r;   r<   r\      s
    )r=   r   r   r0   r   r1   r2   r	   r4   r8   rB   rW   rA   r5   r\   r;   r   r<   NumPyRandomGeneratorType_random   s     r   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')rU   rb   )rW   rA   r5   r   r   dist_func_invr:   r;   r<   r\     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   rr   rA   rU   rb   )rW   rA   r5   r   r   r   rw   )r   r   r;   r<   r\     s    )rL   r   UnicodeTypestrr=   r   r   r   r   r0   r1   r2   r	   r4   r8   rB   )rW   rA   r5   r   r\   r;   r   r<   -NumPyRandomGeneratorType_standard_exponential   s$    r   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 r   r   r   r   r;   r<   r\   /  s    z6NumPyRandomGeneratorType_standard_normal.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S r   r   r   r   r;   r<   r\   5  s
    )r=   r   r   r0   r   r1   r2   r	   r4   r8   rB   r   r;   r   r<   (NumPyRandomGeneratorType_standard_normal&  s    r   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 r   r   )rW   r   rA   r5   r   r;   r<   r\   J  s    z5NumPyRandomGeneratorType_standard_gamma.<locals>.implc                    s8   t j||d}|j}t|jD ]} | j|||< q|S r   r   )rW   r   rA   r5   r   r   rw   r   r;   r<   r\   P  s
    )rL   r   Floatr?   r_   floatr=   r   r   r0   r1   r2   r	   r4   r8   rB   )rW   r   rA   r5   r\   r;   r   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 r   )r   rU   rW   r   r   rA   r;   r;   r<   r\   c  s    z-NumPyRandomGeneratorType_normal.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r   )r4   r   r8   r   rr   rA   r   rU   rW   r   r   rA   r   r   rw   r;   r;   r<   r\   i  s
    )r   r   N)r   r   NrL   r   r   r?   r_   r   r0   r1   r2   r	   rB   rW   r   r   rA   r\   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 )
NrN   rO   r   r   c                 S   s   t | j||| S r   )r   rU   )rW   rN   rO   rA   r;   r;   r<   r\   |  s    z.NumPyRandomGeneratorType_uniform.<locals>.implc                 S   s@   t j|t jd}|j}t|jD ]}t| j||| ||< q |S r   )r4   r   r8   r   rr   rA   r   rU   )rW   rN   rO   rA   r   r   rw   r;   r;   r<   r\     s
    )r   r   N)r   r   Nr   )rW   rN   rO   rA   r\   r;   r;   r<    NumPyRandomGeneratorType_uniforms  s    

r   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 r   )r   rU   rW   r   rA   r;   r;   r<   r\     s    z2NumPyRandomGeneratorType_exponential.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r   )r4   r   r8   r   rr   rA   r   rU   rW   r   rA   r   r   rw   r;   r;   r<   r\     s
    )r   N)r   Nr   rW   r   rA   r\   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 r   )r   rU   )rW   r   r   rA   r;   r;   r<   r\     s    z,NumPyRandomGeneratorType_gamma.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r   )r4   r   r8   r   rr   rA   r   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\     s
    )r   N)r   Nr   )rW   r   r   rA   r\   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 r   )r   rU   )rW   r   r   rA   r;   r;   r<   r\     s    z+NumPyRandomGeneratorType_beta.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\     s
    
)N)Nr   )rW   r   r   rA   r\   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 r   )r   rU   )rW   r   r   rA   r;   r;   r<   r\     s    z(NumPyRandomGeneratorType_f.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\     s
    
)N)Nr   )rW   r   r   rA   r\   r;   r;   r<   NumPyRandomGeneratorType_f  s    

r   	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 r   )r   rU   rW   r   rA   r;   r;   r<   r\     s    z0NumPyRandomGeneratorType_chisquare.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r   rU   rW   r   rA   r   r   rw   r;   r;   r<   r\     s
    
)N)Nr   rW   r   rA   r\   r;   r;   r<   "NumPyRandomGeneratorType_chisquare  s    

r   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 r   )r   rU   )rW   rA   r;   r;   r<   r\     s    z6NumPyRandomGeneratorType_standard_cauchy.<locals>.implc                 S   s2   t |}|j}t|jD ]}t| j||< q|S r   )r4   r   r   rr   rA   r   rU   )rW   rA   r   r   rw   r;   r;   r<   r\     s
    
)N)N)r0   r   r1   r2   r	   rB   )rW   rA   r\   r;   r;   r<   (NumPyRandomGeneratorType_standard_cauchy  s    

r   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 r   )r   rU   rW   r   rA   r;   r;   r<   r\     s    z-NumPyRandomGeneratorType_pareto.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r   rU   rW   r   rA   r   r   rw   r;   r;   r<   r\   $  s
    
)N)Nr   rW   r   rA   r\   r;   r;   r<   NumPyRandomGeneratorType_pareto  s    

r   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 r   )r   rU   r   r;   r;   r<   r\   4  s    z.NumPyRandomGeneratorType_weibull.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r   rU   r   r;   r;   r<   r\   :  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 r   )r   rU   r   r;   r;   r<   r\   J  s    z,NumPyRandomGeneratorType_power.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r   rU   r   r;   r;   r<   r\   P  s
    
)N)Nr   r   r;   r;   r<   NumPyRandomGeneratorType_powerC  s    

r   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 r   )r    rU   r   r;   r;   r<   r\   a  s    z.NumPyRandomGeneratorType_laplace.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r    rU   r   r;   r;   r<   r\   g  s
    
)r   r   N)r   r   Nr   r   r;   r;   r<    NumPyRandomGeneratorType_laplaceY  s    

r   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 r   )r!   rU   r   r;   r;   r<   r\   x  s    z/NumPyRandomGeneratorType_logistic.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r!   rU   r   r;   r;   r<   r\   ~  s
    
)r   r   N)r   r   Nr   r   r;   r;   r<   !NumPyRandomGeneratorType_logisticp  s    

r   	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 r   )r"   rU   )rW   r   r   rA   r;   r;   r<   r\     s    z0NumPyRandomGeneratorType_lognormal.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r"   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\     s
    
)r   r   N)r   r   Nr   )rW   r   r   rA   r\   r;   r;   r<   "NumPyRandomGeneratorType_lognormal  s    

r   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 r   )r#   rU   r   r;   r;   r<   r\     s    z/NumPyRandomGeneratorType_rayleigh.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r#   rU   r   r;   r;   r<   r\     s
    
)r   N)r   Nr   r   r;   r;   r<   !NumPyRandomGeneratorType_rayleigh  s    

r   
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 r   )r$   rU   r   r;   r;   r<   r\     s    z1NumPyRandomGeneratorType_standard_t.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S r   )r4   r   r   rr   rA   r$   rU   r   r;   r;   r<   r\     s
    
)N)Nr   r   r;   r;   r<   #NumPyRandomGeneratorType_standard_t  s    

r   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 r   )r%   rU   )rW   r   r   rA   r;   r;   r<   r\     s    z+NumPyRandomGeneratorType_wald.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S r   )r4   r   r   rr   rA   r%   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\     s
    
)N)Nr   )rW   r   r   rA   r\   r;   r;   r<   NumPyRandomGeneratorType_wald  s    

r   	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 r   )r4   rg   r&   rU   rW   r   rA   r;   r;   r<   r\     s    z0NumPyRandomGeneratorType_geometric.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r   )r4   r   rg   r   rr   rA   r&   rU   rW   r   rA   r   r   rw   r;   r;   r<   r\     s
    )N)Nr   rW   r   rA   r\   r;   r;   r<   "NumPyRandomGeneratorType_geometric  s    

r   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 r   )r4   rg   r'   rU   r   r;   r;   r<   r\     s    z+NumPyRandomGeneratorType_zipf.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r   )r4   r   rg   r   rr   rA   r'   rU   r   r;   r;   r<   r\     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 r   )r(   rU   )rW   r   r   r   rA   r;   r;   r<   r\     s    z1NumPyRandomGeneratorType_triangular.<locals>.implc                 S   s8   t |}|j}t|jD ]}t| j|||||< q|S r   )r4   r   r   rr   rA   r(   rU   )rW   r   r   r   rA   r   r   rw   r;   r;   r<   r\     s    
  
)N)Nr   )rW   r   r   r   rA   r\   r;   r;   r<   #NumPyRandomGeneratorType_triangular  s    

r   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 r   )r4   rg   r)   rU   )rW   r   rA   r;   r;   r<   r\   -  s    z.NumPyRandomGeneratorType_poisson.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r   )r4   r   rg   r   rr   rA   r)   rU   )rW   r   rA   r   r   rw   r;   r;   r<   r\   3  s
    )N)Nr   )rW   r   rA   r\   r;   r;   r<    NumPyRandomGeneratorType_poisson&  s    

r   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 r   )r4   rg   r*   rU   )rW   r   r   rA   r;   r;   r<   r\   D  s    z8NumPyRandomGeneratorType_negative_binomial.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r   )r4   r   rg   r   rr   rA   r*   rU   )rW   r   r   rA   r   r   rw   r;   r;   r<   r\   J  s
    )N)Nr   )rW   r   r   rA   r\   r;   r;   r<   *NumPyRandomGeneratorType_negative_binomial<  s    

r   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rb   )r   r   r;   r;   r<   check_arg_boundsZ  s    zGNumPyRandomGeneratorType_noncentral_chisquare.<locals>.check_arg_boundsc                    s    || t t| j||S r   )r4   r8   r,   rU   )rW   r   r   rA   r   r;   r<   r\   b  s
    

 z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implc                    sF    || t j|t jd}|j}t|jD ]}t| j||||< q*|S r   )r4   r   r8   r   rr   rA   r,   rU   )rW   r   r   rA   r   r   rw   r   r;   r<   r\   j  s    
 
)N)NrL   r   r   r?   r_   r   r0   r1   r2   r   r	   rB   )rW   r   r   rA   r\   r;   r   r<   -NumPyRandomGeneratorType_noncentral_chisquareS  s    
r   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 r   )r4   r8   r-   rU   )rW   r   r   r   rA   r   r;   r<   r\     s    
  z3NumPyRandomGeneratorType_noncentral_f.<locals>.implc                    sJ    ||| t j|t jd}|j}t|jD ]}t| j|||||< q,|S r   )r4   r   r8   r   rr   rA   r-   rU   )rW   r   r   r   rA   r   r   rw   r   r;   r<   r\     s      
)N)Nr   )rW   r   r   r   rA   r\   r;   r   r<   %NumPyRandomGeneratorType_noncentral_fu  s    
r   	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   rS   zp < 0, p >= 1 or p is NaN)r4   isnanrb   )r   r;   r;   r<   r     s    z<NumPyRandomGeneratorType_logseries.<locals>.check_arg_boundsc                    s    | t t| j|S r   )r4   rg   r+   rU   r   r   r;   r<   r\     s    z0NumPyRandomGeneratorType_logseries.<locals>.implc                    sB    | t j|t jd}|j}t|jD ]}t| j|||< q(|S r   )r4   r   rg   r   rr   rA   r+   rU   r   r   r;   r<   r\     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   
numba.corer   numba.core.extendingr   r   numba.np.numpy_supportr   r   Znumba.np.random.generator_corer   r   r	   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-   numba.np.randomr.   r=   rB   rL   NumPyRandomGeneratorTyperg   rj   r{   r   r8   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



-


  
  




















!
$
