NO FRAMES

CPXgetrows

int CPXPUBLIC CPXgetrows(CPXCENVptr env, CPXCLPptr lp, int * nzcnt_p, int * rmatbeg, int * rmatind, double * rmatval, int rmatspace, int * surplus_p, int begin, int end)
Definition file: cplex.h
Include files: cplex.h

The routine CPXgetrows is used to access a range of rows of the constraint matrix, not including the objective function or the bounds constraints on the variables of a CPLEX problem object. The beginning and end of the range, along with the length of the arrays in which the nonzero entries of these rows are to be returned, must be specified.

Note
If the value of rmatspace is 0 then the negative of the value of *surplus_p returned indicates the length needed for the arrays rmatval and rmatind.

Example

 status = CPXgetrows (env, lp, &nzcnt, rmatbeg, rmatind, rmatval,
                      rmatspace, &surplus, 0, cur_numrows-1);
 

Parameters:

env

A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine.

lp

A pointer to a CPLEX problem object as returned by CPXcreateprob.

nzcnt_p

A pointer to an integer to contain the number of nonzeros returned; that is, the true length of the arrays rmatind and rmatval.

rmatbeg

An array to contain indices indicating where each of the requested rows begins in the arrays rmatval and rmatind. Specifically, row i consists of the entries in rmatval and rmatind in the range from rmatbeg[i - begin] tormatbeg[(i + 1)- begin]-1. (Row end consists of the entries fromrmatbeg[end - begin] to *nzcnt_p-1.) This array must be of length at least(end - begin+ 1).

rmatind

An array to contain the column indices of the entries of rmatval. May be NULL if rmatspace is 0.

rmatval

An array to contain the nonzero entries of the specified rows. May be NULL if rmatspace is 0.

rmatspace

An integer indicating the length of the arrays rmatind and rmatval. May be 0.

surplus_p

A pointer to an integer to contain the difference between rmatspace and the number of entries in each of the arrays rmatind and rmatval. A nonnegative value of *surplus_p indicates that the length of the arrays was sufficient. A negative value indicates that the length was insufficient and that the routine could not complete its task. In this case, the routine CPXgetrows returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *surplus_p indicates the amount of insufficient space in the arrays.

begin

An integer indicating the beginning of the range of rows to be returned.

end

An integer indicating the end of the range of rows to be returned.

Returns:

The routine returns zero on success and nonzero if an error occurs. The value CPXERR_NEGATIVE_SURPLUS indicates that insufficient space was available in the arrays rmatind and rmatval to hold the nonzero coefficients.