
    ge2                     >   d dl ZddlmZ ddlmZmZmZm	Z	m
Z
mZmZ d dlZ	 	 ddZ ej        ed	ej                  Zd
e_         ej        edej                  Zde_         ej        ed	ej                  Zde_         ej        edej                  Zde_        	 	 ddZ ej        ed	ej                  Zde_         ej        edej                  Zde_         ej        ed	ej                  Zde_         ej        edej                  Zde_        dS )    N   )pypocketfft)	_asfarray_init_nd_shape_and_axes_datacopied
_fix_shape_fix_shape_1d_normalization_workers   Fc
           	      R   t          |          }
|pt          |
|          }t          ||           }t          |          }| s|dk    rd}n|dk    rd}|t	          |
||          \  }
}|p|}n>|
j        |         dk     r-t          d                    |
j        |                             |r|
nd}t          j	        |          rP|t          j
        |
          n|} ||
j        ||f||j        |            ||
j        ||f||j        |           |S  ||
||f||||	          S )zForward or backward 1-D DCT/DST

    Parameters
    ----------
    forward : bool
        Transform direction (determines type and normalisation)
    transform : {pypocketfft.dct, pypocketfft.dst}
        The transform to perform
    r      Nr   z,invalid number of data points ({}) specified)r   r   r
   r   r	   shape
ValueErrorformatnpiscomplexobj
empty_likerealimag)forward	transformxtypenaxisnormoverwrite_xworkersorthogonalizetmpcopiedouts                Clib/python3.11/site-packages/scipy/fft/_pocketfft/realtransforms.py_r2rr&      sc    A,,C4S!!4!4K$((DwG 199DDQYYD}#CD11V!+V	41		G &4113 3 	3 '334C 
q $'KbmC   S	#(D4'47CCC	#(D4'47CCC
9S$sG]KKK    Tdctidctdstidstc
           	         t          |          }
t          |
||          \  }}|pt          |
|          }t          |          dk    r|S t	          |
||          \  }
}|p|}| s|dk    rd}n|dk    rd}t          ||           }t          |          }|r|
nd}t          j        |          rN|t          j	        |
          n|} ||
j
        ||||j
        |            ||
j        ||||j        |           |S  ||
||||||	          S )zForward or backward nd DCT/DST

    Parameters
    ----------
    forward : bool
        Transform direction (determines type and normalisation)
    transform : {pypocketfft.dct, pypocketfft.dst}
        The transform to perform
    r   r   r   N)r   r   r   lenr   r
   r   r   r   r   r   r   )r   r   r   r   saxesr   r   r    r!   r"   r   r#   r$   s                 r%   _r2rnr0   <   sD    A,,C)#q$77KE44S!!4!4K
4yyA~~S%..KC'K 199DDQYYD$((DwG'334C 
q $'KbmC   S	#(D$ch@@@	#(D$ch@@@
9S$dC-HHHr'   dctnidctndstnidstn)r   Nr   NFNN)r   NNNFNN)numpyr    r   pffthelperr   r   r   r   r	   r
   r   	functoolsr&   partialr(   __name__r)   r*   r+   r0   r1   r2   r3   r4    r'   r%   <module>r=      s       ! ! ! ! ! !J J J J J J J J J J J J J J J J J J     ?C8<&L &L &L &LR idDH--yudh//idDH--yudh// BF9='I 'I 'I 'IT ydh//	%11ydh//	%11r'   