Status: Valid
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 3448 by asmeu...@gmail.com: PolynomialError when solving
inequality
http://code.google.com/p/sympy/issues/detail?id=3448
In [48]: solve(x/(1 + x)>eps, x)
---------------------------------------------------------------------------
PolynomialError Traceback (most recent call last)
<ipython-input-48-686ae298b890> in <module>()
----> 1 solve(x/(1 + x)>eps, x)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in
solve(f, *symbols, **flags)
632 elif isinstance(fi, bool) or fi.is_Relational:
633 return reduce_inequalities(f,
assume=flags.get('assume'),
--> 634 symbols=symbols)
635 # Any embedded piecewise functions need to be brought out
to the
636 # top level so that the appropriate strategy gets selected.
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/inequalities.py
in
reduce_inequalities(inequalities, assume, symbols)
355 and inequalities[0].is_Relational:
356 try:
--> 357 return _solve_inequality(inequalities[0], symbols[0])
358 except NotImplementedError:
359 pass
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/inequalities.py
in
_solve_inequality(ie, s)
321 raise NotImplementedError
322 expr = ie.lhs - ie.rhs
--> 323 p = Poly(expr, s)
324 if p.degree() != 1:
325 raise NotImplementedError('%s' % ie)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/polys/polytools.py in
__new__(cls, rep, *gens, **args)
96 return cls._from_poly(rep, opt)
97 else:
---> 98 return cls._from_expr(rep, opt)
99
100 @classmethod
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/polys/polytools.py in
_from_expr(cls, rep, opt)
206 def _from_expr(cls, rep, opt):
207 """Construct a polynomial from an expression. """
--> 208 rep, opt = _dict_from_expr(rep, opt)
209 return cls._from_dict(rep, opt)
210
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/polys/polyutils.py in
_dict_from_expr(expr, opt)
325
326 if opt.gens:
--> 327 rep, gens = _dict_from_expr_if_gens(expr, opt)
328 else:
329 rep, gens = _dict_from_expr_no_gens(expr, opt)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/polys/polyutils.py in
_dict_from_expr_if_gens(expr, opt)
266 def _dict_from_expr_if_gens(expr, opt):
267 """Transform an expression into a multinomial form given
generators. """
--> 268 (poly,), gens = _parallel_dict_from_expr_if_gens((expr,), opt)
269 return poly, gens
270
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/polys/polyutils.py in
_parallel_dict_from_expr_if_gens(exprs, opt)
171 coeff.append(factor)
172 else:
--> 173 raise PolynomialError("%s contains an
element of the generators set" % factor)
174
175 monom = tuple(monom)
PolynomialError: 1/(x + 1) contains an element of the generators set
It should raise NotImplementedError if it can't do it.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.