[sympy] Multiple inequalities in a single Python expression?

2012-01-07 Thread Kevin Hunter
Hullo Sympy Group, How can I get Sympy to recognize 2+ inequalities in the same expression? In mathematical optimization it is common to see (and often very convenient to use) constraint expressions like these: *3*x <= 2*y +10 <= 3*z* *10*x >= 15*y >= 20*z >= t* Which are actually 2 and 3 ine

Re: [sympy] Multiple inequalities in a single Python expression?

2012-01-07 Thread Aaron Meurer
Hi. There's an issue for this too: http://code.google.com/p/sympy/issues/detail?id=2960 Python evaluates "a < b < c" as "(a < b) and (b < c)". Since it's impossible to override the "and" operator, this always returns the first one if it evaluate to True or the second one if it evaluate to True (

Re: [sympy] Multiple inequalities in a single Python expression?

2012-01-07 Thread Kevin Hunter
Hmm, so I have some example code that I just threw together that implements a multiple inequality. It isn't pretty in that I spent 5 minutes working it, and it uses a global, etc., but it's a proof of concept: - *In [1]: a, b, c, d = test('A'), test('B'), test('C'), test('D')* * * *In [2]:

Re: [sympy] Multiple inequalities in a single Python expression?

2012-01-07 Thread Christophe BAL
Hello, I am interested by your code. Christophe. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more o

Re: [sympy] Multiple inequalities in a single Python expression?

2012-01-07 Thread Aaron Meurer
Hi. I posted my comments on the issue page. Aaron Meurer On Sat, Jan 7, 2012 at 4:16 AM, Kevin Hunter wrote: > Hmm, so I have some example code that I just threw together that implements > a multiple inequality.  It isn't pretty in that I spent 5 minutes working > it, and it uses a global, etc.