Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXaddcols
adds columns to a specified CPLEX
problem object. This routine may be called any time after a problem object
is created via CPXcreateprob
.
The routine CPXaddcols
is very similar to the routine
CPXaddrows
. The primary difference is that
CPXaddcols
cannot add coefficients in rows that do not
already exist (that is, in rows with index greater than the number returned
by CPXgetnumrows
); whereas CPXaddrows
can add
coefficients in columns with index greater than the value returned by
CPXgetnumcols
, by the use of the ccnt
argument.
(See the discussion of the ccnt
argument for
CPXaddrows
.) Thus, CPXaddcols
has no variable
rcnt
and no array rowname
.
The routine CPXnewrows
can be used to add empty rows
before adding new columns via CPXaddcols
.
The nonzero elements of every column must be stored in sequential
locations in the array cmatval
from position
cmatbeg[i]
to cmatbeg[i+1]
(or from
cmatbeg[i]
to nzcnt-1
if i=ccnt-1
).
Each entry, cmatind[i]
, indicates the row number of the
corresponding coefficient, cmatval[i]
. Unlike
CPXcopylp
, all columns must be contiguous, and
cmatbeg[0]
must be 0.
Example
status = CPXaddcols (env, lp, ccnt, nzcnt, obj, cmatbeg, cmatind, cmatval, lb, ub, newcolname);
env | A pointer to the CPLEX environment as returned by the |
lp | A pointer to a CPLEX problem object as returned by |
ccnt | An integer that indicates the number of new columns being added to the constraint matrix. |
nzcnt | An integer that indicates the number of nonzero constraint coefficients to be added to the constraint matrix. |
obj | An array of length |
cmatbeg | Array that specifies the nonzero elements of the columns being added. |
cmatind | Array that specifies the nonzero elements of the columns being added. |
cmatval | Array that specifies the nonzero elements of the columns being added. The format is similar to the format used to specify the constraint matrix in the routine |
lb | An array of length |
ub | An array of length |
colname | An array of length |