NO FRAMES

Class IloIntVar

Definition file: ilconcert/iloexpression.h

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.

What Is Extracted

An instance of IloIntVar is extracted by IloSolver (documented in the ILOG Solver Reference Manual) as an instance of IlcIntVar (also documented in the ILOG Solver Reference Manual).

An instance of IloIntVar is extracted by IloCplex (documented in the ILOG CPLEX Reference Manual) as a column representing a numeric variable of type Int with bounds as indicated 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 numerical bounds are given to an integer variable (an IloIntVar or an IloNumVar with Type = Int) in the constructors of via a modifier (setUB, setLB, setBounds), they are inward rounded to an integer value. LB is rounded down and UB is rounded up.

See Also:

Constructor Summary
public IloIntVar()
public IloIntVar(IloIntVar::ImplClass *)
public IloIntVar(IloEnv, IloInt, IloInt, const char *)
public IloIntVar(const IloAddNumVar &, IloInt, IloInt, const char *)
public IloIntVar(const IloEnv, const IloIntArray, const char *)
public IloIntVar(const IloAddNumVar &, const IloIntArray, const char *)
public IloIntVar(const IloNumVar)
Method Summary
public IloIntVar::ImplClass *getImpl()
public IloNumgetLB()
public IloIntgetMax()
public IloIntgetMin()
public IloNumgetUB()
public voidsetBounds(IloInt, IloInt)
public voidsetLB(IloNum)
public voidsetMax(IloInt)
public voidsetMin(IloInt)
public voidsetPossibleValues(const IloIntArray)
public voidsetUB(IloNum)
Inherited Methods from IloIntExprArg
getImpl
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
end, getEnv, getId, getImpl, getName, getObject, setName, setObject
Constructor Detail

IloIntVar

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

IloIntVar

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

IloIntVar

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

This constructor creates an instance of IloIntVar like this:

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

IloIntVar

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

This constructor creates an instance of IloIntVar like this:

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

IloIntVar

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

This constructor calls upon its corresponding IloNumVar constructor.


IloIntVar

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

This constructor calls upon its corresponding IloNumVar constructor.


IloIntVar

public IloIntVar(const IloNumVar var)

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


Method Detail

getImpl

public IloIntVar::ImplClass * getImpl()
This member function returns a pointer to the implementation object of the invoking handle.

getLB

public IloNum getLB()

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


getMax

public IloInt getMax()

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


getMin

public IloInt getMin()

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


getUB

public IloNum getUB()

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


setBounds

public void setBounds(IloInt lb, IloInt ub)

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)

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)

This member function returns the minimal value of the invoking 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)

This member function returns the minimal value of the invoking 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)

This member function sets values as the domain of the invoking integer variable.

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

setUB

public void setUB(IloNum max)

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.