Skip to main content
FRAMES NO FRAMES

Class IlcIntVarArray

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcIntVarArrayIlcIntVarArrayIlcIntVarArray
The array class for the class IlcIntVar.

The class IlcIntVarArray is the class for an array of instances of IlcIntVar. Instances of this class are arrays indexed from 0.

See Also:

Method Summary
public IlcIntVarArraygetCopy() const
public IlcIntVarArrayI *getImpl() const
public IlcIntgetMaxMax() const
public IlcIntgetMaxMax(IlcInt indexMin, IlcInt indexMax) const
public IlcIntgetMaxMin() const
public IlcIntgetMaxMin(IlcInt indexMin, IlcInt indexMax) const
public IlcIntgetMinMax() const
public IlcIntgetMinMax(IlcInt indexMin, IlcInt indexMax) const
public IlcIntgetMinMin() const
public IlcIntgetMinMin(IlcInt indexMin, IlcInt indexMax) const
public IlcIntgetSize() const
public IlcIntVarArray(IlcIntVarArrayI * impl=0)
public IlcIntVarArray(IlcCPEngine solver, IlcInt size)
public IlcIntVarArray(IlcCPEngine solver, IlcInt size, const IlcIntVar exp...)
public IlcIntVarArray(IlcCPEngine solver, IlcInt size, IlcInt min, IlcInt max)
public IlcIntExpoperator[](const IlcIntExp exp) const
public IlcIntVar &operator[](IlcInt index) const
Method Detail

IlcIntVarArray

public IlcIntVarArray(IlcIntVarArrayI * impl=0)

This constructor creates a handle object from a pointer to an implementation object. If the implementation object is zero, you must initialize the handle before using it.


IlcIntVarArray

public IlcIntVarArray(IlcCPEngine solver, IlcInt size)

This constructor creates an uninitialized array of length size. The argument size must be strictly greater than 0 (zero). The index range of the array is [0 size). Each element of the array must be assigned before the array can be used.


IlcIntVarArray

public IlcIntVarArray(IlcCPEngine solver, IlcInt size, const IlcIntVar exp...)

This constructor creates an array of sets; the length of that array is size; its elements are initialized with the arguments of type IlcIntVar. The number of arguments of type IlcIntVar must be the same as size.


IlcIntVarArray

public IlcIntVarArray(IlcCPEngine solver, IlcInt size, IlcInt min, IlcInt max)

This constructor creates an array of size constrained integer variables. The argument size must be strictly greater than 0 (zero). Each constrained integer variable has a domain containing all integer values between min and max.


getCopy

public IlcIntVarArray getCopy() const

This member function returns a copy of the invoking array of constrained variables and associates that copy with the CP Optimizer object passed at construction time.


getImpl

public IlcIntVarArrayI * getImpl() const

This member function returns a pointer to the implementation object of the invoking handle.


getMaxMax

public IlcInt getMaxMax() const

This member function returns the largest of the maximal values of the variables belonging to the invoking array of constrained integer variables.


getMaxMax

public IlcInt getMaxMax(IlcInt indexMin, IlcInt indexMax) const

This member function returns the largest of the maximal values of the variables belonging to the invoking array of constrained integer variables. When the arguments indexMin and indexMax are provided, only those variables that correspond to indices in the range [indexMin indexMax) are considered. CP Optimizer will throw an exception (an instance of IloException with the message "bad index interval" if the given indexMin and indexMax are not valid indices for the invoking array of constrained variables or if indexMin is not strictly less than indexMax.


getMaxMin

public IlcInt getMaxMin() const

This member function returns the largest of the minimal values of the variables belonging to the invoking array of constrained integer variables.


getMaxMin

public IlcInt getMaxMin(IlcInt indexMin, IlcInt indexMax) const

This member function returns the largest of the minimal values of the variables belonging to the invoking array of constrained integer variables. The arguments indexMin and indexMax are provided, only those variables that correspond to indices in the range [indexMin indexMax) are considered. CP Optimizer will throw an exception (an instance of IloException with the message "bad index interval" if the given indexMin and indexMax are not valid indices for the invoking array of constrained variables or if indexMin is not strictly less than indexMax.


getMinMax

public IlcInt getMinMax() const

This member function returns the smallest of the maximal values of the variables belonging to the invoking array of constrained integer variables.


getMinMax

public IlcInt getMinMax(IlcInt indexMin, IlcInt indexMax) const

This member function returns the smallest of the maximal values of the variables belonging to the invoking array of constrained integer variables. The arguments indexMin and indexMax are provided, only those variables that correspond to indices in the range [indexMin indexMax) are considered. CP Optimizer will throw an exception (an instance of IloException with the message "bad index interval" if the given indexMin and indexMax are not valid indices for the invoking array of constrained variables or if indexMin is not strictly less than indexMax.


getMinMin

public IlcInt getMinMin() const

This member function returns the smallest of the minimal values of the variables belonging to the invoking array of constrained integer variables.


getMinMin

public IlcInt getMinMin(IlcInt indexMin, IlcInt indexMax) const

This member function returns the smallest of the minimal values of the variables belonging to the invoking array of constrained integer variables. The arguments indexMin and indexMax are provided, only those variables that correspond to indices in the range [indexMin indexMax) are considered. CP Optimizer will throw an exception (an instance of IloException with the message "bad index interval" if the given indexMin and indexMax are not valid indices for the invoking array of constrained variables or if indexMin is not strictly less than indexMax.


getSize

public IlcInt getSize() const

This member function returns the number of variables in the invoking array.


operator[]

public IlcIntExp operator[](const IlcIntExp exp) const

This subscripting operator returns a constrained integer expression. For clarity, let's call A the invoking array. When exp is fixed to the value i, then the domain of the expression is the domain of A[i]. More generally, the domain of the expression is the union of the domains of the expressions A[i] where the i are in the domain of exp.


operator[]

public IlcIntVar & operator[](IlcInt index) const

This subscripting operator returns a reference to a constrained integer variable corresponding to the given index in the invoking array of constrained integer variables. CP Optimizer will throw an exception (an instance of IloCP::Exception) with the message "bad index" if the given index is not a valid one for the invoking array of constrained integer variables.