CPXXcheckaddcols and CPXcheckaddcols
Checks data when columns are added to a model.
Signature
CPXCHECKLIBAPI
int CPXPUBLIC CPXXcheckaddcols (CPXCENVptr env,
CPXCLPptr lp,
CPXDIM ccnt,
CPXNNZ nzcnt,
const double *obj,
const CPXNNZ *cmatbeg,
const CPXDIM *cmatind,
const double *cmatval,
const double *lb,
const double *ub,
char **colname);
CPXCHECKLIBAPI
int CPXPUBLIC CPXcheckaddcols (CPXCENVptr env,
CPXCLPptr lp,
CPXDIM ccnt,
CPXNNZ nzcnt,
const double *obj,
const CPXNNZ *cmatbeg,
const CPXDIM *cmatind,
const double *cmatval,
const double *lb,
const double *ub,
char **colname);
Description
This routine validates the arguments of the corresponding routine
CPXXaddcols and CPXaddcols.
The source code of this data checking routine
is in the file check.c, provided
as part of the product.
To call this routine, you must compile
and link check.c with your program
as you compile and link with the CPLEX Callable Library.
Arguments
The arguments of this routine are the same as those of
CPXXaddcols and CPXaddcols.
The second argument, lp, is technically
a pointer to a constant LP object
of type CPXCLPptr rather than type CPXLPptr,
because this routine does not modify the problem.
For most user applications, this distinction is unimportant.
| Name | Description |
|---|---|
| env | A pointer to the CPLEX environment as returned by CPXXopenCPLEX and CPXopenCPLEX. |
| lp | A pointer to a CPLEX problem object as returned by CPXXcreateprob and CPXcreateprob. |
| ccnt | An integer that specifies the number of new columns being added to the constraint matrix. |
| nzcnt | An integer that specifies the number of nonzero constraint coefficients to be added to the constraint matrix. |
| obj |
An array of length ccnt containing the objective function coefficients of the new variables. May be NULL, in which case, the objective coefficients of the new columns are set to 0.0 (zero).
|
| 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
CPXXcopylp and CPXcopylp.
(See description of matbeg,
matcnt,
matind, and
matval in that routine).
|
| lb | An array of length ccnt containing the lower
bound on each of the new variables. Any lower bound that is set to a value less than or equal to
that of the constant -CPX_INFBOUND is treated as negative
infinity. CPX_INFBOUND is defined in the header file
cpxconst.h. May be NULL, in which case the lower bounds of the
new columns are set to 0.0 (zero). |
| ub | An array of length ccnt containing the upper
bound on each of the new variables. Any upper bound that is set to a value greater than or equal to
that of the constant CPX_INFBOUND is treated as infinity.
CPX_INFBOUND is defined in the header file
cpxconst.h. May be NULL, in which case the upper bounds of the
new columns are set to CPX_INFBOUND (positive infinity). |
| colname |
An array of length ccnt containing pointers to character strings that specify the names of the new variables added to the problem object. May be NULL, in which case the new columns are assigned default names if the columns already resident in the CPLEX problem object have names; otherwise, no names are associated with the variables. If column names are passed to CPXXaddcols/CPXaddcols but existing variables have no names assigned, default names are created for them.
|
Return
The routine returns nonzero if it detects an error in the data; it returns zero if it does not detect any data errors.
Example
status = CPXcheckaddcols (env,
lp,
ccnt,
nzcnt,
obj,
cmatbeg,
cmatind,
cmatval,
lb,
ub,
newcolname);