CPXXcheckcopylpwnames and CPXcheckcopylpwnames

Checks data copied by CPXXcopylpwnames/CPXcopylpwnames.

Signature


CPXCHECKLIBAPI
int CPXPUBLIC CPXXcheckcopylpwnames (CPXCENVptr env, 
                                    CPXCLPptr lp, 
                                    CPXDIM numcols,
                                    CPXDIM numrows, 
                                    int objsen, 
                              const double *obj,
                              const double *rhs, 
                              const char *sense,
                              const CPXNNZ *matbeg, 
                              const CPXDIM *matcnt,
                              const CPXDIM *matind, 
                              const double *matval,
                              const double *lb, 
                              const double *ub,
                              const double *rngval,
                                    char **colname, 
                                    char **rowname);
    

CPXCHECKLIBAPI
int CPXPUBLIC CPXcheckcopylpwnames (CPXCENVptr env, 
                                    CPXCLPptr lp, 
                                    CPXDIM numcols,
                                    CPXDIM numrows, 
                                    int objsen, 
                              const double *obj,
                              const double *rhs, 
                              const char *sense,
                              const CPXNNZ *matbeg, 
                              const CPXDIM *matcnt,
                              const CPXDIM *matind, 
                              const double *matval,
                              const double *lb, 
                              const double *ub,
                              const double *rngval,
                                    char **colname, 
                                    char **rowname);
    

Description

This routine validates the arguments of the corresponding routine CPXXcopylpwnames and CPXcopylpwnames. That is, it validates data copied to define a linear programming model, with its objective function, constraint matrix, bounds, righthand side, and names. 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 CPXXcopylpwnames and CPXcopylpwnames. 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/CPXopenCPLEX.
lp A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.
numcols An integer that specifies the number of columns in the constraint matrix, or equivalently, the number of variables in the problem object.
numrows An integer that specifies the number of rows in the constraint matrix, not including the objective function or bounds on the variables.
objsense An integer that specifies whether the problem is a minimization or maximization problem. Table 1 shows its possible settings.
objective An array of length at least numcols containing the objective function coefficients.
rhs An array of length at least numrows containing the righthand side value for each constraint in the constraint matrix.
sense An array of length at least numrows containing the sense of each constraint in the constraint matrix. Table 2 shows the possible settings.
matbeg An array that defines the constraint matrix.
matcnt An array that defines the constraint matrix.
matind An array that defines the constraint matrix.
matval An array that defines the constraint matrix.
lb An array of length at least numcols containing the lower bound on each of the 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.
ub An array of length at least numcols containing the upper bound on each of the 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.
rngval An array of length at least numrows containing the range value of each ranged constraint. Ranged rows are those designated by R in the sense array. If the row is not ranged, the rngval array entry is ignored. If rngval[i] > 0, then row i activity is in [rhs[i],rhs[i]+rngval[i]], and if rngval[i] <= 0, then row i activity is in [rhs[i]+rngval[i],rhs[i]]. This argument may be NULL.
colname An array of length at least numcols containing pointers to character strings. Each string is terminated with the NULL character. These strings represent the names of the matrix columns or, equivalently, the variable names. May be NULL if no names are associated with the variables. If colname is not NULL, every variable must be given a name. The addresses in colname do not have to be in ascending order.
rowname An array of length at least numrows containing pointers to character strings. Each string is terminated with the NULL character. These strings represent the names of the matrix rows or, equivalently, the constraint names. May be NULL if no names are associated with the constraints. If rowname is not NULL, every constraint must be given a name. The addresses in rowname do not have to be in ascending order.

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 = CPXXcheckcopylpwnames (env,
                                lp,
                                numcols,
                                numrows,
                                objsen,
                                obj,
                                rhs,
                                sense,
                                matbeg,
                                matcnt,
                                matind,
                                matval,
                                lb,
                                ub,
                                rngval,
                                colname,
                                rowname);