Relational Operators
In LINGO, relational operators are used in a model to specify whether the left-hand side of an expression should be equal to, less-than-or-equal-to, or greater-than-or-equal-to the right-hand side. Relational operators are used to form the constraints of a model. Relational operators are distinct from the logical operators #EQ#, #LE#, and #GE#, in that they tell LINGO that the results of the model must satisfy the direction of the relational operator. Logical operators, on the other hand, merely report whether or not a condition is satisfied.
Relational operators have the lowest priority of all the operators.
The three relational operators are described below:
Relational Operator |
Interpretation |
= |
The expression to the left must equal the one on the right. |
<= |
The expression to the left must be less-than-or-equal-to the expression on the right. |
>= |
The expression to the left must be greater-than-or-equal-to the expression on the right. |
LINGO will also accept "<" for less-than-or-equal-to and ">" for greater-than-or-equal-to.
Note: | LINGO does not directly support strictly less than and strictly greater than relational operators. In general, it would be unusual to find a good formulation that requires such a feature. However, if you want A to be strictly less than B: |
A < B,
then convert this expression to an equivalent less-than-or-equal-to expression as |
follows: |
A + ε ≤≤ B,
where ε is a small constant term whose value is dependent upon how much A must be |
"less than" B in order for you to consider them to be "not equal".