NO FRAMES

CPXgetindconstr

public int CPXgetindconstr(CPXCENVptr env, CPXCLPptr lp, int * indvar_p, int * complemented_p, int * nzcnt_p, double * rhs_p, char * sense_p, int * linind, double * linval, int space, int * surplus_p, int which)
Definition file: cplex.h

The routine CPXgetindconstr accesses a specified indicator constraint on the variables of a CPLEX problem object. The length of the arrays in which the nonzero coefficients of the constraint are to be returned must be specified.

Note
If the value of space is 0 (zero), then the negative of the value of *surplus_p returned indicates the length needed for the arrays linind and linval.

Example

 status = CPXgetindconstr (env, lp, &indvar, &complemented,
                           &linnzcnt, &rhs, &sense, linind, linval,
                           space, &surplus, 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.

indvar_p

A pointer to an integer to contain the index of the binary indicator variable. May be NULL.

complemented_p

A pointer to a Boolean value that specifies whether the indicator variable is complemented. May be NULL.

nzcnt_p

A pointer to an integer to contain the number of nonzero values in the linear portion of the indicator constraint; that is, the true length of the arrays linind and linval.

rhs_p

A pointer to a double containing the righthand side value of the linear portion of the indicator constraint.

sense_p

A pointer to a character indicating the sense of the linear portion of the constraint. Possible values are L for a <= constraint, E for an = constraint, or G for a >= constraint.

linind

An array to contain the variable indices of the entries of linval. May be NULL if space is 0 (zero).

linval

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

space

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

surplus_p

A pointer to an integer to contain the difference between space and the number of entries in each of the arrays linind and linval. 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 CPXgetindconstr returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of surplus_p indicates the amount of insufficient space in the arrays. May be NULL if space is 0 (zero).

which

An integer specifying which indicator constraint to return.

Returns:

The routine returns zero if successful and nonzero if an error occurs. The value CPXERR_NEGATIVE_SURPLUS indicates that insufficient space was available in either of the arrays linind and linval to hold the nonzero coefficients.