NO FRAMES

Class IloNumColumn

Definition file: ilconcert/iloexpression.h
For ILOG CPLEX: helps you design a model through column representation.

An instance of this class helps you design a model through column representation. In other words, you can create a model by defining each of its columns as an instance of this class. In particular, an instance of IloNumColumn enables you to build a column for a numeric variable (an instance of IloNumVar) with information about the extractable objects (such as objectives, constraints, etc.) where that numeric variable may eventually appear, even if the numeric variable has not yet been created.

Usually you populate a column (an instance of this class) with objects returned by the operator() of the class (such as IloObjective::operator()) where you want to install the newly created variable, as in the examples below.

An instance of IloNumColumn keeps a list of those objects returned by operator(). In other words, an instance of IloNumColumn knows the extractable objects where a numeric variable will be added when it is created.

When you create a new instance of IloNumVar with an instance of IloNumColumn as an argument, then Concert Technology adds the newly created numeric variable to all the extractable objects (such as constraints, ranges, objectives, etc.) for which an instance of IloAddNumVar will be added to this instance of IloNumColumn. Note that IloNumColumn does not support normalization, as normalization is not well defined for constraints such as IloSOS1 and IloAllDiff.

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.

For information on columnwise modeling, see the concept Column-Wise Modeling.

See Also:

Constructor Summary
public IloNumColumn(const IloEnv env)
public IloNumColumn(const IloAddNumVar & var)
Method Summary
public voidclear() const
public operator const IloAddNumVar &() const
public IloNumColumn &operator+=(const IloAddValueToRange & rhs)
public IloNumColumn &operator+=(const IloAddNumVar & rhs)
public IloNumColumn &operator+=(const IloNumColumn & rhs)
Constructor Detail

IloNumColumn

public IloNumColumn(const IloEnv env)

This constructor creates an empty column in the environment env.


IloNumColumn

public IloNumColumn(const IloAddNumVar & var)

This constructor creates a column and adds var to it.


Method Detail

clear

public void clear() const

This member function removes (from the invoking column) its list of extractable objects.


operator const IloAddNumVar &

public operator const IloAddNumVar &() const

This casting operator allows you to use instances of IloNumColumn in column expressions. It accepts an extractable object, such as an objective (an instance of IloObjective) or a constraint (an instance of IloConstraint). It returns the object derived from IloAddNumVar and needed to represent the extractable object in column format.


operator+=

public IloNumColumn & operator+=(const IloAddValueToRange & rhs)

This operator adds the appropriate instances of IloAddValueToRange for the righthand side rhs to the invoking column.

Examples:

To use an instance of this class to create a column with a coefficient of 2 in the objective, with 10 in range1, and with 3 in range2, set:

 IloNumColumn col = obj(2) + range1(10) + range2(3);
 

To use an instance of this class to create a numeric variable corresponding to the column with lower bound 0 (zero) and upper bound 10:

 IloNumVar var(env, col, 0, 10);
 

Another example:

 IloNumColumn col1(env);

 IloNumColumn col2 = rng7(3.1415);

 col1 += obj(1.0);

 col1 += rng(-12.0);

 col2 += rng2(13.7) + rng3(14.7);

 col2 += col1;
 

operator+=

public IloNumColumn & operator+=(const IloAddNumVar & rhs)

This operator adds the appropriate instances of IloAddNumVar for the righthand side rhs to the invoking column.


operator+=

public IloNumColumn & operator+=(const IloNumColumn & rhs)

This operator assigns the righthand side rhs to the invoking column.