XPRBgetnextterm
Purpose
Synopsis
const void *XPRBgetnextterm(XPRBctr ctr, const void *ref, XPRBvar *var, double *coeff);
Arguments
|
ctr
|
Constraint whose terms are to be enumerated.
|
|
ref
|
Reference pointer or
NULL.
|
|
var
|
BCL reference to a variable. May be
NULL if not required.
|
|
coeff
|
Coefficient associated to variable
var. May be
NULL if not required.
|
Return value
Reference pointer for the next call to
XPRBgetnextterm or
NULL if there are no more terms.
Example
XPRBprob prob;
XPRBctr ctr;
XPRBvar var;
double coeff;
const void *ref;
...
ref = NULL;
while ((ref = XPRBgetnextterm(ctr, ref, &var, &coeff)) != NULL) {
XPRBprintf("Variable %s has coefficient %g\n",
XPRBgetvarname(var), coeff);
}
This code extract prints all linear terms of a constraint.
Further information
This function can be used to enumerate the linear terms of a constraint. The second parameter serves to keep track of current location in the enumeration; if this parameter is NULL, the first term is returned. This function returns NULL if it is called with the reference to the last element. Otherwise, the returned value can be used as the input parameter ref to retrieve the following term of the same type. Note that the constant term of the constraint is not included in this enumeration (it can be retrieved with XPRBgetcoeff)
Related topics
© 2001-2022 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.
