Initializing help system before first use

problem.getgencons

Purpose
Returns the general constraints y = f(x1, ..., xn, c1, ..., cm) in a given range.
Synopsis
(ncol, nval) = problem.getgencons(contype, resultant, colstart, colind, maxcols, valstart, val, maxvals, first, last)
Arguments
contype 
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 colind array. May be None if not required.
colind 
Integer array which will be filled with the indices of the input variables xi. May be None if not required.
maxcols 
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.
maxvals 
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 colind list if not None.
nval 
Number of values in the coef list if not None.
Example
The following example retrieves all general constraints:
contype, resultant, colstart, colind, valstart, val = [], [], [], [], [], []
prob.getgencons(contype, resultant, colstart, colind, 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 maxcols and maxvals set to 0, in which case the required size for the arrays will be returned as a tuple with ncols and nvals.
Related topics

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.