Class LambdaFunction
- java.lang.Object
-
- com.singularsys.jep.functions.PostfixMathCommand
-
- com.singularsys.jep.misc.MacroFunction
-
- com.singularsys.extensions.lambda.LambdaFunction
-
- All Implemented Interfaces:
JepComponent
,PostfixMathCommandI
,java.io.Serializable
public class LambdaFunction extends MacroFunction
PostfixMathCommand for lambda functions defined by string expressions. Very similar toMacroFunction
but changes the way its printed.- Since:
- Extensions 2.1
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.singularsys.jep.misc.MacroFunction
ev, expression, nParam, preCompiled, topNode, varNames, vars
-
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters
-
-
Constructor Summary
Constructors Constructor Description LambdaFunction(Jep jep, java.lang.String funName, java.lang.String[] parameters, java.lang.String expression)
Create a function with two or more arguments defined by an expression.LambdaFunction(Jep jep, java.lang.String funName, java.lang.String parameter, java.lang.String expression)
Create a function with a single arguments defined by an expression.LambdaFunction(java.lang.String funName, java.lang.String[] parameters, java.lang.String expression)
Create a function with two or more arguments defined by an expression.LambdaFunction(java.lang.String funName, java.lang.String[] parameters, java.lang.String expression, Node root)
Create a function with a node tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
Prints the function in the form[x,y]=>x^2+y^2
-
Methods inherited from class com.singularsys.jep.misc.MacroFunction
getLightWeightInstance, getParameterNames, getTopNode, getVars, init, run
-
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString
-
-
-
-
Constructor Detail
-
LambdaFunction
public LambdaFunction(Jep jep, java.lang.String funName, java.lang.String parameter, java.lang.String expression)
Create a function with a single arguments defined by an expression.- Parameters:
jep
- The jep instancefunName
- name of the functionparameter
- the name of the formal parameter.expression
-
-
LambdaFunction
public LambdaFunction(Jep jep, java.lang.String funName, java.lang.String[] parameters, java.lang.String expression)
Create a function with two or more arguments defined by an expression.- Parameters:
jep
- The jep instancefunName
- name of the functionparameters
- an array of the formal parameter names used by the functionexpression
-
-
LambdaFunction
public LambdaFunction(java.lang.String funName, java.lang.String[] parameters, java.lang.String expression)
Create a function with two or more arguments defined by an expression. Use this method for recursive functions like factorial. TheMacroFunction.init(Jep)
method must be called after the function is added to the function table, which will recompile the function.- Parameters:
funName
- name of the functionparameters
- an array of the formal parameter names used by the functionexpression
-
-
LambdaFunction
public LambdaFunction(java.lang.String funName, java.lang.String[] parameters, java.lang.String expression, Node root)
Create a function with a node tree. The ImportationVisitor is used to convert the tree into context for this object.- Parameters:
funName
- function nameparameters
- list of parametersexpression
- string representation of equationroot
- root of expressions tree.
-
-
Method Detail
-
toString
public java.lang.String toString()
Prints the function in the form[x,y]=>x^2+y^2
- Overrides:
toString
in classMacroFunction
-
-