Description
The routine CPXnewrows() adds empty constraints to a specified CPLEX LP problem object. This routine may be called any time after a call to CPXcreateprob().rcnt rows are added to a problem object already having k rows, the new rows will have indices k, k+1, ... k+rcnt-1. The constraint coefficients in the new rows will be zero; the constraint coefficients can be changed with calls to CPXchgcoef(), CPXchgcoeflist() or CPXaddcols(). Return Value
The routine returns a zero on success, and a nonzero if an error occurs.Synopsis
int CPXnewrows (CPXENVptr env,
CPXLPptr lp,
int rcnt,
double *rhs,
char *sense,
double *rngval,
char **rowname);
CPXENVptr envThe pointer to the CPLEX environment as returned by one of the
CPXopenCPLEX routines.
CPXLPptr lpA pointer to a CPLEX LP problem object as returned by
CPXcreateprob().
int rcntAn integer that indicates the number of new rows to be added to the problem object.
double *rhsAn array of length
rcnt containing the right-hand side term for each constraint to be added to the problem object. This array may be NULL, in which case the right-hand side terms are set to 0.0 for the new constraints.
char *senseAn array of length
rcnt containing the sense of each constraint to be added to the problem object.
sense[i]
|
= 'L'
|
|
sense[i]
|
= 'E'
|
= constraint
|
sense[i]
|
= 'G'
|
|
sense[i]
|
= 'R'
|
ranged constraint
|
double *rngvalAn array of length
rcnt containing the range values for the new constraints. If a new constraint has sense[i]='R', then the value of constraint i can be between rhs[i] and rhsi[i]+rngval[i]. This array may be NULL, in which case the range values are all set to 0.
char **rownameAn array of length
rcnt containing pointers to character strings that represent the names of the new rows, or equivalently, the constraint names. rowname may be NULL in which case the new rows are assigned default names if the rows already resident in the problem object have names; otherwise no names are associated with the constraints. If row names are passed to CPXnewrows() but existing constraints have no names assigned, default names are created for them.
status = CPXnewrows (env, lp, rcnt, rhs, sense, NULL, newrowname);