|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.webcompmath.data.Cases
public class Cases
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.)
Constructor Summary | |
---|---|
Cases()
|
Method Summary | |
---|---|
void |
addCase(int value)
Add a new case value to the list stored in this object. |
void |
clear()
Remove all the cases that have been added with addCase(). |
boolean |
equals(Cases c)
Test whether c contains exactly the same list of case values as this Cases object does. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cases()
Method Detail |
---|
public void clear()
public void addCase(int value)
value
- value to addpublic boolean equals(Cases c)
c
- cases to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |