a
     ¬<b  ã                   @   s4   d dl mZ d dlmZmZmZ G dd„ deƒZdS )é    )ÚBasic)ÚPSpaceÚ_symbol_converterÚRandomMatrixSymbolc                   @   s.   e Zd ZdZd	dd„Zedd„ ƒZdd„ ZdS )
ÚRandomMatrixPSpacez
    Represents probability space for
    random matrices. It contains the mechanics
    for handling the API calls for random matrices.
    Nc                 C   s*   t |ƒ}|rt | ||¡S t | |¡S d S )N)r   r   Ú__new__)ÚclsÚsymÚmodel© r   úi/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/sympy/stats/random_matrix.pyr   
   s    zRandomMatrixPSpace.__new__c                 C   s&   z| j d W S  ty    Y d S 0 d S )Né   )ÚargsÚ
IndexError)Úselfr   r   r   r
      s    zRandomMatrixPSpace.modelc                 G   s4   |  t¡}t|ƒdks t|tƒs(tdƒ‚| j |¡S )Né   zoCurrently, no algorithm has been implemented to handle general expressions containing multiple random matrices.)Zatomsr   ÚlenÚ
isinstanceÚNotImplementedErrorr
   Zdensity)r   Úexprr   Zrmsr   r   r   Úcompute_density   s    
z"RandomMatrixPSpace.compute_density)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr
   r   r   r   r   r   r      s
   

r   N)Zsympy.core.basicr   Zsympy.stats.rvr   r   r   r   r   r   r   r   Ú<module>   s   