Overview | Group | Tree | Graph | Index | Concepts |
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 a
parameter, 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
.
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:
IloNumVar, IloObjective, IloRange
Constructor Summary | |
---|---|
public | IloNumColumn(const IloEnv) |
public | IloNumColumn(const IloAddNumVar &) |
Method Summary | |
---|---|
public void | clear() |
public | operator const IloAddNumVar &() |
public IloNumColumn & | operator+=(const IloAddValueToRange &) |
public IloNumColumn & | operator+=(const IloAddNumVar &) |
public IloNumColumn & | operator+=(const IloNumColumn &) |
Constructor Detail |
---|
This constructor creates an empty column in the environment
env
.
This constructor creates a column and adds var
to it.
Method Detail |
---|
This member function removes (from the invoking column) its list of extractable objects.
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.
This operator adds the appropriate instances of
IloAddValueToRange
for the right-hand 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;
This operator adds the appropriate instances of IloAddNumVar
for the right-hand side rhs
to the invoking column.
This operator assigns the right-hand side rhs
to the
invoking column.