java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.lsmp.djep.matrixJep.function.MIf
All Implemented Interfaces:
MatrixSpecialEvaluationI, NaryOperatorI, PostfixMathCommandI

public class MIf extends PostfixMathCommand implements NaryOperatorI, MatrixSpecialEvaluationI
The if(condExpr,posExpr,negExpr) function. The value of trueExpr will be returned if condExpr is >0 (true) and value of negExpr will be returned if condExpr is <= 0 (false).

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.

Author:
Rich Morris Created on 18-Nov-2003