XPRSloadmip, XPRSloadmip64
Purpose
Used to load a
MIP problem into the Optimizer data structures.
Integer,
binary,
partial integer,
semi-continuous and
semi-continuous integer variables can be defined, together with
sets of type 1 and 2. The reference row values for the set members are passed as an array rather than specifying a reference row.
Topic areas
Synopsis
int XPRS_CC XPRSloadmip(XPRSprob prob, const char *probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const int start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[], int nentities, int nsets, const char coltype[], const int entind[], const double limit[], const char settype[], const int setstart[], const int setind[], const double refval[]);
int XPRS_CC XPRSloadmip64(XPRSprob prob, const char *probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const XPRSint64 start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[], int nentities, int nsets, const char coltype[], const int entind[], const double limit[], const char settype[], const XPRSint64 setstart[], const int setind[], const double refval[]);
Arguments
|
prob
|
The current problem.
|
||||||||||
|
probname
|
A string of up to
MAXPROBNAMELENGTH characters containing a name for the problem. If
probname is
NULL, the problem name will be an empty string.
|
||||||||||
|
ncols
|
Number of structural columns in the matrix.
|
||||||||||
|
nrows
|
Number of rows in the matrix not (including the objective row). Objective coefficients must be supplied in the objcoef array, and the objective function should not be included in any of the other arrays.
|
||||||||||
|
rowtype
|
Character array of length
nrows containing the row types:
May be
NULL if the problem contains no rows.
|
||||||||||
|
rhs
|
Double array of length
nrows containing the right hand side coefficients of the rows. The right hand side value for a range row gives the upper bound on the row. May be NULL if the problem contains no rows.
|
||||||||||
|
rng
|
Double array of length
nrows containing the range values for range rows. Values for all other rows will be ignored. May be NULL if not required. The lower bound on a range row is the right hand side value minus the range value. The sign of the range value is ignored - the absolute value is used in all cases. |
||||||||||
|
objcoef
|
Double array of length
ncols containing the objective function coefficients. This can be NULL to set all objective coefficients to 0 (zero).
|
||||||||||
|
start
|
Integer array containing the offsets in the
rowind and
rowcoef arrays of the start of the elements for each column. This array contains one entry for each column, plus one more if collen is
NULL. If
collen is
NULL, the last entry of
start contains the position in the
rowind and
rowcoef arrays at which an extra column would start, if it were present. This value is also the length of the rowind and
rowcoef arrays. May be
NULL if the problem contains no coefficients.
|
||||||||||
|
collen
|
Integer array of length
ncols containing the number of nonzero elements in each column. May be NULL if not required. This array is not required if the non-zero coefficients in the
rowind and
rowcoef arrays are contiguous, and the
start array has an additional entry as described above.
|
||||||||||
|
rowind
|
Integer array containing the row indices for the nonzero elements in each column. May be NULL if the problem contains no coefficients. If the indices are input contiguously, with the columns in ascending order, the length of the rowind array is found by adding the
start entry for the last column to the
collen entry for the last column, or if
collen is
NULL, by the additional entry at the end of
start.
|
||||||||||
|
rowcoef
|
Double array containing the nonzero element values; length as for
rowind. May be
NULL if the problem contains no coefficients.
|
||||||||||
|
lb
|
Double array of length
ncols containing the lower bounds on the columns. Use
XPRS_MINUSINFINITY to represent a lower bound of minus infinity. If this is NULL then all lower bounds are 0 (zero).
|
||||||||||
|
ub
|
Double array of length
ncols containing the upper bounds on the columns. Use
XPRS_PLUSINFINITY to represent an upper bound of plus infinity. If this is NULL then all upper bounds are infinite.
|
||||||||||
|
nentities
|
Number of binary, integer, semi-continuous, semi-continuous integer and partial integer entities.
|
||||||||||
|
nsets
|
Number of SOS1 and SOS2 sets.
|
||||||||||
|
coltype
|
Character array of length
nentities containing the entity types:
May be
NULL if all variables are continuous.
|
||||||||||
|
entind
|
Integer array of length
nentities containing the column indices of the MIP entities. May be NULL if the problem contains no entities.
|
||||||||||
|
limit
|
Double array of length
nentities containing the integer limits for the partial integer variables and lower bounds for semi-continuous and semi-continuous integer variables (any entries in the positions corresponding to binary and integer variables will be ignored). May be NULL if not required.
|
||||||||||
|
settype
|
Character array of length
nsets containing the set types:
May be
NULL if not required.
|
||||||||||
|
setstart
|
Integer array containing the offsets in the
setind and
refval arrays indicating the start of each set. This array has one entry for each set plus one extra entry containing the offset where an additional set would start, if it were present. May be NULL if not required.
|
||||||||||
|
setind
|
Integer array of length
setstart[nsets]-1 containing the columns in each set. May be
NULL if not required.
|
||||||||||
|
refval
|
Double array of length
setstart[nsets]-1 containing the reference row entries for each member of the sets. These define the order for SOS2 constraints and may be used in branching for both types. May be NULL if not required.
|
Related controls
Integer
Double
|
Number of extra columns to be allowed for.
|
|
|
Number of extra matrix elements to be allowed for.
|
|
|
Number of extra MIP entities to be allowed for.
|
|
|
Number of extra rows to be allowed for.
|
|
|
Status for nonbinding rows.
|
|
|
Type of scaling.
|
Double
|
Tolerance on matrix elements.
|
|
|
Minimum gap between reference row entries.
|
Example
The following specifies an integer problem,
MIPexample, corresponding to:
with both
x and
y integral:
| minimize: | x + 2y | ||
| subject to: | 3x + 2y | ≤ | 400 |
| x + 3y | ≤ | 200 |
char probname[] = "MIPexample";
int ncols = 2, nrows = 2;
char rowtype[] = {'L','L'};
double rhs[] = {400.0, 200};
int start[] = {0, 2, 4};
int rowind[] = {0, 1, 0, 1};
double rowcoef[] = {3.0, 1.0, 2.0, 3};
double objcoefs[] = {1.0, 2};
double lb[] = {0.0, 0.0};
double ub[] = {200.0, 200};
int nentities = 2;
int nsets = 0;
char coltype[] = {"I","I"};
int entind[] = {0,1};
...
XPRSloadmip(prob, probname, ncols, nrows, rowtype, rhs, NULL,
objcoefs, start, NULL, rowind,
rowcoef, lb, ub, nentities, nsets, coltype, entind,
NULL, NULL, NULL, NULL, NULL);
Further information
1. The row and column indices follow the usual C convention of going from
0 to
nrows-1 and
0 to
ncols-1 respectively.
2. The double constants
XPRS_PLUSINFINITY and
XPRS_MINUSINFINITY are defined in the Optimizer library header file.
3. Semi-continuous lower bounds are taken from the
limit array. If this is
NULL then they are given a default value of
1. If a semi-continuous variable has a positive lower bound then this will be used as the semi-continuous lower bound and the lower bound on the variable will be set to zero.
4. Passing zero for all integer arguments and
NULL for all array arguments will load an empty problem.
Related topics
© 2001-2026 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.
