o
    װiv                     @   s:   d dl Z d dlZd dlmZ ejdddddZdd	 ZdS )
    N)_corecupyx_scipy_special_gammaln)zf->fzd->dzp
    if (isinf(in0) && in0 < 0) {
        out0 = -1.0 / 0.0;
    } else {
        out0 = lgamma(in0);
    }
    a  Logarithm of the absolute value of the Gamma function.

    Args:
        x (cupy.ndarray): Values on the real line at which to compute
        ``gammaln``.

    Returns:
        cupy.ndarray: Values of ``gammaln`` at x.

    .. seealso:: :data:`scipy.special.gammaln`

    )docc                 C   s   t |rt||krtdt | rt j| td} tt | d|d  kr-td||d  d t	tj
 }t| }| jjdkrK|t j}|| }td|d D ]}|t| |d	 d  7 }qV|S )
a  Returns the log of multivariate gamma, also sometimes called the
    generalized gamma.

    Parameters
    ----------
    a : cupy.ndarray
        The multivariate gamma is computed for each item of `a`.
    d : int
        The dimension of the space of integration.

    Returns
    -------
    res : ndarray
        The values of the log multivariate gamma at the given points `a`.

    See Also
    --------
    :func:`scipy.special.multigammaln`

    z*d should be a positive integer (dimension))dtypeg      ?   z!condition a > 0.5 * (d-1) not metg      ?f   g      ?)cupyisscalarmathfloor
ValueErrorasarrayfloatintanylogpigammalnr   kindastypefloat64range)adresgam0j r   P/home/ubuntu/.local/lib/python3.10/site-packages/cupyx/scipy/special/_gammaln.pymultigammaln   s   
r    )r   r	   r   create_ufuncr   r    r   r   r   r   <module>   s    