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.
curNumberOfParameters, numberOfParameters| 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.
|
checkStack, getNumberOfParameters, run, setCurNumberOfParameterspublic boolean checkNumberOfParameters(int n)
PostfixMathCommandcheckNumberOfParameters in interface PostfixMathCommandIcheckNumberOfParameters in class PostfixMathCommandn - number of parameters function will be called with.public Object evaluate(Node node, EvaluatorI pv) throws ParseException
CallbackEvaluationIpv.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 CallbackEvaluationInode - The current nodepv - The visitor, can be used evaluate the childrenParseExceptionCopyright © 2018. All rights reserved.