跳至主内容
框架 无框架

类IlcIntVarArray

定义文件: ilcp/cpext.h
包含文件: <ilcp/cpextilcp/cpext.h
IlcIntVarArray的地图IlcIntVarArrayIlcIntVarArray
类 "IlcIntVar的数组类。

类 "IlcIntVarArray是 "IlcIntVar实例数组的类。 该类的实例是从 0 开始索引的数组。

另请参阅:

方法概要
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
方法详细信息

IlcIntVarArray

公共 'IlcIntVarArray(IlcIntVarArrayI * '内含=0)

该构造函数通过指向实现对象的指针创建一个句柄对象。 如果实现对象为零,则必须在使用前初始化句柄。


IlcIntVarArray

publicIlcIntVarArray(IlcCPEngine solver,IlcInt size)

该构造函数创建了一个长度为 "size的未初始化数组。 参数 "size必须严格大于 0(零)。 数组的索引范围是 "[0 size)。 在使用数组之前,必须先分配数组中的每个元素。


IlcIntVarArray

publicIlcIntVarArray(IlcCPEngine solver,IlcInt size, constIlcIntVar exp...)

该构造函数创建了一个集合数组;数组的长度为 "size;数组元素用 "IlcIntVar类型的参数初始化。 IlcIntVar类型的参数个数必须与 "size相同。


IlcIntVarArray

public 'IlcIntVarArray( 'IlcCPEngine'求解器, 'IlcInt'尺寸, 'IlcInt'分钟, 'IlcInt'最大' )

此构造函数创建一个 "size约束整数变量数组。 参数 "size必须严格大于 0(零)。 每个受限整数变量都有一个域,该域包含 "min和 "max之间的所有整数值。


getCopy

publicIlcIntVarArray getCopy() const

该成员函数返回调用的约束变量数组的副本,并将该副本与构造时传递的 CP 优化器对象关联。


getImpl

publicIlcIntVarArrayI*getImpl() const

该成员函数返回一个指向调用句柄的实现对象的指针。


getMaxMax

publicIlcInt getMaxMax() const

该成员函数返回属于调用约束整数变量数组的变量最大值中的最大值。


getMaxMax

publicIlcInt getMaxMax(IlcInt indexMin,IlcInt indexMax) const

该成员函数返回属于调用约束整数变量数组的变量最大值中的最大值。 如果提供参数 "indexMin和 "indexMax,则只考虑与 "[indexMin indexMax)范围内的索引相对应的变量。 如果给定的 "indexMin和 "indexMax不是调用受限变量数组的有效索引,或者 "indexMin不严格小于 "indexMax,CP 优化器将抛出异常("IloException实例,信息为 ""bad index interval")。


getMaxMin

publicIlcInt getMaxMin() const

该成员函数返回属于调用约束整数变量数组的变量最小值中的最大值。


getMaxMin

publicIlcInt getMaxMin(IlcInt indexMin,IlcInt indexMax) const

该成员函数返回属于调用约束整数变量数组的变量最小值中的最大值。 如果提供参数 "indexMin和 "indexMax,则只考虑与 "[indexMin indexMax)范围内的索引相对应的变量。 如果给定的 "indexMin和 "indexMax不是调用受限变量数组的有效索引,或者 "indexMin不严格小于 "indexMax,CP 优化器将抛出异常("IloException实例,信息为 ""bad index interval")。


getMinMax

publicIlcInt getMinMax() const

该成员函数返回属于调用约束整数变量数组的变量最大值中的最小值。


getMinMax

publicIlcInt getMinMax(IlcInt indexMin,IlcInt indexMax) const

该成员函数返回属于调用约束整数变量数组的变量最大值中的最小值。 如果提供参数 "indexMin和 "indexMax,则只考虑与 "[indexMin indexMax)范围内的索引相对应的变量。 如果给定的 "indexMin和 "indexMax不是调用受限变量数组的有效索引,或者 "indexMin不严格小于 "indexMax,CP 优化器将抛出异常("IloException实例,信息为 ""bad index interval")。


getMinMin

publicIlcInt getMinMin() const

该成员函数返回属于调用约束整数变量数组的变量最小值。


getMinMin

publicIlcInt getMinMin(IlcInt indexMin,IlcInt indexMax) const

该成员函数返回属于调用约束整数变量数组的变量最小值。 如果提供参数 "indexMin和 "indexMax,则只考虑与 "[indexMin indexMax)范围内的索引相对应的变量。 如果给定的 "indexMin和 "indexMax不是调用受限变量数组的有效索引,或者 "indexMin不严格小于 "indexMax,CP 优化器将抛出异常("IloException实例,信息为 ""bad index interval")。


getSize

publicIlcInt getSize() const

该成员函数返回调用数组中变量的个数。


操作符[]

publicIlcIntExp operator[](constIlcIntExp exp) const

这个下标操作符返回一个受约束的整数表达式。 为了清楚起见,我们称 "A为调用数组。 当 "exp固定为 "i时,表达式的域就是 "A[i]的域。 更一般地说,表达式的域是表达式 "A[i]域的联合,其中 "i位于 "exp域中。


操作符[]

publicIlcIntVar&operator[]IlcInt index) const

该下标操作符将返回与调用的受限整数变量数组中给定的 "index相对应的受限整数变量的引用。 如果给定的 "index对调用的受限整数变量数组无效,CP 优化器将抛出异常("IloCP::Exception"实例),并提示"bad index"。