NO FRAMES

CPXgetqconstr

int CPXPUBLIC CPXgetqconstr(CPXCENVptr env, CPXCLPptr lp, int * linnzcnt_p, int * quadnzcnt_p, double * rhs_p, char * sense_p, int * linind, double * linval, int linspace, int * linsurplus_p, int * quadrow, int * quadcol, double * quadval, int quadspace, int * quadsurplus_p, int which)
Definition file: cplex.h
Include files: cplex.h

The routine CPXgetqconstr is used to access a specified quadratic constraint on the variables of a CPLEX problem object. The length of the arrays in which the nonzero linear and quadratic coefficients of the constraint are to be returned must be specified.

Note
If the value of linspace is 0 then the negative of the value of *linsurplus_p returned indicates the length needed for the arrays linval and rmatind.
Note
If the value of quadspace is 0 then the negative of the value of *quadsurplus_p returned indicates the length needed for the arrays quadrow, quadcol and quadval.

Example

 status = CPXgetqconstr (env, lp, &linnzcnt, &quadnzcnt, linind, linval,
                         linspace, &linsurplus, quadrow, quadcol, quadval,
                           quadspace, &quadsurplus, 0);
 

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.

linnzcnt_p

A pointer to an integer to contain the number of linear coefficients returned; that is, the true length of the arrays linind and linval.

quadnzcnt_p

A pointer to an integer to contain the number of quadratic coefficients returned; that is, the true length of the arrays quadrow, quadcol and quadval.

linind

An array to contain the variable indices of the entries of linval. May be NULL if linspace is 0.

linval

An array to contain the linear coefficients of the specified constraint. May be NULL if linspace is 0.

linspace

An integer indicating the length of the arrays linind and linval. May be 0.

linsurplus_p

A pointer to an integer to contain the difference between linspace and the number of entries in each of the arrays linind and linval. A nonnegative value of *linsurplus_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 CPXgetqconstr returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *linsurplus_p indicates the amount of insufficient space in the arrays. May be NULL if linspace is 0.

quadrow

An array to contain the variable indices of the entries of quadval. If the quadratic coefficients were stored in a matrix, quadrow would give the row indexes of the quadratic terms. May be NULL if quadspace is 0.

quadcol

An array to contain the variable indices of the entries of quadval. If the quadratic coefficients were stored in a matrix, quadcol would give the column indexes of the quadratic terms. May be NULL if quadspace is 0.

quadval

An array to contain the quadratic coefficients of the specified constraint. May be NULL if quadspace is 0.

quadspace

An integer indicating the length of the arrays quadrow, quadcol and quadval. May be 0.

quadsurplus_p

A pointer to an integer to contain the difference between quadspace and the number of entries in each of the arrays quadrow, quadcol and quadval. A nonnegative value of *quadsurplus_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 CPXgetqconstr returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *quadsurplus_p indicates the amount of insufficient space in the arrays. May be NULL if quadspace is 0.

which

An integer indicating which quadratic constraint to return.

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 either the arrays linind and linval or quadrow, quadcol, and quadval to hold the nonzero coefficients.