public class GenericComplexFunction extends Object implements de.jtem.mfc.field.Complex.FunctionOnComplex
ComplexFunction
.
This class uses an ExpressionConfiguration
holding an Expression
which represents the function's definition. A Variable
of
Type
ComplexType.TYPE
will be defined and stored in the
DefinitionModel
of the ExpressionConfiguration
.
That Variable
represents the function's parameter.
Another way to implement this could be using a UserDefinedFunction
.
Constructor and Description |
---|
GenericComplexFunction()
|
Modifier and Type | Method and Description |
---|---|
de.jtem.mfc.field.Complex |
eval(de.jtem.mfc.field.Complex z)
Evaluates this
ComplexFunction with z as the
current parameter value and returns the result as a new
Complex . |
void |
eval(de.jtem.mfc.field.Complex z,
de.jtem.mfc.field.Complex result)
Evaluates this
ComplexFunction with z as the
current parameter value and returns the result in result . |
String |
getComplexFunction()
Returns the
String representing the current function's
definition. |
void |
setComplexFunction(String newFunc)
Sets the function's defintion by parsing the specified
String . |
public GenericComplexFunction()
GenericComplexFunction
with ComplexType.TYPE
as the default evaluation Type
. That
Type
cannot and must not be changed.
Further more this constructor creates a new ExpressionConfiguration
representing the function's definition and defines a new Variable
representing the function's comlex parameter. The function will be
initialized to the following: f(z)=z
.
public de.jtem.mfc.field.Complex eval(de.jtem.mfc.field.Complex z)
ComplexFunction
with z
as the
current parameter value and returns the result as a new
Complex
.z
- the parameter value for the evaluation.ExpressionConfiguration.evaluateExpression()
public void eval(de.jtem.mfc.field.Complex z, de.jtem.mfc.field.Complex result)
ComplexFunction
with z
as the
current parameter value and returns the result in result
.eval
in interface de.jtem.mfc.field.Complex.FunctionOnComplex
z
- the parameter value for the evaluation.result
- the evaluation result will be assigned to this
Complex
.public String getComplexFunction()
String
representing the current function's
definition.String
representing the current function's
definition.public void setComplexFunction(String newFunc)
String
.newFunc
- the String
representing the function's
definition to be set.ExpressionConfiguration.setExpression(String)