jsci.maths.symbolic
Class Variable
- java.lang.Object
-
- jsci.maths.symbolic.Expression
-
- jsci.maths.symbolic.Variable
-
- All Implemented Interfaces:
- java.io.Serializable, Field.Member, Ring.Member, AbelianGroup.Member, Member
public class Variable extends Expression
Variables in an Expression.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Variable(java.lang.String n, java.lang.Object valueSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Expressiondifferentiate(Variable x)Differentiation of the expression with respect to a variablebooleanequals(java.lang.Object o)Expressionevaluate()This method substitutes the variable with the variable values, if non-null; they can beContants or otherExpressions.java.lang.ObjectgetSet()MembergetValue()Get the value of the variable.voidsetValue(Member o)Set the value of the variable.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Variable
public Variable(java.lang.String n, java.lang.Object valueSet)- Parameters:
n- the name (symbol) of the variablevalueSet- the set to which the variable values belong, e.g. RealField.getInstance(). Note it is not the Class of the values (odd thing indeed).
-
-
Method Detail
-
setValue
public void setValue(Member o)
Set the value of the variable.- Parameters:
o- the value; can be null to unset the variable
-
getValue
public Member getValue()
Get the value of the variable.- Returns:
- the value of the variable; null if the variable is unset.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
differentiate
public Expression differentiate(Variable x)
Description copied from class:ExpressionDifferentiation of the expression with respect to a variable- Specified by:
differentiatein classExpression- Parameters:
x- the variable
-
evaluate
public Expression evaluate()
Description copied from class:ExpressionThis method substitutes the variable with the variable values, if non-null; they can beContants or otherExpressions. Simplification is performed.- Specified by:
evaluatein classExpression- Returns:
- the evaluated Expression. Can be a Constant.
-
getSet
public java.lang.Object getSet()
-
-
DMelt 3.0 © DataMelt by jWork.ORG