|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--math.objects.Expression | +--math.objects.Constant | +--math.constants.IntegerConstant
The class Constant is used to create mathematical Constant objects. It extends the Expression class.
Constructor Summary | |
IntegerConstant(IntegerConstant value)
Copy constructor to create new integer constant. |
|
IntegerConstant(long value)
Constructor to create a new integer constant. |
Method Summary | |
java.lang.Object |
clone()
Create a copy of this. |
boolean |
equals(java.lang.Object o)
Checks to see if the objects are equal. |
double |
evaluate(VariableSet vars,
double[] values)
A method used to evaluate a Constant object given an ordered variable vector and a corresponding array of constant double values |
Expression |
evaluateVariables(VariableSet variables,
double[] values)
A method used to evaluate a Constant object containing multiple variables given only one variable name and one value |
long |
getValue()
Returns the integer that this represenets. |
java.lang.String |
toString()
Overrides the toString() method of the Object class. |
Methods inherited from class math.objects.Constant |
differentiate, simplify |
Methods inherited from class math.objects.Expression |
evaluate, evaluate, evaluate, evaluate, evaluate |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IntegerConstant(long value)
value
- the Constant will representpublic IntegerConstant(IntegerConstant value)
value
- the new constant for this.Method Detail |
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare this to.
true
if o is an IntegerConstant and is equal
to this, otherwise false
is returned.public long getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public double evaluate(VariableSet vars, double[] values) throws java.lang.ArithmeticException, VariableUndefinedException, IllegalEvaluationException
evaluate
in class Expression
vars
- the name of the VariableVector of Variables
associated with the function.
VariableUndefinedException
- for Variables not defined
java.lang.ArithmeticException
- for NaN and Divide by Zero
IllegalEvaluationException
- if an error occurspublic Expression evaluateVariables(VariableSet variables, double[] values) throws java.lang.ArithmeticException, IllegalEvaluationException
evaluateVariables
in class Expression
variables
- a VariableSet
valuevalues
- a double[]
value
java.lang.ArithmeticException
- for NaN and Divide by Zero
IllegalEvaluationException
- if an error occurs
|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |