NO FRAMES

Class IloConstraintArray

Definition file: ilconcert/iloexpression.h

For each basic type, Concert Technology defines a corresponding array class. IloConstraintArray is the array class of constraints for a model.

Instances of IloConstraintArray are extensible. That is, you can add more elements to such an array. References to an array change whenever an element is added or removed from the array.

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.

Arrays

See Also:

Constructor Summary
public IloConstraintArray(IloDefaultArrayI *)
public IloConstraintArray(const IloConstraintArray &)
public IloConstraintArray(const IloEnv, IloInt)
public IloConstraintArray(const IloEnv, IloInt, const IloConstraint, const IloConstraint v1...)
Method Summary
public voidadd(IloInt, const IloConstraint)
public voidadd(const IloConstraint)
public voidadd(const IloConstraintArray)
public IloConstraintoperator[](IloInt)
public IloConstraint &operator[](IloInt)
Inherited Methods from IloExtractableArray
add, add, add, endElements
Constructor Detail

IloConstraintArray

public IloConstraintArray(IloDefaultArrayI * i)

This constructor creates an empty array. You cannot create instances of the undocumented class IloDefaultArrayI. As a parameter in this default constructor, it allows you to pass 0 (zero) as a value to an optional parameter in functions and member functions that accept an array as a parameter.


IloConstraintArray

public IloConstraintArray(const IloConstraintArray & copy)

This copy constructor makes a copy of the array indicated by copy.


IloConstraintArray

public IloConstraintArray(const IloEnv env, IloInt n)

This constructor creates an array of n elements, each of which is an empty handle.


IloConstraintArray

public IloConstraintArray(const IloEnv env, IloInt n, const IloConstraint v0, const IloConstraint v1... )

This constructor creates an array of n constraints for use in a model.


Method Detail

add

public void add(IloInt more, const IloConstraint x)

This member function appends constraint to the invoking array multiple times. The parameter more indicates how many times.


add

public void add(const IloConstraint x)

This member function appends constraint to the invoking array.


add

public void add(const IloConstraintArray x)

This member function appends the elements in array to the invoking array.


operator[]

public IloConstraint operator[](IloInt i)

This operator returns a reference to the constraint located in the invoking array at the position indicated by the index i. Concert Technology uses the const operator

IloConstraint  operator[] (IloInt i) const;

on const arrays.


operator[]

public IloConstraint & operator[](IloInt i)

This operator returns a reference to the constraint located in the invoking array at the position indicated by the index i.