a
    RG5dˆ  ã                   @   s,  d Z ddlmZ eG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG d	d
„ d
eƒƒZeG dd„ deƒƒZG dd„ deƒZ	eG dd„ deƒƒZ
eG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG dd„ deƒƒZeG dd „ d eƒƒZeG d!d"„ d"eƒƒZeG d#d$„ d$eƒƒZeG d%d&„ d&eƒƒZeG d'd(„ d(eƒƒZeG d)d*„ d*eƒƒZeG d+d,„ d,eƒƒZeG d-d.„ d.eƒƒZeG d/d0„ d0eƒƒZeG d1d2„ d2eƒƒZeG d3d4„ d4eƒƒZeG d5d6„ d6eƒƒZeG d7d8„ d8eƒƒZd9S ):z5Definitions of common exceptions for `polys` module. é    )Úpublicc                   @   s   e Zd ZdZdd„ ZdS )ÚBasePolynomialErrorz.Base class for polynomial related exceptions. c                 G   s   t dƒ‚d S )Nzabstract base class)ÚNotImplementedError)ÚselfÚargs© r   úR/var/www/html/django/DPS/env/lib/python3.9/site-packages/sympy/polys/polyerrors.pyÚnew
   s    zBasePolynomialError.newN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r      s   r   c                   @   s&   e Zd Zddd„Zdd„ Zdd„ ZdS )	ÚExactQuotientFailedNc                 C   s   |||  | _ | _| _d S ©N)ÚfÚgÚdom)r   r   r   r   r   r   r   Ú__init__   s    zExactQuotientFailed.__init__c                 C   sR   ddl m} | jd u r.d|| jƒ|| jƒf S d|| jƒ|| jƒ|| jƒf S d S )Nr   )Ússtrz%s does not divide %sz%s does not divide %s in %s)Úsympy.printing.strr   r   r   r   )r   r   r   r   r   Ú__str__   s    
zExactQuotientFailed.__str__c                 C   s   |   ||| j¡S r   )Ú	__class__r   )r   r   r   r   r   r   r	      s    zExactQuotientFailed.new)N)r
   r   r   r   r   r	   r   r   r   r   r      s   
r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚPolynomialDivisionFailedc                 C   s   || _ || _|| _d S r   )r   r   Údomain)r   r   r   r   r   r   r   r   !   s    z!PolynomialDivisionFailed.__init__c                 C   s6   | j jrd}n| j jsd}nd}d| j| j| j |f S )NzŒYou may want to use a different simplification algorithm. Note that in general it's not possible to guarantee to detect zero in this domain.z‹Your working precision or tolerance of computations may be set improperly. Adjust those parameters of the coefficient domain and try again.z¦Zero detection is guaranteed in this coefficient domain. This may indicate a bug in SymPy or the domain is user defined and doesn't implement zero detection properly.zÆcouldn't reduce degree in a polynomial division algorithm when dividing %s by %s. This can happen when it's not possible to detect zero in the coefficient domain. The domain of computation is %s. %s)r   Úis_EXZis_Exactr   r   )r   Úmsgr   r   r   r   &   s    ýz PolynomialDivisionFailed.__str__N©r
   r   r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚOperationNotSupportedc                 C   s   || _ || _d S r   )ÚpolyÚfunc)r   r   r   r   r   r   r   <   s    zOperationNotSupported.__init__c                 C   s   d| j | jjjjf S )Nz1`%s` operation not supported by %s representation)r   r   Úrepr   r
   ©r   r   r   r   r   @   s    zOperationNotSupported.__str__Nr   r   r   r   r   r   9   s   r   c                   @   s   e Zd ZdS )ÚHeuristicGCDFailedN©r
   r   r   r   r   r   r   r"   C   s   r"   c                   @   s   e Zd ZdS )ÚModularGCDFailedNr#   r   r   r   r   r$   G   s   r$   c                   @   s   e Zd ZdS )ÚHomomorphismFailedNr#   r   r   r   r   r%   J   s   r%   c                   @   s   e Zd ZdS )ÚIsomorphismFailedNr#   r   r   r   r   r&   N   s   r&   c                   @   s   e Zd ZdS )ÚExtraneousFactorsNr#   r   r   r   r   r'   R   s   r'   c                   @   s   e Zd ZdS )ÚEvaluationFailedNr#   r   r   r   r   r(   V   s   r(   c                   @   s   e Zd ZdS )ÚRefinementFailedNr#   r   r   r   r   r)   Z   s   r)   c                   @   s   e Zd ZdS )ÚCoercionFailedNr#   r   r   r   r   r*   ^   s   r*   c                   @   s   e Zd ZdS )ÚNotInvertibleNr#   r   r   r   r   r+   b   s   r+   c                   @   s   e Zd ZdS )ÚNotReversibleNr#   r   r   r   r   r,   f   s   r,   c                   @   s   e Zd ZdS )ÚNotAlgebraicNr#   r   r   r   r   r-   j   s   r-   c                   @   s   e Zd ZdS )ÚDomainErrorNr#   r   r   r   r   r.   n   s   r.   c                   @   s   e Zd ZdS )ÚPolynomialErrorNr#   r   r   r   r   r/   r   s   r/   c                   @   s   e Zd ZdS )ÚUnificationFailedNr#   r   r   r   r   r0   v   s   r0   c                   @   s   e Zd ZdZdS )ÚUnsolvableFactorErrorz™Raised if ``roots`` is called with strict=True and a polynomial
     having a factor whose solutions are not expressible in radicals
     is encountered.N)r
   r   r   r   r   r   r   r   r1   z   s   r1   c                   @   s   e Zd ZdS )ÚGeneratorsErrorNr#   r   r   r   r   r2   €   s   r2   c                   @   s   e Zd ZdS )ÚGeneratorsNeededNr#   r   r   r   r   r3   „   s   r3   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚComputationFailedc                 C   s   || _ || _|| _d S r   )r   ÚnargsÚexc)r   r   r5   r6   r   r   r   r   ‹   s    zComputationFailed.__init__c              	   C   s(   d| j d tt| jjd | j… ƒ¡f S )Nz %s(%s) failed without generatorsú, )r   ÚjoinÚmapÚstrr6   Úexprsr5   r!   r   r   r   r      s    zComputationFailed.__str__Nr   r   r   r   r   r4   ˆ   s   r4   c                   @   s   e Zd ZdS )ÚUnivariatePolynomialErrorNr#   r   r   r   r   r<   “   s   r<   c                   @   s   e Zd ZdS )ÚMultivariatePolynomialErrorNr#   r   r   r   r   r=   —   s   r=   c                   @   s   e Zd Zddd„Zdd„ ZdS )ÚPolificationFailedFc                 C   s>   |s"|| _ || _|g| _|g| _n|| _|| _|| _|| _d S r   )ÚorigÚexprÚorigsr;   ÚoptÚseq)r   rB   rA   r;   rC   r   r   r   r   ž   s    
zPolificationFailed.__init__c                 C   s.   | j sdt| jƒ S dd tt| jƒ¡ S d S )Nz%Cannot construct a polynomial from %sz$Cannot construct polynomials from %sr7   )rC   r:   r?   r8   r9   rA   r!   r   r   r   r   «   s    zPolificationFailed.__str__N)Fr   r   r   r   r   r>   ›   s   
r>   c                   @   s   e Zd ZdS )ÚOptionErrorNr#   r   r   r   r   rD   ±   s   rD   c                   @   s   e Zd ZdS )Ú	FlagErrorNr#   r   r   r   r   rE   µ   s   rE   N)r   Úsympy.utilitiesr   Ú	Exceptionr   r   r   r   r"   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r<   r=   r>   rD   rE   r   r   r   r   Ú<module>   sl   	
