K ijdZddlmZeGddeZeGddeZeGddeZeGd d eZeGd d eZGd deZ eGddeZ eGddeZ eGddeZ eGddeZ eGddeZeGddeZeGddeZeGddeZeGdd eZeGd!d"eZeGd#d$eZeGd%d&eZeGd'd(eZeGd)d*eZeGd+d,eZeGd-d.eZeGd/d0eZeGd1d2eZeGd3d4eZeGd5d6eZeGd7d8eZy9):z5Definitions of common exceptions for `polys` module. )publicceZdZdZdZy)BasePolynomialErrorz.Base class for polynomial related exceptions. ctd)Nzabstract base class)NotImplementedError)selfargss \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/polys/polyerrors.pynewzBasePolynomialError.new s!"788N)__name__ __module__ __qualname____doc__r r r rrs 89r rc eZdZddZdZdZy)ExactQuotientFailedNc0|||c|_|_|_yN)fgdom)rrrrs r __init__zExactQuotientFailed.__init__s#$a r cddlm}|j'||jd||jS||jd||jd||jS)Nr)sstrz does not divide z in )sympy.printing.strrrrr)rrs r __str__zExactQuotientFailed.__str__sT+ 88 .2466lDLI I48L$tvv,PTUYU]U]P^_ _r c<|j|||jSr) __class__r)rrrs r r zExactQuotientFailed.news~~aDHH--r r)r rrrrr rr r rr s-`.r rceZdZdZdZy)PolynomialDivisionFailedc.||_||_||_yr)rrdomain)rrrr#s r rz!PolynomialDivisionFailed.__init__!s r c|jjrd}n|jjsd}nd}d|jd|jd|jd|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_EXis_Exactrr)rmsgs r rz PolynomialDivisionFailed.__str__&sW ;;  $C%%#C?C#ffdffdkk3@ @r Nr rrrrrr r r!r!s  @r r!ceZdZdZdZy)OperationNotSupportedc ||_||_yr)polyfunc)rr,r-s r rzOperationNotSupported.__init__<s  r cxd|jd|jjjjdS)N`z` operation not supported by z representation)r-r,reprr rs r rzOperationNotSupported.__str__@s*FJiiQUQZQZQ^Q^QhQhQqQqrrr Nr(rr r r*r*9s sr r*c eZdZy)HeuristicGCDFailedNr rrrr r r3r3Cr r3c eZdZy)ModularGCDFailedNr4rr r r7r7Gsr r7c eZdZy)HomomorphismFailedNr4rr r r9r9Jr5r r9c eZdZy)IsomorphismFailedNr4rr r r;r;Nr5r r;c eZdZy)ExtraneousFactorsNr4rr r r=r=Rr5r r=c eZdZy)EvaluationFailedNr4rr r r?r?Vr5r r?c eZdZy)RefinementFailedNr4rr r rArAZr5r rAc eZdZy)CoercionFailedNr4rr r rCrC^r5r rCc eZdZy) NotInvertibleNr4rr r rErEbr5r rEc eZdZy) NotReversibleNr4rr r rGrGfr5r rGc eZdZy) NotAlgebraicNr4rr r rIrIjr5r rIc eZdZy) DomainErrorNr4rr r rKrKnr5r rKc eZdZy)PolynomialErrorNr4rr r rMrMrr5r rMc eZdZy)UnificationFailedNr4rr r rOrOvr5r rOceZdZdZy)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 rrrrr r rQrQzsr rQc eZdZy)GeneratorsErrorNr4rr r rSrSr5r rSc eZdZy)GeneratorsNeededNr4rr r rUrUr5r rUceZdZdZdZy)ComputationFailedc.||_||_||_yr)r-nargsexc)rr-rYrZs r rzComputationFailed.__init__s  r c |jddjtt|jj d|j dS)N(, z) failed without generators)r-joinmapstrrZexprsrYr1s r rzComputationFailed.__str__s=59YY #cSWS[S[SaSabmcgcmcmSnJo@pqqr Nr(rr r rWrWs  rr rWc eZdZy)UnivariatePolynomialErrorNr4rr r rcrcr5r rcc eZdZy)MultivariatePolynomialErrorNr4rr r rerer5r receZdZddZdZy)PolificationFailedc~|s||_||_|g|_|g|_n||_||_||_||_yr)origexprorigsraoptseq)rrlrkrarms r rzPolificationFailed.__init__sADIDIDJDJDJDJr c|jsdt|jzSddjt t|j zS)Nz%Cannot construct a polynomial from %sz$Cannot construct polynomials from %sr])rmr`rir^r_rkr1s r rzPolificationFailed.__str__s;xx:S^K K9DIIc#tzzFZ<[[ [r N)Fr(rr r rgrgs  \r rgc eZdZy) OptionErrorNr4rr r rprpr5r rpc eZdZy) FlagErrorNr4rr r rrrrr5r rrN)rsympy.utilitiesr Exceptionrrr!r*r3r7r9r;r=r?rArCrErGrIrKrMrOrQrSrUrWrcrergrprrrr r rus;#9)99 .-.. @2@@4s/ss ,   *  ,   +   +   *   *   (   '   '   &   %   )   +  /  )     r+rr    /  \\\* %     r