+
    ,i_                     V   ^ RI HtHt ^ RIt^ RIt^ RIHtHt ^ RI	t	^ RI	H
t ^ RIHtHtHtHtHtHtHtHt ]P*                  ! ]! ]! ]4      R4      4      t]! ^4       U u. uF  p ]RV  2,          NK  	  up t]! ^4       U u. uF  p ]RV  2,          NK  	  up t]P*                  ! ]! ]! ]4      R	4      4      t]P*                  ! ]! ]! ]4      R
4      4      t]R,          tR tR tR t R t!R t"R t#RR lt$RR lt%RR lt&RR lt' ! R R4      t( ! R R4      t) ! R R])4      t* ! R R])4      t+ ! R R])4      t, ! R  R!])4      t- ! R" R#]*4      t. ! R$ R%]*4      t/ ! R& R']*4      t0 ! R( R)]+4      t1 ! R* R+]+4      t2 ! R, R-]+4      t3 ! R. R/],4      t4 ! R0 R1],4      t5 ! R2 R3],4      t6 ! R4 R5]-4      t7 ! R6 R7]-4      t8 ! R8 R9]-4      t9 ! R: R;4      t: ! R< R=]:4      t; ! R> R?]:4      t< ! R@ RA]:4      t= ! RB RC]:4      t> ! RD RE]:4      t? ! RF RG]:4      t@ ! RH RI]:4      tA ! RJ RK]:4      tB ! RL RM]:4      tC ! RN RO]:4      tD ! RP RQ]:4      tE ! RR RS]:4      tF ! RT RU4      tG ! RV RW]G4      tH ! RX RY]G4      tI ! RZ R[]H4      tJ ! R\ R]]H4      tK ! R^ R_]H4      tL ! R` Ra]G4      tM ! Rb Rc]G4      tN ! Rd Re]G4      tO ! Rf Rg]G4      tP ! Rh Ri]G4      tQ ! Rj Rk]G4      tR ! Rl Rm]I4      tS ! Rn Ro]I4      tT ! Rp Rq]I4      tU ! Rr Rs4      tV ! Rt Ru]V4      tW ! Rv Rw]V4      tX ! Rx Ry]V4      tY ! Rz R{]V4      tZ ! R| R}]V4      t[ ! R~ R]V4      t\ ! R R]V4      t] ! R R]V4      t^ ! R R]V4      t_ ! R R]V4      t` ! R R]V4      ta ! R R]V4      tb ! R R4      tc ! R R4      tdR# u up i u up i )    )joindirnameN)assert_array_almost_equalassert_equal)raises)dctidctdstidstdctnidctndstnidstnztest.npzxyzfftw_double_ref.npzzfftw_single_ref.npzsizesc                 p   \         P                  ! ^ V^,
          V4      P                  V4      p\         P                  ! \         P                  V4      pV\         P
                  8X  d   \        pM&V\         P                  8X  d   \        pM
\        4       hVRV  RV 2,          P                  V4      pW5V3# )r   dct__	nplinspaceastyperesult_typefloat32float64FFTWDATA_DOUBLEFFTWDATA_SINGLE
ValueErrortypesizedtr   datar   s   &&&   J/usr/lib/python3/dist-packages/scipy/fftpack/tests/test_real_transforms.pyfftw_dct_refr&          
AtAvt$++B/A	

B	'B	RZZ	rzz	l	TF!D6"	#++B/A8O    c                 p   \         P                  ! ^ V^,
          V4      P                  V4      p\         P                  ! \         P                  V4      pV\         P
                  8X  d   \        pM&V\         P                  8X  d   \        pM
\        4       hVRV  RV 2,          P                  V4      pW5V3# )r   dst_r   r   r    s   &&&   r%   fftw_dst_refr+   (   r'   r(   c                &   \         P                  ! V RR7      p \        V P                  ^ ,          4       F  p\	        WR3,          3/ VB WR3&   K  	  \        V P                  ^,          4       F  p\	        V RV3,          3/ VB V RV3&   K  	  V # )z,Calculate reference values for testing dct2.TcopyNNN)r   arrayrangeshaper   r   kwargsrowcols   &,  r%   
dct_2d_refr7   5       
AQWWQZ q&	,V,q&	 !QWWQZ !S&	,V,!S&	 !Hr(   c                &   \         P                  ! V RR7      p \        V P                  ^ ,          4       F  p\	        WR3,          3/ VB WR3&   K  	  \        V P                  ^,          4       F  p\	        V RV3,          3/ VB V RV3&   K  	  V # )z-Calculate reference values for testing idct2.Tr-   r/   )r   r0   r1   r2   r	   r3   s   &,  r%   idct_2d_refr:   ?       
AQWWQZ 6-f-q&	 !QWWQZ 1c6-f-!S&	 !Hr(   c                &   \         P                  ! V RR7      p \        V P                  ^ ,          4       F  p\	        WR3,          3/ VB WR3&   K  	  \        V P                  ^,          4       F  p\	        V RV3,          3/ VB V RV3&   K  	  V # )z,Calculate reference values for testing dst2.Tr-   r/   )r   r0   r1   r2   r
   r3   s   &,  r%   
dst_2d_refr=   I   r8   r(   c                &   \         P                  ! V RR7      p \        V P                  ^ ,          4       F  p\	        WR3,          3/ VB WR3&   K  	  \        V P                  ^,          4       F  p\	        V RV3,          3/ VB V RV3&   K  	  V # )z-Calculate reference values for testing idst2.Tr-   r/   )r   r0   r1   r2   r   r3   s   &,  r%   idst_2d_refr?   S   r;   r(   c           
        \         P                  ! V RR7      p \        V 4      pV^,
          p\         P                  ! V4      p^^reVR8X  d;   \         P                  ! RV,          4      p\         P                  ! RV,          4      p\        V4       F  p\        ^V^,
          4       Fb  pWG;;,          W`V,          ,          \         P                  ! \         P                  V,          V,          V,          4      ,          ,          uu&   Kd  	  WG;;,          WP^ ,          ,          ,          uu&   YG;;,          WPV^,
          ,          ,          V^,          ^ 8X  d   ^MR,          ,          uu&   K  	  VR8X  dg   V^ ;;,          ^\         P                  ! ^4      ,          ,          uu&   WB^,
          ;;,          ^\         P                  ! ^4      ,          ,          uu&   V# )z/Calculate textbook definition version of DCT-I.Tr-   ortho      ?       @)r   r0   lenzerossqrtr1   cospi)	r   normNMr   m0mkns	   &&       r%   
naive_dct1rQ   ]   s0   
AAA	!A
AqwWWSU^GGCEN1Xq!A#ADAdF266"%%'!)A+...D 	qT		qsVAEQJqB77	 
 w	!"''!*	A#!BGGAJ,Hr(   c                   \         P                  ! V RR7      p \        V 4      pV^,           p\         P                  ! V4      p\	        V4       F  p\	        V4       Fp  pWE;;,          ^W,          ,          \         P
                  ! \         P                  VR,           ,          VR,           ,          V,          4      ,          ,          uu&   Kr  	  K  	  VR8X  d%   V\         P                  ! RV,          4      ,          pV# )z0Calculate textbook definition version  of DST-I.Tr-   rB   rA         ?r   r0   rE   rF   r1   sinrI   rG   )r   rJ   rK   rL   r   rO   rP   s   &&     r%   
naive_dst1rV   r   s    
AAA	!A
A1XqADAadF266"%%3-3"7"9:::D   w	RWWSU^Hr(   c                   \         P                  ! V RR7      p \        V 4      p\         P                  ! V4      p\	        V4       F{  p\	        V4       Fi  pW4;;,          W,          \         P
                  ! \         P                  VR,           ,          VR,           ,          V,          4      ,          ,          uu&   Kk  	  K}  	  VR8X  d'   V\         P                  ! RV,          4      ,          pV# V^,          pV# )z0Calculate textbook definition version of DCT-IV.Tr-   rS   rA   rC   )r   r0   rE   rF   r1   rH   rI   rG   r   rJ   rK   r   rO   rP   s   &&    r%   
naive_dct4rY          
AAA
A1XqADADququ 5q 9:::D   w	RWWSU^ H 	
QHr(   c                   \         P                  ! V RR7      p \        V 4      p\         P                  ! V4      p\	        V4       F{  p\	        V4       Fi  pW4;;,          W,          \         P
                  ! \         P                  VR,           ,          VR,           ,          V,          4      ,          ,          uu&   Kk  	  K}  	  VR8X  d'   V\         P                  ! RV,          4      ,          pV# V^,          pV# )z0Calculate textbook definition version of DST-IV.Tr-   rS   rA   rC   rT   rX   s   &&    r%   
naive_dst4r\      rZ   r(   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	TestComplexc                    \        R \        P                  ! ^\        P                  R7      ,          4      pR \        \        P                  ! ^4      4      ,          p\	        W!4       R# )              ?dtypeN)r   r   arange	complex64r   selfr   r   s   &  r%   test_dct_complex64TestComplex.test_dct_complex64   s?    299Qbll334s299Q<  !!'r(   c                    \        \        P                  ! ^4      R,          4      pR\        \        P                  ! ^4      4      ,          p\        W!4       R#    r`   N)r   r   rc   r   re   s   &  r%   test_dct_complexTestComplex.test_dct_complex   7    		!R s299Q<  !!'r(   c                    \        \        P                  ! ^4      R,          4      pR\        \        P                  ! ^4      4      ,          p\        W!4       R# rj   )r	   r   rc   r   re   s   &  r%   test_idct_complexTestComplex.test_idct_complex   7    1b!tBIIaL!!!!'r(   c                    \        \        P                  ! ^\        P                  R7      R,          4      pR\        \        P                  ! ^4      4      ,          p\	        W!4       R# )rk   ra   r`   N)r
   r   rc   rd   r   re   s   &  r%   test_dst_complex64TestComplex.test_dst_complex64   s?    		!2<<034s299Q<  !!'r(   c                    \        \        P                  ! ^4      R,          4      pR\        \        P                  ! ^4      4      ,          p\        W!4       R# rj   )r
   r   rc   r   re   s   &  r%   test_dst_complexTestComplex.test_dst_complex   rn   r(   c                    \        \        P                  ! ^4      R,          4      pR\        \        P                  ! ^4      4      ,          p\        W!4       R# rj   )r   r   rc   r   re   s   &  r%   test_idst_complexTestComplex.test_idst_complex   rr   r(    N)__name__
__module____qualname____firstlineno__rg   rl   rp   rt   rw   rz   __static_attributes____classdictcell____classdict__s   @r%   r^   r^      s(     (
(
(
(
(
( (r(   r^   c                   V   a  ] tR t^t o R t]P                  R 4       tR tR t	Rt
V tR# )_TestDCTBasec                0    R V n         ^V n        R V n        R # Nrdtdecr!   rf   s   &r%   setup_method_TestDCTBase.setup_method       	r(   c                ,    \         P                  ! 4       # r   	threadingLockr   s   &r%   dct_lock_TestDCTBase.dct_lock       ~~r(   c           	        \          F  pV;_uu_ 4        \        V P                  W P                  4      w  r4pR R R 4       \	        XV P                  R7      p\        VP                  X4       \        V\        P                  ! V4      ,          X\        P                  ! V4      ,          V P                  RV R2R7       K  	  R #   + '       g   i     L; iNr!   zSize z failed)decimalerr_msg)FFTWDATA_SIZESr&   r!   r   r   r   rb   r   r   maxr   )rf   r   ir   yrr#   r   s   &&     r%   test_definition_TestDCTBase.test_definition   s    A(Axx@	r ADII&A"%
 &a"&&)mR"&&)^TXX#A3g.0     $CCc           
     (   ^p\         P                  P                  R4      pR F  pVP                  W4      p\	        W@P
                  R7      p\        V4       F<  p\        WV,          \	        WF,          V P
                  R7      V P                  R7       K>  	  VP                  p\	        V^ V P
                  R7      p\        V4       FB  p\        VRV3,          \	        VRV3,          V P
                  R7      V P                  R7       KD  	  K  	  R# )     r   r   )axisr!   r/   N)      	          @   )
r   randomRandomStaterandnr   r!   r1   r   r   T)rf   ntrngr   r   r   js   &      r%   	test_axis_TestDCTBase.test_axis   s    ii##D)&A		" AAII&A2Y)!$ADtyy0I $*  AAADII.A2Y)!AaC&#a!f4992M $*  'r(   r   r   r!   N)r}   r~   r   r   r   pytestfixturer   r   r   r   r   r   s   @r%   r   r      s1     
 ^^   0* *r(   r   c                   &   a  ] tR t^t o R tRtV tR# )_TestDCTIBasec                   \         P                  ! \         P                  V P                  4      p\         F  p\         P
                  ! W P                  R 7      p\        VR^R7      p\        VRR7      p\        VP                  V4       \        V\         P                  ! V4      ,          V\         P                  ! V4      ,          V P                  R7       K  	  R# ra   rA   rJ   r!   )rJ   r   N)r   r   r   r   Xr0   r   rQ   r   rb   r   r   r   rf   r#   xrr   r   y2s   &     r%   test_definition_ortho#_TestDCTIBase.test_definition_ortho       ^^BJJ1B88,AAG!,AAG,B"%%a"&&)mR"&&)^TXXV r(   r|   Nr}   r~   r   r   r   r   r   r   s   @r%   r   r           W Wr(   r   c                   &   a  ] tR t^t o R tRtV tR# )_TestDCTIIBasec                B   \         P                  ! \         P                  V P                  4      p\	        \
        \        4       FW  w  r#\         P                  ! W!R 7      p\        VR^R7      p\        VP                  V4       \        WSV P                  R7       KY  	  R# ra   rA   r   r   N)r   r   r   r   zipr   Yr0   r   r   rb   r   r   )rf   r#   r   r   r   r   s   &     r%   test_definition_matlab%_TestDCTIIBase.test_definition_matlab   sd    ^^BJJ1!QiFB&AAG!,A"%%aTXX>	  r(   r|   N)r}   r~   r   r   r   r   r   r   s   @r%   r   r      s     ? ?r(   r   c                   &   a  ] tR t^t o R tRtV tR# )_TestDCTIIIBasec                R   \         P                  ! \         P                  V P                  4      p\         Fm  p\         P
                  ! W P                  R 7      p\        VR^R7      p\        VR^R7      p\        VP                  V4       \        WSV P                  R7       Ko  	  R# r   )r   r   r   r   r   r0   r   r   rb   r   r   )rf   r#   r   r   r   xis   &     r%   r   %_TestDCTIIIBase.test_definition_ortho   sn    ^^BJJ1B88,AAG!,AQW1-B2&%bTXX> r(   r|   Nr   r   s   @r%   r   r           ? ?r(   r   c                   &   a  ] tR tRt o R tRtV tR# )_TestDCTIVBasei  c                   \         P                  ! \         P                  V P                  4      p\         F  p\         P
                  ! W P                  R 7      p\        VR^R7      p\        VRR7      p\        VP                  V4       \        V\         P                  ! V4      ,          V\         P                  ! V4      ,          V P                  R7       K  	  R# r   )r   r   r   r   r   r0   r   rY   r   rb   r   r   r   r   s   &     r%   r   $_TestDCTIVBase.test_definition_ortho  r   r(   r|   Nr   r   s   @r%   r   r     r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIDoublei  c                L    \         P                  V n        ^
V n        ^V n        R# 
   Nr   r   r   r   r!   r   s   &r%   r   TestDCTIDouble.setup_method      ::	r(   r   Nr}   r~   r   r   r   r   r   r   s   @r%   r   r           r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIFloati  c                L    \         P                  V n        ^V n        ^V n        R#    Nr   r   r   r   r!   r   s   &r%   r   TestDCTIFloat.setup_method      ::	r(   r   Nr   r   s   @r%   r   r     r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIInti!  c                8    \         V n        ^V n        ^V n        R# rk   Nintr   r   r!   r   s   &r%   r   TestDCTIInt.setup_method"      	r(   r   Nr   r   s   @r%   r   r   !  r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIDoublei(  c                L    \         P                  V n        ^
V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIIDouble.setup_method)  r   r(   r   Nr   r   s   @r%   r   r   (  r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIFloati/  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIIFloat.setup_method0  r   r(   r   Nr   r   s   @r%   r   r   /  r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIInti6  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIIInt.setup_method7  r   r(   r   Nr   r   s   @r%   r   r   6  r   r(   r   c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIIDoublei=  c                L    \         P                  V n        ^V n        ^V n        R#    Nr   r   s   &r%   r   TestDCTIIIDouble.setup_method>  r   r(   r   Nr   r   s   @r%   r  r  =  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIIFloatiD  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIIIFloat.setup_methodE  r   r(   r   Nr   r   s   @r%   r  r  D  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIIIIntiK  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIIIInt.setup_methodL  r   r(   r   Nr   r   s   @r%   r  r  K  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIVDoubleiR  c                L    \         P                  V n        ^V n        ^V n        R#    Nr   r   s   &r%   r   TestDCTIVDouble.setup_methodS  r   r(   r   Nr   r   s   @r%   r  r  R  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIVFloatiY  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIVFloat.setup_methodZ  r   r(   r   Nr   r   s   @r%   r  r  Y  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDCTIVInti`  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDCTIVInt.setup_methoda  r   r(   r   Nr   r   s   @r%   r  r  `  r   r(   r  c                   P   a  ] tR tRt o R t]P                  R 4       tR tRt	V t
R# )_TestIDCTBaseig  c                0    R V n         ^V n        R V n        R # r   r   r   s   &r%   r   _TestIDCTBase.setup_methodh  r   r(   c                ,    \         P                  ! 4       # r   r   r   s   &r%   	idct_lock_TestIDCTBase.idct_lockm  r   r(   c           	     $   \          F  pV;_uu_ 4        \        V P                  W P                  4      w  r4pR R R 4       \	        XV P                  R7      pV P                  ^8X  d   V^V^,
          ,          ,          pMV^V,          ,          p\        VP                  X4       \        V\        P                  ! V4      ,          X\        P                  ! V4      ,          V P                  RV R2R7       K  	  R #   + '       g   i     L; ir   )r   r&   r!   r   r	   r   rb   r   r   r   r   )rf   r!  r   r   r   r#   r   s   &&     r%   r   _TestIDCTBase.test_definitionq      A)$))QA
 Rdii(AyyA~Q!A#YQU
"%
 &a"&&)mR"&&)^TXX#A3g.0     $C??Dr   N)r}   r~   r   r   r   r   r   r!  r   r   r   r   s   @r%   r  r  g  ,     
 ^^   0 0r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIDoublei  c                L    \         P                  V n        ^
V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIDouble.setup_method  r   r(   r   Nr   r   s   @r%   r)  r)    r   r(   r)  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIFloati  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIFloat.setup_method  r   r(   r   Nr   r   s   @r%   r-  r-    r   r(   r-  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIInt.setup_method  r   r(   r   Nr   r   s   @r%   r1  r1    r   r(   r1  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIDoublei  c                L    \         P                  V n        ^
V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIIDouble.setup_method  r   r(   r   Nr   r   s   @r%   r5  r5    r   r(   r5  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIFloati  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIIFloat.setup_method  r   r(   r   Nr   r   s   @r%   r9  r9    r   r(   r9  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIIInt.setup_method  r   r(   r   Nr   r   s   @r%   r=  r=    r   r(   r=  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIIDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDCTIIIDouble.setup_method  r   r(   r   Nr   r   s   @r%   rA  rA    r   r(   rA  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIIFloati  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIIIFloat.setup_method  r   r(   r   Nr   r   s   @r%   rE  rE    r   r(   rE  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIIIInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIIIInt.setup_method  r   r(   r   Nr   r   s   @r%   rI  rI    r   r(   rI  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIVDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDCTIVDouble.setup_method  r   r(   r   Nr   r   s   @r%   rM  rM    r   r(   rM  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIVFloati  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIVFloat.setup_method  r   r(   r   Nr   r   s   @r%   rQ  rQ    r   r(   rQ  c                   &   a  ] tR tRt o R tRtV tR# )TestIDCTIVInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDCTIVInt.setup_method  r   r(   r   Nr   r   s   @r%   rU  rU    r   r(   rU  c                   P   a  ] tR tRt o R t]P                  R 4       tR tRt	V t
R# )_TestDSTBasei  c                0    R V n         R V n        R V n        R # r   r   r   s   &r%   r   _TestDSTBase.setup_method      	r(   c                ,    \         P                  ! 4       # r   r   r   s   &r%   dst_lock_TestDSTBase.dst_lock  r   r(   c           	        \          F  pV;_uu_ 4        \        V P                  W P                  4      w  r4pR R R 4       \	        XV P                  R7      p\        VP                  X4       \        V\        P                  ! V4      ,          X\        P                  ! V4      ,          V P                  RV R2R7       K  	  R #   + '       g   i     L; ir   )r   r+   r!   r   r
   r   rb   r   r   r   r   )rf   r^  r   r   r   r#   r   s   &&     r%   r   _TestDSTBase.test_definition  s    A)$))QA
 BTYY'A"%
 &a"&&)mR"&&)^TXX#A3g.0  r   r   N)r}   r~   r   r   r   r   r   r^  r   r   r   r   s   @r%   rY  rY    s,     
 ^^   0 0r(   rY  c                   &   a  ] tR tRt o R tRtV tR# )_TestDSTIBasei  c                   \         P                  ! \         P                  V P                  4      p\         F  p\         P
                  ! W P                  R 7      p\        VR^R7      p\        VRR7      p\        VP                  V4       \        V\         P                  ! V4      ,          V\         P                  ! V4      ,          V P                  R7       K  	  R# r   )r   r   r   r   r   r0   r
   rV   r   rb   r   r   r   r   s   &     r%   r   #_TestDSTIBase.test_definition_ortho  r   r(   r|   Nr   r   s   @r%   rc  rc    r   r(   rc  c                   &   a  ] tR tRt o R tRtV tR# )_TestDSTIVBasei  c                P   \         P                  ! \         P                  V P                  4      p\         Fl  p\         P
                  ! W P                  R 7      p\        VR^R7      p\        VRR7      p\        VP                  V4       \        WEV P                  R7       Kn  	  R# r   )r   r   r   r   r   r0   r
   r\   r   rb   r   r   r   s   &     r%   r   $_TestDSTIVBase.test_definition_ortho  sl    ^^BJJ1B88,AAG!,AAG,B"%%aTXX> r(   r|   Nr   r   s   @r%   rg  rg    r   r(   rg  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestDSTIDouble.setup_method  r   r(   r   Nr   r   s   @r%   rk  rk    r   r(   rk  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIFloati	  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDSTIFloat.setup_method
  r   r(   r   Nr   r   s   @r%   ro  ro  	  r   r(   ro  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDSTIInt.setup_method  r   r(   r   Nr   r   s   @r%   rs  rs    r   r(   rs  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestDSTIIDouble.setup_method  r   r(   r   Nr   r   s   @r%   rw  rw    r   r(   rw  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIFloati  c                L    \         P                  V n        ^V n        ^V n        R#    Nr   r   s   &r%   r   TestDSTIIFloat.setup_method  r   r(   r   Nr   r   s   @r%   r{  r{    r   r(   r{  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIInti%  c                8    \         V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestDSTIIInt.setup_method&  r   r(   r   Nr   r   s   @r%   r  r  %  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIIDoublei,  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestDSTIIIDouble.setup_method-  r   r(   r   Nr   r   s   @r%   r  r  ,  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIIFloati3  c                L    \         P                  V n        ^V n        ^V n        R# r   Nr   r   s   &r%   r   TestDSTIIIFloat.setup_method4  r   r(   r   Nr   r   s   @r%   r  r  3  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIIIInti:  c                8    \         V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestDSTIIIInt.setup_method;  r   r(   r   Nr   r   s   @r%   r  r  :  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIVDoubleiA  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestDSTIVDouble.setup_methodB  r   r(   r   Nr   r   s   @r%   r  r  A  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIVFloatiH  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDSTIVFloat.setup_methodI  r   r(   r   Nr   r   s   @r%   r  r  H  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestDSTIVIntiO  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestDSTIVInt.setup_methodP  r   r(   r   Nr   r   s   @r%   r  r  O  r   r(   r  c                   P   a  ] tR tRt o R t]P                  R 4       tR tRt	V t
R# )_TestIDSTBaseiV  c                0    R V n         R V n        R V n        R # r   r   r   s   &r%   r   _TestIDSTBase.setup_methodW  r\  r(   c                ,    \         P                  ! 4       # r   r   r   s   &r%   	idst_lock_TestIDSTBase.idst_lock\  r   r(   c           	     $   \          F  pV;_uu_ 4        \        V P                  W P                  4      w  r4pR R R 4       \	        XV P                  R7      pV P                  ^8X  d   V^V^,           ,          ,          pMV^V,          ,          p\        VP                  X4       \        V\        P                  ! V4      ,          X\        P                  ! V4      ,          V P                  RV R2R7       K  	  R #   + '       g   i     L; ir   )r   r+   r!   r   r   r   rb   r   r   r   r   )rf   r  r   r   r   r#   r   s   &&     r%   r   _TestIDSTBase.test_definition`  r%  r&  r   N)r}   r~   r   r   r   r   r   r  r   r   r   r   s   @r%   r  r  V  r'  r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIDoubleir  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDSTIDouble.setup_methods  r   r(   r   Nr   r   s   @r%   r  r  r  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIFloatiy  c                L    \         P                  V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDSTIFloat.setup_methodz  r   r(   r   Nr   r   s   @r%   r  r  y  r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIInti  c                8    \         V n        ^V n        ^V n        R# r   r   r   s   &r%   r   TestIDSTIInt.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDSTIIDouble.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIFloati  c                L    \         P                  V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIIFloat.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIInti  c                8    \         V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIIInt.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIIDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDSTIIIDouble.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIIFloati  c                L    \         P                  V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIIIFloat.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIIIInti  c                8    \         V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIIIInt.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIVDoublei  c                L    \         P                  V n        ^V n        ^V n        R# r  r   r   s   &r%   r   TestIDSTIVDouble.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIVFloati  c                L    \         P                  V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIVFloat.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   &   a  ] tR tRt o R tRtV tR# )TestIDSTIVnti  c                8    \         V n        ^V n        ^V n        R# r}  r   r   s   &r%   r   TestIDSTIVnt.setup_method  r   r(   r   Nr   r   s   @r%   r  r    r   r(   r  c                   x   a  ] tR tRt o Rt]P                  ]P                  .tR t	R t
R tR tR tR tR	tV tR
# )TestOverwritei  zCheck input overwrite behavior.c                    VP                  4       p	V! WWEWgR 7       VP                   RVP                   VP                  : RV: RV: RV: R2p
V'       g   \	        WRV
 2R7       R# R# )	)overwrite_x(z, z, axis=z, overwrite_x=)zspurious overwrite in )r   N)r.   r}   rb   r2   r   )rf   r   routiner!   fftsizer   rJ   r  kwx2sigs   &&&&&&&&,  r%   _checkTestOverwrite._check  sq    VVX'G""#1QWWIagg[7+ Fhn[O1>*@(FG r(   c                   \         P                  P                  R 4      p\         P                  ! V\         P                  4      '       d.   VP
                  ! V!  RVP
                  ! V!  ,          ,           pMVP
                  ! V!  pVP                  V4      pR F*  pR F!  pR F  p	V P                  WaVRWIV4       K  	  K#  	  K,  	  R# )r   r`   N   r      r   )TF)NrA   )r   r   r   
issubdtypecomplexfloatingr   r   r  )
rf   r  rb   r2   r   r   r$   r!   r  rJ   s
   &&&&&     r%   	_check_1dTestOverwrite._check_1d  s    ii##D)== 2 23399e$r#))U*;';;D99e$D{{5! D,+DKKtT4 +- ,  - !r(   c                    V P                    FK  pV P                  \        VRR4       V P                  \        VR^ 4       V P                  \        VR^4       KM  	  R# r   N)r   rD   )r   r   )r   r   )real_dtypesr  r   rf   rb   s   & r%   test_dctTestOverwrite.test_dct  H    %%ENN3ub1NN3w2NN3w2 &r(   c                    V P                    FK  pV P                  \        VRR4       V P                  \        VR^ 4       V P                  \        VR^4       KM  	  R# r  )r  r  r	   r  s   & r%   	test_idctTestOverwrite.test_idct  H    %%ENN4r2NN43NN43 &r(   c                    V P                    FK  pV P                  \        VRR4       V P                  \        VR^ 4       V P                  \        VR^4       KM  	  R# r  )r  r  r
   r  s   & r%   test_dstTestOverwrite.test_dst  r  r(   c                    V P                    FK  pV P                  \        VRR4       V P                  \        VR^ 4       V P                  \        VR^4       KM  	  R# r  )r  r  r   r  s   & r%   	test_idstTestOverwrite.test_idst  r  r(   r|   N)r}   r~   r   r   __doc__r   r   r   r  r  r  r  r  r  r  r   r   r   s   @r%   r  r    s>     )::rzz*KH-3434 4r(   r  c                     a  ] tR tRt o ^t. ROtRR.t]P                  P                  R4      t
Rt]
P                  ! ]!  t]P                  P!                  R]]3]]3.4      ]P                  P!                  RR^R^.^ R^ .R^ ^.RRR..4      ]P                  P!                  R]4      ]P                  P!                  RR.4      R	 4       4       4       4       t]P                  P!                  R
]]3]]3.4      ]P                  P!                  R]4      ]P                  P!                  R]4      R 4       4       4       t]P                  P!                  R]]3]]3.4      ]P                  P!                  R]4      ]P                  P!                  RRR.4      R 4       4       4       t]P                  P!                  R]]3]]3.4      R 4       t]P                  P!                  R]].4      R 4       t]P                  P!                  R]]3]]3.4      ]P                  P!                  R^R^.^ R^ ..4      R 4       4       tRtV t R# )Test_DCTN_IDCTNi  NrA   r   zfforward,finverseaxesdct_typerJ   c                t    V! V P                   WCVR 7      pV! WdW5R 7      p\        V P                   V^R7       R# )r!   r  rJ   r   Nr$   r   )rf   fforwardfinverser  r   rJ   tmps   &&&&&& r%   test_axes_round_trip$Test_DCTN_IDCTN.test_axes_round_trip  s2     tyyxFs@!$))S"=r(   zfforward,fforward_refc                t    V! V P                   VR VR7      pV! V P                   W4R7      p\        WV^R7       R # )Nr  r!   rJ   r   r  )rf   r  fforward_refr   rJ   y1r   s   &&&&&  r%   test_dctn_vs_2d_reference)Test_DCTN_IDCTN.test_dctn_vs_2d_reference  s2     diihTE$))(>!""5r(   zfinverse,finverse_refc                v    \        V P                  W4R 7      pV! WSVR 7      pV! WSVR 7      p\        Wg^R7       R# )r
  r   N)r   r$   r   )rf   r  finverse_refr   rJ   fdatar  r   s   &&&&&   r%   test_idctn_vs_2d_reference*Test_DCTN_IDCTN.test_idctn_vs_2d_reference  s6     TYYX9e6%T:!""5r(   c                X   \        \        R R7      ;_uu_ 4        V! V P                  V P                  P                  ^ ,          RR7       RRR4       \        \        R R7      ;_uu_ 4        V! V P                  V P                  P                  ^ ,          RR7       RRR4       \        \        R R7      ;_uu_ 4        V! V P                  V P                  P                  ^ R7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lp; i  + '       g   i     R# ; i)zBwhen given, axes and shape arguments have to be of the same length)matchr2   r  Nr   r  )assert_raisesr   r$   r2   )rf   r  r  s   &&&r%   test_axes_and_shape#Test_DCTN_IDCTN.test_axes_and_shape&  s     :"<= = TYYdiiooa&8vF=
 :"<= = TYYdiiooa&8tD=
 :"<= = TYYdiiooA>= == =
= =
= = =s#   1C2,1D>*D2D	D	D)	r  c                \    V! V P                   RRR7      p\        VP                  R4       R# )   Nr  )r  r  )r$   r   r2   )rf   r  r  s   && r%   
test_shapeTest_DCTN_IDCTN.test_shape8  s"    tyy
>SYY
+r(   c                    V! V P                   R VRR7      pV! VR VRR7      p\        V P                   W@P                  R7       R # )NrA   )r2   r  rJ   r   )r$   r   r   )rf   r  r  r  r  s   &&&& r%   test_shape_is_none_with_axes,Test_DCTN_IDCTN.test_shape_is_none_with_axes=  s:    
 tyy4gFs$T@!$))S((Cr(   r|   r  )r   r   )r  )r   r  rD   )r"  rD   )!r}   r~   r   r   r   r   normsr   r   r   rstater2   r   r$   r   markparametrizer   r   r   r   r  r7   r=   r  r:   r?   r  r  r  r   r   r   r   s   @r%   r  r    s    
CH7OEYY""4(FE<<D[[0D%=48%=3B C[[Vd&'s&'s&,q!f&.R	&: ;
 [[Z2[[VgY/> 0 3;C>
 [[4j7I8<j7I7K L[[Z2[[VU+6 , 3L6 [[4{7K8={7K7M N[[Z2[[VdG_56 6 3N6 [[0D%=48%=3B C?C?  [[Z$6, 7, [[0D%=48%=3B C[[Vas&'s&4 5D5CDr(   r  r   )eos.pathr   r   r   numpyr   numpy.testingr   r   r   r   r  scipy.fftpack._realtransformsr   r	   r
   r   r   r   r   r   load__file__MDATAr1   r   r   r   r   r   r&   r+   r7   r:   r=   r?   rQ   rV   rY   r\   r^   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r)  r-  r1  r5  r9  r=  rA  rE  rI  rM  rQ  rU  rY  rc  rg  rk  ro  rs  rw  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r   s   0r%   <module>r.     s   !   A  *4 4 4 	WX&
34"1X&XUQqc7^^X&"1X&XUQqc7^^X& ''$wx02GHI''$wx02GHI )

*( (@%* %*P	WL 	W?\ ?	?l 	?	W\ 	W] M - n ^ >  o O n ^ > 0 06m ] = } m M  } ] } m M 0 00	WL 	W	?\ 	?] M - l \ < | l L n ^ > 0 08m ] = } m M  } ] } m = 24 24jID ID[ '&s    N!N&