|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nfunk.jep.function.PostfixMathCommand org.lsmp.djep.vectorJep.function.VMap org.lsmp.djep.matrixJep.function.MMap
public class MMap
Field Summary |
---|
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand |
---|
curNumberOfParameters, numberOfParameters |
Constructor Summary | |
---|---|
MMap()
|
Method Summary | |
---|---|
MatrixValueI |
evaluate(MatrixNodeI node,
MatrixEvaluator visitor,
MatrixJep jep)
Returns the result of evaluating this node and the tree below. |
MatrixNodeI |
preprocess(ASTFunNode node,
MatrixPreprocessor visitor,
MatrixJep jep,
MatrixNodeFactory nf)
Subverts the preprocessing stage. |
Methods inherited from class org.lsmp.djep.vectorJep.function.VMap |
---|
calcDim, calcValue, checkNumberOfParameters, evaluate, getVars |
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand |
---|
checkStack, getNumberOfParameters, run, setCurNumberOfParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.nfunk.jep.function.PostfixMathCommandI |
---|
getNumberOfParameters, run, setCurNumberOfParameters |
Constructor Detail |
---|
public MMap()
Method Detail |
---|
public MatrixNodeI preprocess(ASTFunNode node, MatrixPreprocessor visitor, MatrixJep jep, MatrixNodeFactory nf) throws ParseException
SpecialPreProcessorI
MatrixNodeI children[] = visitor.visitChildrenAsArray(node,null);The final step is to construct a node of the correct type. The MatrixNodeFactory argument has a number of methods to do this. For example
return (ASTMFunNode) nf.buildOperatorNode(node.getOperator(),children,rhsDim);Note how the dimension is specified.
preprocess
in interface SpecialPreProcessorI
node
- the top node of the tree representing the function and its arguments.visitor
- A reference to the preprocessing visitor.jep
- A reference of the MatrixJep instance.nf
- A reference to the node factory object.
ParseException
- if some error occurs.public MatrixValueI evaluate(MatrixNodeI node, MatrixEvaluator visitor, MatrixJep jep) throws ParseException
MatrixSpecialEvaluationI
MatrixValueI val = (MatrixValueI) node.jjtGetChild(i).jjtAccept(visitor,null);for each child.
The final results should be copied into the mvalue field of the node using
MatrixValueI mvalue = node.getMValue(); mvalue.setEles(res); return mvalue;
evaluate
in interface MatrixSpecialEvaluationI
node
- The top node.visitor
- The parser visitorjep
- The current MatrixJep instance.
ParseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |