Comment #55 on issue 1695 by [email protected]: integral of a piecewise  
function gives bad result
http://code.google.com/p/sympy/issues/detail?id=1695

Not yet, sorry. There would be 3^4 testcases for union, and intersection  
should have
been written without using complement, if we would want them to be  
substantial. The
code is not yet covers all cases (raises NoUnion error for the not covered  
ones though).

Maybe when I will back to my mechanics studies, I will do further work, but  
do not
hold your breath.
The work to be done as I see it now:
Write up a carnaugh-chart-like table for 4 cases (a<c,a=c,a>c,unknown) for  
four
arguments (2 relations with 2 sides each) with more than 3 possible  
outcomes (self,
other, NounionError, and the special cases). Do it at least for inequality  
vs
inequality, equality vs equality, and equality vs inequality (counting
strictinequality as inequality, and unequality as equality), and for both
intersection and union.
Check the charts for symmetry properties to spot errors.
Code it with huge elseif branches, place it somewhere in relational.py, and  
write the
glue for the individual classes.
After it is done in the proper way, test cases would mean something.
I think it is a tedious work. Maybe there are better alternatives, but  
could not find
one yet. Any suggestions are welcome.

Well, the current code works more or less well, most certainly better than  
before,
but there are cases when a boolean expression containing relations would  
not get
simplified well, or drive the program into an endless loop.

You can use these as a starter for docstrings:


complement returns the complement of a relation: not self
( x > y ).complement() becomes x <= y

union returns the union of two relations: a relation for which either self  
or other
is holding: self|other
it tries to simplify the relation
( x > 1).union(x >= 3) becomes x > 1


listizeset returns a list of intervals contained in a Set

deinterval looks if an Interval has one point. if it is, then returns the  
point as a
real number, else returns the interval itself

setizelist takes a list of intervals and real numbers, and returns one Set  
containing all

_pw_vs_pw folds (f o g) in the case where both f and g are piecewise  
functions
it was a sadly missing functionality of piecewise_fold


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--

You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.


Reply via email to