Comment #45 on issue 821 by pr...@goodok.ru: multiple arguments for max and
other improvements
http://code.google.com/p/sympy/issues/detail?id=821
The first approach towards the LatticeOp have done.
But now it is draft in hierarchy style.
Never the less, all old accumulated tests are passed correctly now too.
More over, due to the LatticeOp behavior a new functionality is obtained,
like this:
>>> Max(x, y) == Max(y, x)
True
>>> Max(x, y, z) == Max(z, y, x)
True
>>> Max(x, Max(y, z))
Max(x, y, z)
>>> Max(x, Min(y, oo))
Max(x, y)
It has had to reimplement the main methods of LatticeOp in MinMaxBase
descendant.
Because LatticeOp has the one-pass cycle for checking the arguments with
lattice's Zero and Identity. And has not checking of `is_real`.
But dynamical algorithms require a few passes cycle.
Also similar boolean Or, And, Xor do permit empty arguments:
Or()
False
And()
True
Not()
IndexError Traceback (most recent call last)
Another problem was with dump serialization of Min Max:
./bin/test sympy/utilities/tests/test_pickling.py
de-serialization did not found the `_argset` attribute.
But since MinMax are not the Functions now, I remove them from checking.
Now I do not know how to deal with CompareFunction, ComparableObject, they
are emty now. I did not used them. Formally I can inherit Max and Min only
from the Basic, Application and MinMaxBase classes.
That is all now.
--
You received this message because you are subscribed to the Google Groups
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-patches?hl=en.