a
    h                     @   s  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d	Zeed
ejZde_eedejZde_eed
ejZde_eedejZde_dddZeed
ejZde_eedejZde_eed
ejZde_e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
                 C   s  t |}
|pt|
|}t|| }t|}| sF|dkr:d}n|dkrFd}|durht|
||\}
}|pd|}n$|
j| dk rtd|
j|  d|r|
nd}t|r|du rt	|
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nZaxisnormoverwrite_xworkersorthogonalizetmpcopiedout r!   _/var/www/html/assistant/venv/lib/python3.9/site-packages/scipy/fft/_pocketfft/realtransforms.py_r2r   s*    


r#   Tdctidctdstidstc
                 C   s   t |}
t|
||\}}|p$t|
|}t|dkr6|S t|
||\}
}|pL|}| sl|dkr`d}n|dkrld}t|| }t|}|r|
nd}t|r|du rt	|
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   sZaxesr   r   r   r   r   r   r   r    r!   r!   r"   _r2rn;   s*    

r*   dctnidctndstnidstn)r   Nr   NFNN)r   NNNFNN)numpyr    r   Zpffthelperr   r   r   r   r   r	   r
   	functoolsr#   partialr$   __name__r%   r&   r'   r*   r+   r,   r-   r.   r!   r!   r!   r"   <module>   s2   $  
(  
*