Initializing help system before first use

XPRSgetpwlcons, XPRSgetpwlcons64

XPRSgetpwlcons, XPRSgetpwlcons64


Purpose
Returns the piecewise linear constraints y = f(x) in a given range.
Synopsis
int XPRS_CC XPRSgetpwlcons(XPRSprob prob, int col[], int resultant[], int start[], double xval[], double yval[], int size, int *npoints, int first, int last);

int XPRS_CC XPRSgetpwlcons64(XPRSprob prob, int col[], int resultant[], XPRSint64 start[], double xval[], double yval[], XPRSint64 size, XPRSint64 *npoints, int first, int last);
Arguments
prob 
The current problem.
col 
Integer array which will be filled with the indices of the input variables x. It must be of length at least last-first+1. May be NULL if not required.
resultant 
Integer array which will be filled with the indices of the output variables y. It must be of length at least last-first+1. May be NULL if not required.
start 
Integer array which will be filled with the start indices of the different constraints in the breakpoint arrays. It must be of length at least last-first+2. The x-values of the breakpoints of piecewise linear constraint i < last will be given in xval[start[i]] to xval[start[i+1]]. May be NULL if not required.
xval 
Double array of length size which will be filled with the x-values of the breakpoints. May be NULL if not required.
yval 
Double array of length size which will be filled with the y-values of the breakpoints. May be NULL if not required.
size 
Maximum number of breakpoints to be retrieved.
npoints 
Pointer to return the number of breakpoints in the selected constraints. If the number of breakpoints is greater than size, then only size elements will be returned in the xval and yval arrays. May be NULL if not required.
first 
First piecewise linear constraint in the range.
last 
Last piecewise linear constraint in the range.
Example
The following example retrieves all variables and breakpoints in the first two piecewise linear constraints:
int *col;
int *resultant;
int *start;
double *xval;
double *yval;
int size;
int npoints;
...
XPRSgetpwlcons(prob, NULL, NULL, NULL, NULL, NULL, 0, &size, 0, 1);
col = (int*) malloc(2*sizeof(int));
resultant = (int*) malloc(2*sizeof(int));
start = (int*) malloc(3*sizeof(int));
xval = (double*) malloc(size*sizeof(double);
yval = (double*) malloc(size*sizeof(double);
XPRSgetpwlcons(prob, col, resultant, start, xval, yval, size, &npoints, 0, 1);
...
Further information
It is possible to obtain just the number of breakpoints in the range of piecewise linear constraints by calling this function with size set to 0, in which case the required size for the breakpoint arrays will be returned in npoints.
Related topics

© 2001-2020 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.