-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bool, relational: added as_set method #2781
Conversation
Cool! What is the behavior of the following?
Note that |
""" | ||
Rewrite logic operators and relationals in terms of real sets. | ||
|
||
>>> from sympy import false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert
Examples
========
(even for a single test spell it with an S)
Should this be implemented using a |
At the time you commented it was giving the wrong result as |
No. But, perhaps, it does matter in which order I have run the above statements.
Which one? I don't see any difference:
|
Sorry but I couldn't understand your comment. What I meant was that the code was buggy the time Matthew asked for the result of The code on my system is raising the correct error (with an unintentional typo). I don't know why we are getting different results. See the lines of code which raises error here: https://github.com/sympy/sympy/pull/2781/files#diff-cf47a176c69dd7d5e3225858891e091cR288
|
On Fri, Jan 17, 2014 at 05:00:39AM -0800, Harsh Gupta wrote:
Sorry. That was my bad, perhaps, I've not run git fetch. |
I mostly followed tradition. The benefits I've seen though are shared docstrings and the ability to enforce code at the superclass level (see |
`as_set` is the inverse method for existing `as_relational` method for sets. `as_set` converts a univariate boolean or relational expression to real set. Example: In [1]: from sympy import And, Or In [2]: from sympy.abc import x In [3]: And(x<2, x>-2).as_set() Out[3]: (-2, 2) In [4]: (x**2 > 4).as_set() Out[4]: (-oo, -2) U (2, oo)
There was a typo in 'multivariate', I have fixed it. |
Travis is being timed out. Is there anything that I do about it? |
bool, relational: added as_set method
Thanks. This is in. |
as_set
is the inverse method for existingas_relational
method for sets.
as_set
converts a univariate boolean orrelational expression to real set.
Example: