Overview | Group | Index | Concepts |
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.
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);
env | A pointer to the CPLEX environment as returned by the |
lp | A pointer to a CPLEX problem object as returned by |
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 |
rhs_p | A pointer to a |
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 | An array to contain the coefficients of the linear portion of the specified indicator constraint. May be NULL if |
space | An integer indicating the length of the arrays |
surplus_p | A pointer to an integer to contain the difference between |
which | An integer specifying which indicator constraint to return. |
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.