| Overview | Group | Tree | Graph | Index | Concepts |

An instance of this class represents a constrained integer variable in a
Concert Technology model.
If you are looking for a class of numeric variables that may assume
integer values and may be relaxed to assume floating-point values,
then consider the
class IloNumVar.
If you are looking for a class of binary decision variables
(that is, variables that assume only the values 0 (zero) or 1 (one),
then consider the class IloBoolVar.
Bounds of an Integer Variable
The lower and upper bound of an instance of this class is an integer.
If you are looking for a symbol to specify an infinite bound, that is,
no lower or upper bound, consider
IloIntMin or IloIntMax.
What Is Extracted
An instance of IloIntVar is extracted by
IloCP or IloSolver
as an instance of IlcIntVar.
An instance of IloIntVar is extracted by
IloCplex
as a column representing a numeric variable of
type Int with bounds
as specified by IloIntVar.
Most member functions in this class
contain assert statements. For an explanation
of the macro NDEBUG (a way to turn on or turn off these
assert statements), see the concept
Assert and NDEBUG.
IloIntVar or IloNumVar with
Type = Int)
in the constructors or via a modifier
(such as setUB, setLB,
setBounds), they are inwardly rounded to an integer value.
LB
is rounded down and UB is rounded up.See Also:
| Constructor Summary | |
|---|---|
public | IloIntVar() |
public | IloIntVar(IloNumVarI * impl) |
public | IloIntVar(IloEnv env, IloInt vmin=0, IloInt vmax=IloIntMax, const char * name=0) |
public | IloIntVar(const IloAddNumVar & var, IloInt lowerBound=0, IloInt upperBound=IloIntMax, const char * name=0) |
public | IloIntVar(const IloEnv env, const IloIntArray values, const char * name=0) |
public | IloIntVar(const IloAddNumVar & var, const IloIntArray values, const char * name=0) |
public | IloIntVar(const IloNumVar var) |
public | IloIntVar(const IloIntRange coll, const char * name=0) |
| Method Summary | |
|---|---|
public IloNumVarI * | getImpl() const |
public IloNum | getLB() const |
public IloInt | getMax() const |
public IloInt | getMin() const |
public IloNum | getUB() const |
public void | setBounds(IloInt lb, IloInt ub) const |
public void | setLB(IloNum min) const |
public void | setMax(IloInt max) const |
public void | setMin(IloInt min) const |
public void | setPossibleValues(const IloIntArray values) const |
public void | setUB(IloNum max) const |
Inherited Methods from IloIntExprArg |
|---|
getImpl |
Inherited Methods from IloNumExprArg |
|---|
getImpl |
Inherited Methods from IloExtractable |
|---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject |
| Constructor Detail |
|---|
This constructor creates an instance of IloIntVar like this:
IloNumVar(env, vmin, vmax, ILOINT, name);
This constructor creates an instance of IloIntVar like this:
IloNumVar(column, lowerBound, upperBound, ILOINT, name);
This constructor calls upon its corresponding IloNumVar constructor.
This constructor calls upon its corresponding IloNumVar constructor.
This constructor creates a new handle on var if it is of type
ILOINT. Otherwise, an exception is thrown.
This constructor creates an instance of IloIntVar from the given collection
This constructor creates an instance of IloIntVar from the given collection.
| Method Detail |
|---|
This member function returns the lower bound of the invoking variable.
This member function returns the maximal value of the invoking variable.
This member function returns the minimal value of the invoking variable.
This member function returns the upper bound of the invoking variable.
This member function sets lb as the lower bound and
ub as the upper bound of the invoking numeric variable.
setBounds notifies Concert
Technology algorithms about the change of bounds in this numeric variable.
This member function sets min as the lower bound of the invoking
variable.
setLB notifies Concert
Technology algorithms about the change of bounds in this numeric variable.
This member function returns the minimal value of the invoking variable
to max.
setMax notifies Concert
Technology algorithms about the change of bounds in this numeric variable.
This member function returns the minimal value of the invoking variable
to min.
setMin notifies Concert
Technology algorithms about the change of bounds in this numeric variable.
This member function sets values as the domain of the invoking
integer variable.
setPossibleValues notifies Concert
Technology algorithms about the change of bounds in this numeric variable.
This member function sets max as the upper bound of the invoking
variable.
setUB notifies Concert
Technology algorithms about the change of bounds in this numeric variable.