"gen" argument in sympy.solvers.inequalities.solve_univariate_inequality

28 views
Skip to first unread message

Amit Saha

unread,
May 8, 2015, 7:33:25 PM5/8/15
to sy...@googlegroups.com
Hi all,

What does the "gen" argument mean in the context of
"solve_univariate_inequality(expr, gen, relational=True)" [1] ?

[1] http://docs.sympy.org/dev/modules/solvers/inequalities.html#sympy.solvers.inequalities.solve_univariate_inequality


Thanks,
Amit.

--
http://echorand.me

AMiT Kumar

unread,
May 10, 2015, 5:01:02 AM5/10/15
to sy...@googlegroups.com
Hi Amit,

The `gen` argument corresponds to the symbol you are solving for
the univariate inequality (expr).

Example:

>>> solve_univariate_inequality(x**2 >= 4, x)
   
Or(And(-oo < x, x <= -2), And(2 <= x, x < oo))


>>> solve_univariate_inequality(x**2 >= 4, x, relational=False)
   
(-oo, -2] U [2, oo)


AMiT Kumar
3rd Year Undergrad
Delhi Technological University

Amit Saha

unread,
May 10, 2015, 8:26:17 AM5/10/15
to sy...@googlegroups.com
On Sun, May 10, 2015 at 7:01 PM, AMiT Kumar <dtu....@gmail.com> wrote:
> Hi Amit,
>
> The `gen` argument corresponds to the symbol you are solving for
> the univariate inequality (expr).
>
> Example:
>
>>>> solve_univariate_inequality(x**2 >= 4, x)
> Or(And(-oo < x, x <= -2), And(2 <= x, x < oo))
>
>
>>>> solve_univariate_inequality(x**2 >= 4, x, relational=False)
> (-oo, -2] U [2, oo)

Thank you for your reply. Yeah I figured that out. My query was more
of: what did "gen" mean in this context?
I believe it refers to polynomial generator?




--
http://echorand.me

AMiT Kumar

unread,
May 11, 2015, 11:40:54 AM5/11/15
to sy...@googlegroups.com
Yes, It meant the same, though this function is available in Public API, 
but loosely speaking It was meant mostly for internal use with solve, 
that's why the name `gen` is used instead of symbol.


AMiT Kumar
3rd Year Undergrad
Delhi Technological University

Reply all
Reply to author
Forward
0 new messages