Variable Domain Functions

Unless specified otherwise, variables in a LINGO model default to being non-negative and continuous. More specifically, variables can assume any real value from zero to positive infinity. In many cases, this default domain for a variable may be inappropriate. For instance, you may want a variable to assume negative values, or you might want a variable restricted to purely integer values. LINGO provides nine variable domain functions, which allow you to override the default domain of a variable, and, in the case of @POSD, the domain of a matrix of variables. The names of these functions and a brief description of their usage are:

@GIN restricts a variable to being an integer value
@BIN makes a variable binary (i.e., 0 or 1)
@FREE allows a variable to assume any real value, positive or negative
@BND limits a variable to fall within a finite range
@SOS defines a set of binary variables and places restrictions on their collective values
@CARD defines a set of binary variables and places an upper limit on their sum
@SEMIC restricts variables to being either zero or greater-than a specified constant
@PRIORITYused to assign branching priorities to variables.
@POSDrestricts a square matrix to being symmetric matrix and positive semi-definite
@ALLDIFFrequires a specified set of variables to taking on different integer values

In the remainder of this section, we'll investigate the mechanics of using these functions, and present a number of examples illustrating their usage.