| An object of type Cases stores a list of "case values" that is generated
while an expression is being evaluated using the routine Expression.getValuesWithCases().
This information can be used as a heuristic (i.e. a fudge) to help detect
a possible discontinuity between two evaluations of the expression. Suppose
that the expression is evaluated twice, with some change of variable values
between the two evaluations. If the variables' values are not changed too much,
and if the Cases objects generated by the two evaluations are equal (as determined
by the "equals" method defined in this class), then it is likely that
there is no discontinuity. (However, this is not perfect. The discontinuity
in 1/x^2 won't be detected since the case value generated by 1/f(x) only
checks the sign of f(x), and the denominator of 1/x^2 is positive on both
sides of x=0. If you want to be more paranoid, check both the expression
and its derivative.) (I really don't like this very much, but it can be used to draw
pretty good graphs in general.)
|