Initializing help system before first use

problem.getgencons

problem.getgencons


Purpose
Returns the general constraints y = f(x1, ..., xn, c1, ..., cm) in a given range.
Synopsis
(ncol, nval) = problem.getgencons(type, resultant, colstart, col, colsize, valstart, val, valsize, first, last);
Arguments
prob 
The current problem.
type 
None if not required, otherwise a list which will be filled with the types of the general constraints:
xpress.gencons_max (0) 
indicates a maximum constraint;
xpress.gencons_min (1) 
indicates a minimum constraint;
xpress.gencons_and (2) 
indicates an and constraint.
xpress.gencons_or (3) 
indicates an or constraint;
xpress.gencons_abs (4) 
indicates an absolute value constraint.
resultant 
List/array which will be filled with the output variables y. May be None if not required.
colstart 
List/array which will be filled with the start index of each general constraint in the col array. May be None if not required.
col 
Integer array which will be filled with the indices of the input variables xi. May be None if not required.
colsize 
Maximum number of input columns to be retrieved.
valstart 
Integer array of length at least last-first+1 which will be filled with the start index of each general constraint in the val array. May be None if not required.
val 
Integer array which will be filled with the constant values ci. May be None if not required.
valsize 
Maximum number of constant values to be retrieved.
first 
First general constraint in the range.
last 
Last general constraint in the range.
ncol 
Number of values in the col list if not None.
nval 
Number of values in the val list if not None.
Example
The following example retrieves all general constraints:
type, resultant, colstart, col, valstart, val = [], [], [], [], [], []
prob.getgencons(type, resultant, colstart, col, 1e9, valstart, val, 1e9, 0, prob.attributes.gencons - 1)
Further information
It is possible to obtain just the number of input columns and/or constant values in the range of general constraints by calling this function with colsize and valsize set to 0, in which case the required size for the arrays will be returned as a tuple with ncol and nval.
Related topics