
    wg                     j   d Z ddlmZ e G d de             Ze G d de             Ze G d de             Ze G d	 d
e             Ze G d de             Z G d de      Z	e G d de             Z
e G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d d e             Ze G d! d"e             Ze G d# d$e             Ze G d% d&e             Ze G d' d(e             Ze G d) d*e             Ze G d+ d,e             Ze G d- d.e             Ze G d/ d0e             Ze G d1 d2e             Ze G d3 d4e             Ze G d5 d6e             Ze G d7 d8e             Zy9):z5Definitions of common exceptions for `polys` module.     )publicc                       e Zd ZdZd Zy)BasePolynomialErrorz.Base class for polynomial related exceptions. c                     t        d      )Nzabstract base class)NotImplementedError)selfargss     [/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/sympy/polys/polyerrors.pynewzBasePolynomialError.new
   s    !"788    N)__name__
__module____qualname____doc__r    r   r
   r   r      s
    89r   r   c                        e Zd ZddZd Zd Zy)ExactQuotientFailedNc                 0    |||c| _         | _        | _        y N)fgdom)r   r   r   r   s       r
   __init__zExactQuotientFailed.__init__   s    #$a r   c                     ddl m} | j                  ' || j                        d || j                        S  || j                        d || j                        d || j                        S )Nr   )sstrz does not divide z in )sympy.printing.strr   r   r   r   )r   r   s     r
   __str__zExactQuotientFailed.__str__   sT    +88.2466lDLII48L$tvv,PTUYU]U]P^__r   c                 <    | j                  ||| j                        S r   )	__class__r   )r   r   r   s      r
   r   zExactQuotientFailed.new   s    ~~aDHH--r   r   )r   r   r   r   r   r   r   r   r
   r   r      s    -`.r   r   c                       e Zd Zd Zd Zy)PolynomialDivisionFailedc                 .    || _         || _        || _        y r   )r   r   domain)r   r   r   r#   s       r
   r   z!PolynomialDivisionFailed.__init__!   s    r   c                     | j                   j                  rd}n| j                   j                  sd}nd}d| j                  d| j                  d| j                   d|S )NzYou may want to use a different simplification algorithm. Note that in general it's not possible to guarantee to detect zero in this domain.zYour working precision or tolerance of computations may be set improperly. Adjust those parameters of the coefficient domain and try again.zZero 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.zHcouldn't reduce degree in a polynomial division algorithm when dividing z by zp. This can happen when it's not possible to detect zero in the coefficient domain. The domain of computation is z. )r#   is_EXis_Exactr   r   )r   msgs     r
   r   z PolynomialDivisionFailed.__str__&   sW    ;;$C %%#C?C #ffdffdkk3@ 	@r   Nr   r   r   r   r   r   r   r
   r!   r!      s    
@r   r!   c                       e Zd Zd Zd Zy)OperationNotSupportedc                      || _         || _        y r   )polyfunc)r   r,   r-   s      r
   r   zOperationNotSupported.__init__<   s    		r   c                 x    d| j                   d| j                  j                  j                  j                  dS )N`z` operation not supported by z representation)r-   r,   repr   r   r   s    r
   r   zOperationNotSupported.__str__@   s*    FJiiQUQZQZQ^Q^QhQhQqQqrrr   Nr(   r   r   r
   r*   r*   9   s    sr   r*   c                       e Zd Zy)HeuristicGCDFailedNr   r   r   r   r   r
   r3   r3   C       r   r3   c                       e Zd Zy)ModularGCDFailedNr4   r   r   r
   r7   r7   G   s    r   r7   c                       e Zd Zy)HomomorphismFailedNr4   r   r   r
   r9   r9   J   r5   r   r9   c                       e Zd Zy)IsomorphismFailedNr4   r   r   r
   r;   r;   N   r5   r   r;   c                       e Zd Zy)ExtraneousFactorsNr4   r   r   r
   r=   r=   R   r5   r   r=   c                       e Zd Zy)EvaluationFailedNr4   r   r   r
   r?   r?   V   r5   r   r?   c                       e Zd Zy)RefinementFailedNr4   r   r   r
   rA   rA   Z   r5   r   rA   c                       e Zd Zy)CoercionFailedNr4   r   r   r
   rC   rC   ^   r5   r   rC   c                       e Zd Zy)NotInvertibleNr4   r   r   r
   rE   rE   b   r5   r   rE   c                       e Zd Zy)NotReversibleNr4   r   r   r
   rG   rG   f   r5   r   rG   c                       e Zd Zy)NotAlgebraicNr4   r   r   r
   rI   rI   j   r5   r   rI   c                       e Zd Zy)DomainErrorNr4   r   r   r
   rK   rK   n   r5   r   rK   c                       e Zd Zy)PolynomialErrorNr4   r   r   r
   rM   rM   r   r5   r   rM   c                       e Zd Zy)UnificationFailedNr4   r   r   r
   rO   rO   v   r5   r   rO   c                       e Zd ZdZy)UnsolvableFactorErrorzRaised 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
   rQ   rQ   z   s    r   rQ   c                       e Zd Zy)GeneratorsErrorNr4   r   r   r
   rS   rS      r5   r   rS   c                       e Zd Zy)GeneratorsNeededNr4   r   r   r
   rU   rU      r5   r   rU   c                       e Zd Zd Zd Zy)ComputationFailedc                 .    || _         || _        || _        y r   )r-   nargsexc)r   r-   rY   rZ   s       r
   r   zComputationFailed.__init__   s    	
r   c           
          | j                   ddj                  t        t        | j                  j
                  d | j                               dS )N(, z) failed without generators)r-   joinmapstrrZ   exprsrY   r1   s    r
   r   zComputationFailed.__str__   s=    59YY		#cSWS[S[SaSabmcgcmcmSnJo@pqqr   Nr(   r   r   r
   rW   rW      s    
rr   rW   c                       e Zd Zy)UnivariatePolynomialErrorNr4   r   r   r
   rc   rc      r5   r   rc   c                       e Zd Zy)MultivariatePolynomialErrorNr4   r   r   r
   re   re      r5   r   re   c                       e Zd ZddZd Zy)PolificationFailedc                 ~    |s|| _         || _        |g| _        |g| _        n|| _        || _        || _        || _        y r   )origexprorigsra   optseq)r   rl   rk   ra   rm   s        r
   r   zPolificationFailed.__init__   sA    DIDIDJDJDJDJr   c                     | j                   sdt        | j                        z  S ddj                  t	        t        | j
                              z  S )Nz%Cannot construct a polynomial from %sz$Cannot construct polynomials from %sr]   )rm   r`   ri   r^   r_   rk   r1   s    r
   r   zPolificationFailed.__str__   s;    xx:S^KK9DIIc#tzzFZ<[[[r   N)Fr(   r   r   r
   rg   rg      s    \r   rg   c                       e Zd Zy)OptionErrorNr4   r   r   r
   rp   rp      r5   r   rp   c                       e Zd Zy)	FlagErrorNr4   r   r   r
   rr   rr      r5   r   rr   N)r   sympy.utilitiesr   	Exceptionr   r   r!   r*   r3   r7   r9   r;   r=   r?   rA   rC   rE   rG   rI   rK   rM   rO   rQ   rS   rU   rW   rc   re   rg   rp   rr   r   r   r
   <module>ru      s   ; #9) 9 9 .- . .  @2 @ @4 s/ s s 	, 	 		* 	 	, 	 	 	+ 	 	 	+ 	 	 	* 	 	 	* 	 	 	( 	 	 	' 	 	 	' 	 	 	& 	 	 	% 	 	 	) 	 	 	+ 	 	 /  
 	) 	 	 	 	 	 r+ r r 	 	 	 	/ 	 	 \ \ \* 	% 	 	 	 	 	r   