vmm3d.functions
Class ComplexFunction
- java.lang.Object
-
- vmm3d.functions.ComplexFunction
-
- Direct Known Subclasses:
- ComplexExpression, ComplexFunction1, ComplexFunction2, ComplexFunction3
public class ComplexFunction extends java.lang.ObjectRepresents a complex-valued function of any number of complex arguments. A ComplexFunction can only be created by aParser. This class has subclassesComplexExpression,ComplexFunction1,ComplexFunction2, andComplexFunction3, that represent functions of zero, one, two, and three arguments; the subclasses exist only to provide more naturalvalue()methods that take the expected number of arguments.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetArity()Gets the number of arguments that are required by this function.java.lang.StringgetName()Gets the name of this function.voidsetName(java.lang.String name)Changes the name of this function.Complexvalue(Complex[] argumentValues)Finds the value of the function at a specified list of argument values, using an EvalStack that is unique to the current Thread, allowing evaluation in a thread-safe manner.Complexvalue(Complex[] argumentValues, EvalStack stack)Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter.voidvalue(Complex[] argumentValues, EvalStack stack, Complex answer)Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter, and place the answer in an existing Complex object.Complexvalue(double... arg)Finds the value of the function at a specified list of argument values, using an EvalStack that is unique to the current Thread, allowing evaluation in a thread-safe manner.Complexvalue(double[] argumentValues, EvalStack stack)Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter.voidvalue(double[] argumentValues, EvalStack stack, Complex answer)Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter, and place the answer in an existing Complex object.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of this function. The name is specified inParser.parseComplexFunction(String, String, String[])and can be null.
-
setName
public void setName(java.lang.String name)
Changes the name of this function. The name should not be changed after the function has been added to a Parser; if it is, the parser will still use the old name.
-
getArity
public int getArity()
Gets the number of arguments that are required by this function.
-
value
public Complex value(Complex[] argumentValues)
Finds the value of the function at a specified list of argument values, using an EvalStack that is unique to the current Thread, allowing evaluation in a thread-safe manner.- Parameters:
argumentValues- the values of the arguments. The length of this array must be the same as the number of arguments of the function. If the function has arrity zero, then the argumentValues array can be null. The Complex objects in this array must be non-null.
-
value
public Complex value(double... arg)
Finds the value of the function at a specified list of argument values, using an EvalStack that is unique to the current Thread, allowing evaluation in a thread-safe manner.- Parameters:
arg- the values of the arguments. The number of arguments passed must be equal to the arity of the function multiplied by two. The real numbers passed to this method are grouped into pairs to produce the complex arguements that are passed to the function.
-
value
public Complex value(Complex[] argumentValues, EvalStack stack)
Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter.- Parameters:
argumentValues- the values of the arguments. The length of this array must be the same as the number of arguments of the function. If the function has arrity zero, then the argumentValues array can be null. The Complex objects in this array must be non-null.stack- the EvalStack that is used for computing the value.
-
value
public Complex value(double[] argumentValues, EvalStack stack)
Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter.- Parameters:
argumentValues- the values of the arguments. The length of the array must be equal to the arity of the function multiplied by two. The real numbers iin this array are grouped into pairs to produce the complex arguements that are passed to the function.stack- the EvalStack that is used for computing the value.
-
value
public void value(Complex[] argumentValues, EvalStack stack, Complex answer)
Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter, and place the answer in an existing Complex object.- Parameters:
argumentValues- the values of the arguments. The length of this array must be the same as the number of arguments of the function. If the function has arrity zero, then the argumentValues array can be null. The Complex objects in this array must be non-null.stack- the EvalStack that is used for computing the value.answer- the non-null Complex object where the value will be placed
-
value
public void value(double[] argumentValues, EvalStack stack, Complex answer)Finds the value of the function at a specified list of argument values, using an EvalStack that is passed as a parameter, and place the answer in an existing Complex object.- Parameters:
argumentValues- the values of the arguments. The length of the array must be equal to the arity of the function multiplied by two. The real numbers iin this array are grouped into pairs to produce the complex arguements that are passed to the function.stack- the EvalStack that is used for computing the value.answer- the non-null Complex object where the value will be placed
-
-
DMelt 3.0 © DataMelt by jWork.ORG