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 routine returns a zero on success, and a nonzero if an error occurs.
The pointer to the CPLEX environment as returned by the CPXopenCPLEX()
routine.
A pointer to a CPLEX problem object as returned by CPXcreateprob()
.
An integer that indicates the number of new columns being added to the constraint matrix.
Arrays that specify the nonzero elements of the columns being added. The format is similar to the format used to specify the constraint matrix in the routine CPXcopylp()
. (See description of matbeg
, matcnt
, matind
, and matval
in that routine).
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.
status = CPXaddcols (env, lp, ccnt, nzcnt, obj, cmatbeg, cmatind, cmatval, lb, ub, newcolname); |