The routine CPXaddrows()
adds constraints to a specified CPLEX problem object. This routine may be called any time after a call to CPXcreateprob()
.
When adding a ranged row, CPXaddrows()
sets the corresponding range value to 0. Use the routine CPXchgrngval()
to change the range value.
The routine returns a zero on success, and a nonzero if an error occurs.
The pointer to the CPLEX environment as returned by CPXopenCPLEX()
.
A pointer to a CPLEX problem object as returned by CPXcreateprob()
.
The use of CPXaddrows() as a way to add new columns is discouraged in favor of a direct call to
CPXnewcols() before calling CPXaddrows() .

An integer that indicates the number of new rows to be added to the constraint matrix.
sense[i]  = ' L '  constraint 
sense[i]  = ' E '  = constraint 
sense[i]  = ' G '  constraint 
sense[i]  = ' R '  ranged constraint 
Arrays that describe the rows to be added. The format is similar to the format used to describe the constraint matrix in the routine CPXcopylp()
(see description of matbeg, matcnt
, matind
, and matval
in that routine), but the nonzero coefficients are grouped by row instead of column in the array rmatval
. The nonzero elements of every row must be stored in sequential locations in this array from position rmatbeg[i]
to rmatbeg[i+1]1
(or from rmatbeg[i]
to nzcnt 1
if i=rcnt1
). Each entry, rmatind[i]
, indicates the column index of the corresponding coefficient, rmatval[i]
. Unlike CPXcopylp()
, all rows must be contiguous, and rmatbeg[0]
must be 0.
status = CPXaddrows (env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, newcolname, newrowname); 