Quantcast
Channel: Keep the gradient flowing
Viewing all articles
Browse latest Browse all 195

Initial implementation of the query system

$
0
0

I sent some patches to sympy-patches with an initial implementation of the query system. You can check it out by pulling from my branch: git pull http://fseoane.net/git/sympy.git master into your sympy repo. Some examples of what you can do (sample isympy session): In [1]: query(x, positive=True) Returns None, as we do not know whether x is positive or not. `` In [2]: query(abs(x), positive=True) Out[2]: True`` because abs() is always positive. Because exp() is always positive, the following should also be True: `` In [3]: query(exp(x), positive=True)`` but why then does it return None ?. Well, it simply is not True that exp() is always positive, it is always positive for real values, but SymPy does not assume that x is real, so you would have to specify that. This is now done with the keyword assumptions: `` In [5]: query(exp(x), positive=True, assumptions=Assume(x, real=True)) Out[5]: True`` As you can see, now assumptions are independent objects and are not tied to symbols any more. For more examples, see the file sympy/query/tests/test_query.py still in the TODO list: - support for global assumptions - solve more complex implications, like query(x, positive=True, assumptions=Assume(x, even=True)) where it should build the chain of implications even => integer => rational => real. This chain of implications currently stops at rational for efficiency reasons, because the number of facts grows in each step which makes the number of possible paths grow exponentially.


Viewing all articles
Browse latest Browse all 195

Trending Articles


Girasoles para colorear


mayabang Quotes, Torpe Quotes, tanga Quotes


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Long Distance Relationship Tagalog Love Quotes


Tagalog Quotes To Move on and More Love Love Love Quotes


5 Tagalog Relationship Rules


Best Crush Tagalog Quotes And Sayings 2017


Re:Mutton Pies (lleechef)


FORECLOSURE OF REAL ESTATE MORTGAGE


Sapos para colorear


tagalog love Quotes – Tiwala Quotes


Break up Quotes Tagalog Love Quote – Broken Hearted Quotes Tagalog


Patama Quotes : Tagalog Inspirational Quotes


Pamatay na Banat and Mga Patama Love Quotes


Tagalog Long Distance Relationship Love Quotes


BARKADA TAGALOG QUOTES


“BAHAY KUBO HUGOT”


Vimeo 10.7.0 by Vimeo.com, Inc.


Vimeo 10.7.1 by Vimeo.com, Inc.