Initializing help system before first use

XPRSloadmiqp, XPRSloadmiqp64

Purpose
Used to load a MIQP problem, hence a MIP with quadratic objective coefficients, 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 XPRSloadmiqp(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 nobjqcoefs, const int objqcol1[], const int objqcol2[], const double objqcoef[], const int nentities, const 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 XPRSloadmiqp64(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[], XPRSint64 nobjqcoefs, const int objqcol1[], const int objqcol2[], const double objqcoef[], const int nentities, const 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.
ncols 
Number of structural columns in the matrix.
nrows 
Number of rows in the matrix (not including the objective). 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 type:
indicates a ≤ constraint;
indicates an = constraint;
indicates a ≥ constraint;
indicates a range constraint;
indicates a nonbinding constraint.
rhs 
Double array of length nrows containing the right hand side coefficients. The right hand side value for a range row gives the upper bound on the row.
rng 
Double array of length nrows containing the range values for range rows. The values in the range array will only be read for R type rows. The entries for other type 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). 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 is of length ncols or, if collen is NULL, length ncols+1.
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 continuous, and the start array has ncols+1 entries as described above. It may be NULL if not required.
rowind 
Integer arrays containing the row indices for the nonzero elements in each column. If the indices are input contiguously, with the columns in ascending order, then the length of rowind is start[ncols-1]+collen[ncols-1] or, if collen is NULL, start[ncols].
rowcoef 
Double array containing the nonzero element values length as for rowind.
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. It this is NULL then all upper bounds are infinite.
nobjqcoefs 
Number of quadratic terms.
objqcol1 
Integer array of size nobjqcoefs containing the column index of the first variable in each quadratic term.
objqcol2 
Integer array of size nobjqcoefs containing the column index of the second variable in each quadratic term.
objqcoef 
Double array of size nobjqcoefs containing the quadratic coefficients.
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:
binary variables;
integer variables;
partial integer variables;
semi-continuous variables;
semi-continuous integers.
entind 
Integer array of length nentities containing the column indices of the MIP 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:
SOS1 type sets;
SOS2 type sets.
May be NULL if not required.
setstart 
Integer array containing the offsets in the setind and refval arrays indicating the start of the sets. This array is of length nsets+1, the last member containing the offset where set nsets+1 would start. 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
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
Minimize -6x 1 + 2x 1 2 - 2x 1x 2 + 2x 2 2 subject to x 1 + x 2 ≤ 1.9, where x 1 must be an integer:
int nrows = 1, ncols = 2, nquad = 3;
int start[] = {0, 1, 2};
int rowind[] = {0, 0};
double rowcoef[] = {1, 1};
double rhs[] = {1.9};
char rowtype[] = {'L'};
double lbound[] = {0, 0};
double ubound[] = {XPRS_PLUSINFINITY, XPRS_PLUSINFINITY};

double objcoef[] = {-6, 0};
int objqcol1[] = {0, 0, 1};
int objqcol2[] = {0, 1, 1};
double dquad[] = {4, -2, 4};

int nentities = 1, nsets = 0;
int entind[] = {0};
char coltype[]={'I'};

double *primal, *dual;

primal = malloc(ncols*sizeof(double));
dual = malloc(nrows*sizeof(double));
...
XPRSloadmiqp(prob, "myprob", ncols, nrows, rowtype, rhs,
                NULL, objcoef, start, NULL, rowind,
                rowcoef, lbound, ubound, nquad, objqcol1, objqcol2,
                dquad, nentities, nsets, coltype, entind, NULL,
                NULL, NULL, NULL, NULL)
Further information
1. The objective function is of the form c'x+ 0.5 x'Qx. Note that only the upper or lower triangular part of the Q matrix is specified.
2. The row and column indices follow the usual C convention of going from 0 to nrows-1 and 0 to ncols-1 respectively.
3. The double constants XPRS_PLUSINFINITY and XPRS_MINUSINFINITY are defined in the Optimizer library header file.
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.