Comparator
Overview
The Comparator operator compares the sample value on the upper input (S1), to the sample value of the lower input (S2).If the result of the comparison is true, the output sample value is set to the value 1. Otherwise the output is set to the value 0.
Operator ports
Input S1: Floating point valuesInput S2: Floating point values
Output : Floating point values
Properties
Find more information about changing properties here: "Properties Viewer"Method
type: Select from the listSelect the comparison function from the drop-down list.
Select one of those presets:
Equal
Put out True if S1 equals S2
Unequal
Put out True if S1 is unequal to S2
GreaterOrEqual
Put out True if S1 greater than or equal to S2
SmallerOrEqual
Put out True if S1 less than or equal to S2
Greater
Put out True if S1 greater than S2
Smaller
Put out True if S1 is less than S2
Equal
Put out True if S1 equals S2
Unequal
Put out True if S1 is unequal to S2
GreaterOrEqual
Put out True if S1 greater than or equal to S2
SmallerOrEqual
Put out True if S1 less than or equal to S2
Greater
Put out True if S1 greater than S2
Smaller
Put out True if S1 is less than S2
Equality range
type: See descriptionDefines a range of imprecision when comparing two slightly different values.
Any comparison using equality will return true if two values are equal, or if one value falls within the range of the second value ± R, where R is the Equality Range.
Documentation
type: See descriptionOptional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.
Details
If both inputs have an equal amount of channels, the comparison is done between each channel on the first input, and the corresponding channel on the second input. The result is put out on the corresponding output channel.If one of the inputs contains only one channel, the values of that channel are compared with all channels of the other input. The output will then contain as many channels as the input with more than one channel.
If the inputs contain an unequal number of channels (except one), the output will always be 0. An error message is then displayed below the symbol.
Precision modifier 'equality range'
Because the Comparator compares floating point values, in some cases two values that seem equal are slightly different. The Comparator has the option to specify a range of imprecision (since Polybench 1.34) to validate two values equal, also if they are slightly unequal.For more information see the Equality Range property.