public class GenMat extends PostfixMathCommand implements CallbackEvaluationI
GenMat(3,1) -> [1,1,1] GenMat(3,ii,ii) -> [1,2,3] GenMat(3,rand()) -> [0.343,0.974,0.567] GenMat([2,2],ii+jj,[ii,jj]) -> [[2,3],[3,4]]Note the free variables should not be the same name as variables already in use, in particular i is often set to be the complex root of unity, and should be avoided.
Constructor and Description |
---|
GenMat() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
Object |
evaluate(Node node,
EvaluatorI pv)
Performs some special evaluation on the node.
|
getNumberOfParameters, run, setCurNumberOfParameters
public boolean checkNumberOfParameters(int n)
PostfixMathCommand
checkNumberOfParameters
in interface PostfixMathCommandI
checkNumberOfParameters
in class PostfixMathCommand
n
- number of parameters function will be called with.public Object evaluate(Node node, EvaluatorI pv) throws ParseException
CallbackEvaluationI
pv.eval(node.jjtGetChild(i))for each child. The SymbolTable is not passed as an argument. This is because it is better practice to get and set variable values by using node.getVar().setValue() rather that through the SymbolTable with requires a hashtable lookup.
evaluate
in interface CallbackEvaluationI
node
- The current nodepv
- The visitor, can be used evaluate the childrenParseException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics