public class MIf extends PostfixMathCommand implements NaryOperatorI, MatrixSpecialEvaluationI
This function performs lazy evaluation so that only posExpr or negExpr will be evaluated. For Complex numbers only the real part is used.
An alternate form if(condExpr,posExpr,negExpr,zeroExpr) is also available. Note most computations are carried out over floating point doubles so testing for zero can be dangerous.
This function implements the SpecialEvaluationI interface so that it handles setting the value of a variable.
curNumberOfParameters, numberOfParameters| Constructor and Description |
|---|
MIf() |
| Modifier and Type | Method and Description |
|---|---|
Dimensions |
calcDim(Dimensions[] dims)
Find the dimension of this node.
|
MatrixValueI |
calcValue(MatrixValueI res,
MatrixValueI[] inputs)
This method should not be called.
|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
MatrixValueI |
evaluate(MatrixNodeI node,
MatrixEvaluator visitor,
MatrixJep j)
Evaluate the node, uses lazy evaluation.
|
checkStack, getNumberOfParameters, run, setCurNumberOfParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNumberOfParameters, run, setCurNumberOfParameterspublic Dimensions calcDim(Dimensions[] dims) throws ParseException
calcDim in interface NaryOperatorIParseExceptionpublic MatrixValueI calcValue(MatrixValueI res, MatrixValueI[] inputs) throws ParseException
evaluate(org.lsmp.djep.matrixJep.nodeTypes.MatrixNodeI, org.lsmp.djep.matrixJep.MatrixEvaluator, org.lsmp.djep.matrixJep.MatrixJep) instead.calcValue in interface NaryOperatorIParseExceptionpublic MatrixValueI evaluate(MatrixNodeI node, MatrixEvaluator visitor, MatrixJep j) throws ParseException
evaluate in interface MatrixSpecialEvaluationInode - The top node.visitor - The parser visitorj - The current MatrixJep instance.ParseExceptionpublic boolean checkNumberOfParameters(int n)
PostfixMathCommandcheckNumberOfParameters in interface PostfixMathCommandIcheckNumberOfParameters in class PostfixMathCommandn - number of parameters function will be called with.Copyright © 2018. All rights reserved.