U
    O8c                     @   s8   d dl Zd dlmZmZ d dlmZ dd Zdd ZdS )    N)assert_array_equalassert_array_compare)SeedSequencec            	      C   s|  ddddgddddgd	d
ddgddddgddddgddddgddddgdddd gd!d"d#d$gd%d&d'd(gg
} d)d*d+d,gd-d.d/d0gd1d2d3d4gd5d6d7d8gd9d:d;d<gd=d>d?d@gdAdBdCdDgdEdFdGdHgdIdJdKdLgdMdNdOdPgg
}dQdRgdSdTgdUdVgdWdXgdYdZgd[d\gd]d^gd_d`gdadbgdcddgg
}t | ||D ]Z\}}}tj|tjde}t|}|t|}t|| |jt|tjde}t|| qdfS )gz Check that SeedSequence generates data the same as the C++ reference.

    https://gist.github.com/imneme/540829265469e673d045
    l   >[= iʭiixV4l   AM5 l   lp i1 cl   ^<1 i	l   O!p iF6iiMi(l   NwU i]e+ivp2piv(oifl   FN itil   m l   -
 i i5i^wCl   x{ l   9 l   I6; i|Il   -Ker i|Lirl   gT<> irT"l   oj l   PJ l   bI l   xW l   s-_` idf3l   MR ib"l    n, l   =	 l   u l   8 iKjQl   b< l   S( l   E{| iH5lDl   !bJ< i٦Sl     , ikLi&Wi@l   ;: i>f!l   '4 l   l l   D i2l   z9e l   4 l   Kp` l   a$ i^
i)9l   'tM inpiRpl   2DZ iAl   DI  i~Gi55l   \| ih
 l   ^r l   MR l    n,swM' l   u2R,` l   KZ"Rq	 l   S(iq l   H5+q l   YM'0 l   k=R l   |D l   >BWP l   l]_ l   ek l   4.A l   a${EPl   `SrP7 l   K`EJ+ l   2DZe8N l   DI x;Bl   55T#LsNp l   h
x! ZdtypeN)	zipnparrayuint32r   generate_statelenr   Zuint64)	inputsoutputsZ	outputs64seedexpectedZ
expected64ssstateZstate64 r   I/tmp/pip-unpacked-wheel-fd_gsd75/numpy/random/tests/test_seed_sequence.pytest_reference_data   sP    




















r   c                  C   sv   t d} t d}ttj| d|d tjddddgtjd}tt dd| ttjt dd	d
d| dS )zD Ensure that the implicit zero-padding does not cause problems.
    *   l           l   
 l   m.<> iyl   s* r   )r   )Z	spawn_keyN)r   r   r   	not_equalr
   r   r	   r   )Zss0Zss1Z
expected42r   r   r   test_zero_padding9   s     r   )	Znumpyr   Znumpy.testingr   r   Znumpy.randomr   r   r   r   r   r   r   <module>   s   2