Skip to main content
FRAMES NO FRAMES

Class IloIntVar

Definition file: ilconcert/iloexpression.h
Map of IloIntVarIloIntVarIloBoolVarIloIntVarIloIntExprArgIloNumExprArgIloExtractable
An instance of this class represents a constrained integer variable in a Concert Technology model.

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.

Note
When numeric bounds are given to an integer variable (an instance of 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 up and UB is rounded down.

See Also:

Method Summary
public IloNumVarI *getImpl() const
public IloNumgetLB() const
public IloIntgetMax() const
public IloIntgetMin() const
public IloNumgetUB() const
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)
public voidsetBounds(IloInt lb, IloInt ub) const
public voidsetLB(IloNum min) const
public voidsetMax(IloInt max) const
public voidsetMin(IloInt min) const
public voidsetPossibleValues(const IloIntArray values) const
public voidsetUB(IloNum max) const
Inherited Methods from IloIntExprArg
getImpl, IloIntExprArg, IloIntExprArg
Inherited Methods from IloNumExprArg
getImpl, IloNumExprArg, IloNumExprArg
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, IloExtractable, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, removeFromAll, setLocation, setName, setObject
Method Detail

IloIntVar

public IloIntVar()
This constructor creates an empty handle. You must initialize it before you use it.

IloIntVar

public IloIntVar(IloNumVarI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloIntVar

public IloIntVar(IloEnv env, IloInt vmin=0, IloInt vmax=IloIntMax, const char * name=0)

This constructor creates an instance of IloIntVar like this:

IloNumVar(env, vmin, vmax, ILOINT, name);

IloIntVar

public IloIntVar(const IloAddNumVar & var, IloInt lowerBound=0, IloInt upperBound=IloIntMax, const char * name=0)

This constructor creates an instance of IloIntVar like this:

IloNumVar(column, lowerBound, upperBound, ILOINT, name);

Not for use with CP Optimizer.


IloIntVar

public IloIntVar(const IloEnv env, const IloIntArray values, const char * name=0)

This constructor calls upon its corresponding IloNumVar constructor.


IloIntVar

public IloIntVar(const IloAddNumVar & var, const IloIntArray values, const char * name=0)

This constructor calls upon its corresponding IloNumVar constructor.

Not for use with CP Optimizer.


IloIntVar

public IloIntVar(const IloNumVar var)

This constructor creates a new handle on var if it is of type ILOINT. Otherwise, an exception is thrown.


IloIntVar

public IloIntVar(const IloIntRange coll, const char * name=0)

This constructor creates an instance of IloIntVar from the given collection

This constructor creates an instance of IloIntVar from the given collection.

Not for use with CP Optimizer.


getImpl

public IloNumVarI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.

getLB

public IloNum getLB() const

This member function returns the lower bound of the invoking variable.


getMax

public IloInt getMax() const

This member function returns the maximal value of the invoking variable.


getMin

public IloInt getMin() const

This member function returns the minimal value of the invoking variable.


getUB

public IloNum getUB() const

This member function returns the upper bound of the invoking variable.


setBounds

public void setBounds(IloInt lb, IloInt ub) const

This member function sets lb as the lower bound and ub as the upper bound of the invoking numeric variable.

Note
The member function setBounds notifies Concert Technology algorithms about the change of bounds in this numeric variable.

setLB

public void setLB(IloNum min) const

This member function sets min as the lower bound of the invoking variable.

Note
The member function setLB notifies Concert Technology algorithms about the change of bounds in this numeric variable.

setMax

public void setMax(IloInt max) const

This member function set the maximal value of the variable to max.

Note
The member function setMax notifies Concert Technology algorithms about the change of bounds in this numeric variable.

setMin

public void setMin(IloInt min) const

This member function set the minimal value of the variable to min.

Note
The member function setMin notifies Concert Technology algorithms about the change of bounds in this numeric variable.

setPossibleValues

public void setPossibleValues(const IloIntArray values) const

This member function sets values as the domain of the invoking integer variable. It is available only for constraint programming optimizers, such as CP Optimizer.

Note
The member function setPossibleValues notifies Concert Technology algorithms about the change of bounds in this numeric variable.

setUB

public void setUB(IloNum max) const

This member function sets max as the upper bound of the invoking variable.

Note
The member function setUB notifies Concert Technology algorithms about the change of bounds in this numeric variable.