Function condition( flagArray, trueValue, falseValue )

Description:
Maps a boolean array to a numeric array by using supplied numeric values to represent true and false values from the input array.

This has the same effect as applying the expression outArray[i] = flagArray[i] ? trueValue : falseValue.

Parameters:
flagArray (array of boolean)
array of boolean values
trueValue (floating point)
output value corresponding to an input true value
falseValue (floating point)
output value corresponding to an input false value
Return Value (array of floating point):
output numeric array, same length as flagArray
Example:
condition([true, false, true], 1, 0) = [1, 0, 1]
Signature:
double[] condition(boolean[], double, double)