
    _Mh                     >   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
           	      4   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        |          d          |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 (z) specified)r   r   r
   r   r	   shape
ValueErrornpiscomplexobj
empty_likerealimag)forward	transformxtypenaxisnormoverwrite_xworkersorthogonalizetmpcopiedouts                c/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/fft/_pocketfft/realtransforms.py_r2rr%      sY    A,,C4S!!4!4K$((DwG 199DDQYYD}#CD11V!+V	41		W39T?WWWXXX'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$   _r2rnr/   ;   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*   r/   r0   r1   r2   r3    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P 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&   